You need to sign in to do that
Don't have an account?

Javascript " gettng passed as ascii
Hello - I've been banging my head too long on this one. I'm trying to show a shadowbox of the claim activity when user clicks on the outputlink. When I click on link nothing happens. I've noticed that when I hover over the outputlink for a given claim the path shown in IE8 (lower left hand corner) looks something like
javascript:showClaim("/a1NRxxxxxxxxxxxx",%20"B-000008%20Quick%20View");
It should show up as
javascript:showClaim("a1NRxxxxxxxxxxxx", "B-000008 Quick View");
The quot is for some reason getting passed as ascii....or so it seems.
Please share any thoughts and/or ideas. Thank you!
function showClaim(src, title) {
var box = new parent.SimpleDialog("hersh"+Math.random(), true);
parent.box = box;
box.setTitle(title);
box.createDialog();
box.setWidth(850);
src='<a href=\"#\" onclick=\"box.hide();\">Close</a><br/><br/><p><iframe src="' + src + '" style="border:0; width:810px; min-height: 600px"></iframe></p>'
box.setContentInnerHTML(src);
box.setupDefaultButtons();
box.show();
if( 0 > 0 )
setTimeout("box.hide();",0);
}
Here is my outputpannel
<
apex:outputpanelid="DuplicateClaimTable">
<apex:pageblocksectiontitle="Possible Duplicate Claims"columns="1"rendered="{!dupeClaimToggle}">
<apex:pageBlockTablevalue="{!dupeClaimList}"var="dupeClaim"style="width:100%">
<apex:columnstyle="background-color:yellow">
<apex:facetname="header">
Claim Name
</apex:facet>
{!dupeClaim.Name}
</apex:column>
<apex:columnstyle="background-color:yellow">
<apex:facetname="header">
View claim
</apex:facet>
<apex:outputLinkvalue="javascript:showClaim("/{!dupeClaim.Id}", "{!dupeClaim.Name} Quick View");"title="View Claim">View Claim</apex:outputLink>
</apex:column>
</apex:pageBlockTable>
</apex:pageblocksection>
</apex:outputpanel>
You may be able to get by with replacing " with just a single quote (') character. Also, your : probably isn't going render as expected either. Try:
The code snippet above is converting the colon (:) to :.
All Answers
You may be able to get by with replacing " with just a single quote (') character. Also, your : probably isn't going render as expected either. Try:
The code snippet above is converting the colon (:) to :.
Thanks very much mcrosby, but now it's trying to pass the following.
javascript:showClaim('/a1VRxxxxxxxxxxxxx',%20'a1VRxxxxxxxxxxxxxx%20Quick%20View');
What's very odd, is that I'm using this same javascript funciton in another controller with essentially identicle syntax, both in the js method and outputlink. There are only minor differences between the two pages in terms of layout. One difference between the two pages is that in the page that works, the outputlink is not wrapped in an outputpanel. I wouldn't think that that would have an impact...but right now I'm at a loss as to why one page works and the other does not.
Thanks again....if anything else comes to mind please let me know.
The <apex:outputLink> tag looks like it is encoding the data in the value attribute. You could use a standard <a> tag instead:
Thanks so much mcrosby! I revisited your first suggestion, and it appears I may have fat fingered something. Works like a champ.