You need to sign in to do that
Don't have an account?
sbrmath
CommandLink and spawning a new window
target="_blank" is not working with rerendered attribute for CommandLink.
It is not spawning a new window as expected, the results are displayed in the current browser window.
If i remove rerendered, clicking on the link spawns the new window.
Is this a known issue? is there a workaround for this?
<apex:commandLink rendered="{!result.isXYZAccount == 'NO-ADD'}" value="{!result.isXYZAccount}" action="{!loadGuest}" target="_blank" rerender="abc,xyz"/>
Hey
It's meant to work this way i.e. the rerender attribute stops navigation to a new page, and says, "Visualforce page ol' chap, why not partial page refresh that bit over there for me.".
This being the case I'd say prageeth's options is a good one, although I'd move it to the oncomplete event handler:
oncomplete="window.open('/apex/myPopupPage');"
This way you'd know that your apex code had run before you open the new page.
Wes
All Answers
Hello sqrt.math
Hello sbrmath;
Why don't you try "window.open" method? you can popup the second page as below.
If the name of your popup page(Second page) is 'myPopupPage' you can popup the second page as below.
<apex:commandLink rendered="{!result.isXYZAccount == 'NO-ADD'}"
value="{!result.isXYZAccount}"
action="{!loadGuest}"
rerender="abc,xyz"
onclick="window.open('/apex/myPopupPage');"/>
Hey
It's meant to work this way i.e. the rerender attribute stops navigation to a new page, and says, "Visualforce page ol' chap, why not partial page refresh that bit over there for me.".
This being the case I'd say prageeth's options is a good one, although I'd move it to the oncomplete event handler:
oncomplete="window.open('/apex/myPopupPage');"
This way you'd know that your apex code had run before you open the new page.
Wes
the loadGuest call returns a pagereference and i am trying to open this in the new window and at the same time refresh the parent window.
In that case I would recommend using an action function e.g.
<apex:actionfunction name="myFunction" rerender="abc,xyz" />
<apex:commandLink rendered="{!result.isXYZAccount == 'NO-ADD'}" value="{!result.isXYZAccount}" action="{!loadGuest}" target="_blank" oncomplete="myFunction();"/>
Wes