You need to sign in to do that
Don't have an account?
tantonio
Below button opens in a separate tab. Originally this is the functionality I wanted but now I need to change to have it open in the existing page.
How can I do this?
<apex:column >
<apex:commandButton onclick="return window.open('{!obj.LoginURL__c}')" value="Login" >
<Apex:outputLink value="{!obj.LoginURL__c}"/>
</apex:commandbutton>
</apex:column>
Visualforce button - how to open in existing page
Below button opens in a separate tab. Originally this is the functionality I wanted but now I need to change to have it open in the existing page.
How can I do this?
<apex:column >
<apex:commandButton onclick="return window.open('{!obj.LoginURL__c}')" value="Login" >
<Apex:outputLink value="{!obj.LoginURL__c}"/>
</apex:commandbutton>
</apex:column>
Try this .
<apex:column >
<apex:commandButton onclick="return window.open('{!obj.LoginURL__c}')" value="Login" >
<apex:outputLink value="{!obj.LoginURL__c}" target="_self" />
</apex:commandbutton>
</apex:column>
I added target="_self" in the outputlink.
Thanks
<apex:commandButton onclick="return window.open('{!obj.LoginURL__c}','_top')" value="Login"/>
No need to use output link here
I made the change you suggested and clicking the button only refreshed the existing page. It didn't bring me to the path that is contained in LoginURL__c unfortuantely.
VF didn't seem to recognize the '_top' target contained within the window.open command. I tried other things like adding target='_top' and that didn't work either.
Still haven't found the right way to this. Please any other suggestions are welcome. Thanks!