Found a solution for my special pupose of confirmation dialog. It´s given
here: http://wiki.apache.org/myfaces/JavascriptWithJavaServerFaces
But the question remains, if you have a more complex dialog.
Jörg
Jockel wrote:
>
> Hello!
>
> I want to make user-confirmations for some actions triggered by
> commandButtons.
>
> If this should be done with a link instead of a button, I could use
> <OutputLink>-Element and <ModalDialog>-Element.
>
> But when I put the javascript in the onclick-Attribute of a
> <commandButton>-Element I do not get the desired solution. The ModalDialog
> blinks up and then the newly rendered page returns from the server without
> the Modaldialog of course.
> Code for this solution that does not work:
> <t:commandButton id="submit" value="Say Hello"
> onclick="dojoDialog.show();document.getElementById('filter1').focus();"/>
> ...
> <s:modalDialog dialogId="DialogContent" dialogVar="dojoDialog"
> dialogAttr="bgColor='white' bgOpacity='0.5'
> toggle='fade'
> toggleDuration='250'"
> hiderIds="cancel1,cancel2,cancel3"
> styleClass="dojoDialog">
> <h:panelGrid columns="1">
> <h:panelGrid columns="2">
> <t:inputText id="filter1"
> forceId="true" value="Test" size="25" />
> <t:commandButton id="cancel1"
> forceId="true" value="OK"
>
> onclick="dojo.widget.byId('DialogContent').hide();"/>
> </h:panelGrid>
> ...
>
> Has anybody a suggestion how I could solve my problem? Best would be a
> solution where I can turn on and of the confirmation-step.
>
> Thank you for reading this and any suggestions.
>
> Best regards,
>
> Jörg
>
>
--
View this message in context:
http://www.nabble.com/Possible-to-trigger-ModalDialog-by-commandButton--tf4194380.html#a11930194
Sent from the MyFaces - Users mailing list archive at Nabble.com.