I want to add an hyperlink or a button in my FitNesse page.
On click of this link or button a popup window with some HTML content should open.
Please let me know if this is possible in FitNesse? If yes, how to achieve this?
I tried to search on FitNesse website but could not get information.
Adding a link to a wiki page is easy: just type the link, or use [[word or phrase][url]]. But this will not open a pop-up. I don't know how to achieve that by just using the wiki.
In a Slim fixture's result you can return any HTML (sometimes you will have to surround it with <div></div>), so you can return ... and in the test result there will be a hyperlink that will open in a new tab...
Related
am developing an application in which i have to show the customer purchase details supplier wise. for that i have develop user control an add it on page. but the problem it that on user control i need to add a ling to promotional offer page for that supplier which show the current offers of the supplier. for that i have added the hyperlink as fallow to user control
<asp:HyperLink ID="PromoLink" runat="server">Have promo Code ?</asp:HyperLink>
and set the navigation URL as fallow
PromoLink.NavigateUrl = "Promotion.aspx?Filter=" + dt.Rows[0]["SuppId"].ToString();
but when page is load in does not render the navigation url to the link.
i donot why it does not render the url plz help to get out of this.
thanks in advance.
Make sure that the pathing is correct for the NavigateURL property. Try adding "~/" at the start of the NavigateURL or "../" if it is not in the same folder as the current file.
Make sure that the dt.Rows[0]["SuppId"] is actually getting the value that you expect.
Step through code in the debugger to verify that the Page_Load event that you are using is actually executing and modifying the value as you would expect it to.
I am currently building a website containing lots of links to different sections of my website (also known as navigation). Lets call those links and their corresponding pages link1, page1 , link2, page2, link3, page3 etc.
The general code for them is this:
Link1
Link2
Link3
I want the user to click each link to move to the corresponding webpage and it works as supposed to. The problem is that I want the links to do nothing when the user is on the same page as the link they clicked (meaning it will only reload the page). Let me make this clear by using an example:
Current use: User is on page1. User clicks on link1. The browser will reload page1.
Desired use: User is on page1. User clicks on link1. The browser will do nothing.
TL;DR Essentially I am searching for an if clause. I have read there is no if clause in HTML simply because it's a markup language but what is another way to implement this? Thanks for your help.
The best answer I have found without the need to use JQuery or JS after munching through SO is this, answer made by Matt Crinklaw-Vogt:
Add a /#!. This will prevent the scrolling to the top and will also prevent the page reloading.
Code:
Link1
Original answer:
How do I stop a web page from scrolling to the top when a link is clicked that triggers JavaScript?
I'm not sure I like it, but you could use an empty bookmark to do this...
Link1
If you aren't on page1, it will load page1, but once you are there, it won't do anything.
Link2
OR
<a onclick = "return false;">Link2</a>
That cancels out the load.
On page load, you could use JS as follows
Link1
JS:
document.getElementById("link1").setAttribute("href", "#");
You can use javascript to compare the current url to the anchor link, and if they're the same, prevent the default click event. Using jquery:
var url = window.location.pathname,
urlRegExp = new RegExp(url.replace(/\/$/,'') + "$");
$('a').each(function(){
if(urlRegExp.test(this.href.replace(/\/$/,''))) {
$(this).click(function(event) {
event.preventDefault();
});
}
});
I want to send SSRS report field as querystring paramater to my application page. for this I have done following steps:
To add a hyperlink in report:
In report design view, right-click the text box I want to add a link and then click Properties.
1.In the Properties dialog box, click Action.
2.Select Go to URL. An additional section appears in the dialog box for this option.
3.In Select URL, in expression that evaluates to a URL, in pasted my pages url and concatenated it with field value in the below manner.
http://localhost:64970/InvoiceManagement.aspx?a=Fields!INVOICE_NUMBER.Value
Click OK.
but on running report and clicking on the hyperlink, it redirects me well but in querystring i got Fields!INVOICE_NUMBER.Value, it doesnt get replaced by its value(database value which is int), which should be the Invoice number.
where I am going wrong..
Your field is being evaluated as a literal string. You need to write a function to generate the URL:
="http://localhost:64970/InvoiceManagement.aspx?a=" & Fields!INVOICE_NUMBER.Value
There should be a function box for URL target you can click in the properties dialog, or you could paste the function code in over your URL's text. Note: I'm using VS to manage my SSRS reports, and I'm unsure if these methods are the same for BIDS, if that's what you're using. The problem is the same either way, though.
I am doing a PhoneGap app with JQuery Mobile and I have two pages, one that has a dynamic list of pages and one that has a form to either edit or create a page. These are in a single html file.
Tapping on a list item passes ?action=edit and tapping the "Add" button I have, passes ?action=add querystrings.
Here is a jsfiddle to visualize the pages
NOTE: The example doesn't act quite the same as the live code.
I am running my app on an Android phone and if I do these actions, the correct querysting is observed in the alert box: -
Click the add button on list page
Click back on the form page
Click the an edit list item link on list page
However, if I do it the other why around (click edit first, then the add button) clicking the add button never shows the add querystring in the alert box
(the jsfiddle example always locks the first clicked link's querystring, which is even worse than the live code!)
The problem here is that you're using a multiple template to do this. If you were using this as separate pages, this would work as normal. As a multiple app, the best way to handle this would be to make a link trigger the setting of some global variable that keeps track of the current state of the app.
Make the edit links like this
Page 15
Then make the script something like this:
var editingId = 0
function editPage(id){
editingId = id;
$.mobile.changePage("#editingPage");
});
$("div#editingPage").live("pageshow", function(){
loadDataForPage(editingId);
});
To give you a simple use case - on my website, I display the comments posted by the facebook users. For each comment I display the facebook users photo using the fb:profile-pic tag and a fb like button.
This page renders properly and everything displays well. Now when the users want to read older comments, they click on the "More" link
Using Jquery, I pull the older comments and in the javascript build the content adding the fb:profile-pic and the fb:like tags
But these tags dont show up. Do we need to reload it or something.
Thanks for your help
First make sure the FBML is being inserted into the DOM with an inspector. If so, all you need to do is tell Facebook to convert the FBML tags to HTML tags so your browser can render it. With the Graph API you call FB.XHTML.parse http://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse using the Javascript SDK. Here's an example from my code:
$('#list').append('<fb:name uid="4"></fb:name>');
FB.XFBML.parse(document.getElementById('list'));
how do I do that - like right now I
build my entire string say
comment="<div>I love
icecream<br/><fb:profile-pic
uid='xxx'></fb:profile-pic></div>"
Then I would do
$("#myswipes").html(comment); So how
would I reload.
you can use $.ajax(), say
$('a.moreComment').click(function(){
$.ajax({
url: 'some/url.php',
success : function(comment){
$("#myswipes").html(comment);
}
});
})
some/url.php should be in the server that can correctly render and return this line, <div>I love icecream<br/><fb:profile-picuid='xxx'></fb:profile-pic></div>