Does the commandButton have anything similar to a target attribute for outputLink? I am needing such a thing because I have a visualforce page that is inline or an iFrame for an Account or Contact page. Here is what my commandButton looks like at the moment

<apex:commandButton onclick="window.location.href='{!URLFOR($Action.Relationship_Detail__c.View, selectedDetail)}'" value="View" immediate="true" rendered="{!IF(BEGINS(selectedId, '00'), true, false)}" rerender="blank"/>

Again this commandButton works for the iFrame but I need it to redirect the entire window it is on.


No. Command buttons are meant for actions on controllers. You have 2 options:

1) You can specify the target on the window.open javascript method.

2) You can use styling to make the outputLink appear like a button.

  • Thank you. Went with your second option and found the styleClass="btn" was all I needed for the outputLink styling – Louis Pujol Jun 18 '14 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.