-
1. Re: How to open separate new window using h:commandButton Or a4j:commandButton
mcmurdosound Jan 9, 2012 9:53 AM (in response to sree_valtech)I'm using commandLinks like this one:
<h:commandLink value="open" action="#{bean.action(param)}" target="_blank" style="float: right; top: -3px; position: relative; z-index: 10;" styleClass="styleclass1" title="ui.openInNewTab"/> -
2. Re: How to open separate new window using h:commandButton Or a4j:commandButton
sree_valtech Jan 9, 2012 11:24 PM (in response to mcmurdosound)Using command link its possible. but for commandButton, in backing bean through action how to do it.
One more thing. If validation success then only separate new window has to open. if validation fails, failure message has to display in the same page,
Please any one give me clarification.
Thanks alot in advance.
-
3. Re: How to open separate new window using h:commandButton Or a4j:commandButton
mcmurdosound Jan 10, 2012 1:53 AM (in response to sree_valtech)hmmm I'd use a button and a link in this case:
a) the button, clickable for the user:
a4j:commandButton oncomplete="jQuery("#myform\\:mybutton").click()" value="clickme"
and
b)
the h:commandButton from the previous example - but with id and style="display:none;" to hide it.
you should add something like:if (#{facesContext.maximumSeverity.ordinal lt 2}) jQuery('#.... to only click the second link, if there are no validation errors.
you have to look for the correct syntax for yourself. I don't have any example with me right now.
-
4. Re: How to open separate new window using h:commandButton Or a4j:commandButton
sree_valtech Jan 10, 2012 6:36 AM (in response to mcmurdosound)Thanks alot Peter for your quick responce
I did in the same way, but i written java script for that.
I used both commandButton and hidden commandLink(display:none;)
when user click on commandButton, If validation success, commandLink will be clicked automatically using script and opening separate new window using' target='_blank'
, if validation fails, corresponding message will be displayed on the same page.
rightnow no issues.
But i want know alternatives to improve my knowledge.
Pleaase let me know if there is any other alternatives.
Once again thanks alot peter.