commandLink and commandButtonand changing form target
We're observing some odd behaviour when using a <h:commandLink ...> in a form which also has normal Submit actions.
If our commandLink has a target="_blank" (for contextual help) this link works and brings up in a new window. But after that, all form submits using commandButton come up in a new window too.
<h:commandLink action="#{bean.help}" value="Help" target="_blank" />
...
<h:commandButton action="#{bean.submit}" value="Submit" />
Click Submit after clicking Help and it also brings up a new window, when it should have submitted to the same window.
The javascript that runs on commandLink set the target of theform to _blank until the page is re-rendered.
So then we modified the commandButton's behaviour with this hack:
<h:commandLink action="#{bean.help}" value="Help" taget="_blank"/>
...
<h:commandButton action="#{bean.submit}" onclick="this.form.target='_self'" value="Submit" />
Which was working until we tried it on Safari. In Safari, click Help and up comes a new window, then click Submit and it stays in the same window but runs the action #{bean.help}
Anybody come across this?
Many thanks,
Andy.

