Madhav Bhargava schrieb: > There is a problem with Sandbox modal dialog. > > Consider the following scenario: > > The user clicks on a link on a page. The control needs to go to an action > method. The action methods gets data from the database and then the fetched > data needs to be displayed in the modal dialog. > > I am trying to use Sandbox modal dialog component to do the same. I have > followed the example at: > http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/dojo/dojoDialog.jsp > > > Instead of calling onclick="dojoDialog.show();" to display the dialog I set > the rendered property to true in action method. > > I have a link which when clicked calls an action method - > <t:commandLink value="testing modal dialog" > action="#{login.showModalDialog}"/> > > This action method sets the data for the modal dialog. > > Modal dialog: > ----------------------------------------------------- > <s:modalDialog dialogId="test" dialogVar="dojoDialog" hiderIds="close" > styleClass="dojoDialog" > dialogAttr="bgColor='white' bgOpacity='0.5' toggle='fade' > toggleDuration='250'" rendered="#{login.displayModalDialog}"> > ... > ... > </s:modalDialog> > > It does not work this way!! The dialog is never shown even if the rendered > property is set to true. > > Is there any way I can call an action method before I show the modal dialog? > > Thanks > ~madhav > > I know this issue, it is javascript related, or mostly scroller related. You use the dialog within a form, right?
Not really an issue with the dialog itself it is more an issue with the way that you cannot push the dialog into a form without running into javascript related and browser bugs. Try to use the dialog outside of a form element! You can embend forms in the dialog, but you cannot embed the dialog into a form. If you need to keep the values from the other forms if the dialog is submitted either use savestate or the scope control, or use pure client side javascripts to push the values into your main form. Sorry for this limitation it is not yet documented, if there was a way to have the dialog in a form without running into major problems which are mostly ie6 related it would have been done (I know why the dojo people do dom shifting internally) I have run into all of those issues by implementing my own dialog system once :-(

