On 6/13/06, Adam Brod <[EMAIL PROTECTED]> wrote:
Hi- I'm having trouble understanding how to use subdialogs. How do I specify the end state for a subdialog that also ends the calling dialog?
You'll need to take the outcome value returned by the exit state from the subdialog, and create a transition for that to the exit state for the calling dialog. The
documentation mentions some of the possiblities, but doesn't really show how to configure it. Is there a good example somewhere? I looked in the samples I downloaded, but the subdialog isn't included. If I understand it correctly. In the example below (from shale-starter and sql-browser), the subdialog "Edit Profile" is mentioned, but it isn't in dialog-config.xml.
You're right ... if the commented out sample is going to reference a subdialog, then the subdialog should be there too. The actual implementation of the dialog and subdialog from which this was taken is in the Use Cases example, where the subdialog is defined like this: <dialog name="Edit Profile" start="Setup"> <!-- Global transitioh definitions --> <transition outcome="cancel" target="Cancel"/> <transition outcome="finish" target="Finish"/> <action name="Setup" method="#{profile$edit.setup}"> <transition outcome="success" target="Page 1"/> </action> <view name="Page 1" viewId="/profile/profile1.jsp"> <transition outcome="next" target="Page 2"/> </view> <view name="Page 2" viewId="/profile/profile2.jsp"> <transition outcome="next" target="Page 3"/> <transition outcome="previous" target="Page 1"/> </view> <view name="Page 3" viewId="/profile/profile3.jsp"> <transition outcome="next" target="Exit"/> <transition outcome="previous" target="Page 2"/> </view> <action name="Cancel" method="#{profile$edit.cancel}"> <transition outcome="success" target="Exit"/> </action> <action name="Finish" method="#{profile$edit.finish}"> <transition outcome="password" target="Page 1"/> <transition outcome="success" target="Exit"/> <transition outcome="username" target="Page 1"/> </action> <end name="Exit" viewId="/usecases.jsp"/> </dialog> This does a simple three-page wizard with next, previous, finish, and cancel buttons on each page. Thanks for your help.
Adam
Craig