A command link does not work either. It starts a submit, but the method is
not called.
Putting a form inside the dialog messes up the rendering.
What works (partially) inside a dialog is the following. The method is
called, but unfortunatlly the value of the inputText is lost (or cleared
before submit):
...
<t:inputText id="name" value="#{wizardData.name}" forceId="true" />
<t:commandButton id="finish" forceId="true" value="Finish"
onclick="clickLink('hiddenLink');" />
</s:modalDialog>
<t:commandButton id="hiddenLink" forceId="true"
style="display:none;
visibility: hidden;" action="#{bean.doFoo}" >
<!-- parameters, more action listeners, etc. -->
</t:commandButton>
<s:script>
function clickLink(linkId)
{
var fireOnThis = document.getElementById(linkId)
if (document.createEvent)
{
var evObj = document.createEvent('MouseEvents')
evObj.initEvent( 'click', true, false )
fireOnThis.dispatchEvent(evObj)
}
else if (document.createEventObject)
{
fireOnThis.fireEvent('onclick')
}
}
</s:script>
But anyways, thanks a lot for your help!
Werner Punz wrote:
>
> Ok this is a clear bug in the javascript of the dialog as it seems...
> (probably not even a solvable one, you have to do dom shifting to
> resolve things like that on the ie )
>
> try following if possible....
> push a form tag into your dialog code...
> this definitely should work, because the form is shifted in the dialog
> as well...
> otherwise use command links, they trigger the form submits via
> javascript, hence they are independend of the dom position of the link
> itself!
>
>
--
View this message in context:
http://www.nabble.com/s%3AmodalDialog-and-commandButton-action-tf2387124.html#a6658488
Sent from the MyFaces - Users mailing list archive at Nabble.com.