Hi! Is there a way to implement a confirmation dialog? I need it to appear when a trigger is activated, so the action ('xforms:delete' in my case) would be performed or not depending on the user response. Thanks! BR, Tijana -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
You'd create your own modal dialog to do this. I facilitate it by
copying the node path into a different instance and then referring to that node path within the modal dialog. I'm sure there are other ways of doing this, its just the way I did it as everything in my forms are dynamic, so I'm reusing the same dialog for multiple fields. Dialog: <xxforms:dialog id="delete-confirm-dialog" level="modal" close="false" draggable="true"> <xforms:label>Confirm</xforms:label> <xforms:group ref="if (normalize-space(instance('variables-instance')/DeleteNode)!='') then saxon:evaluate(concat('instance(''odm-instance'')/root()', instance('variables-instance')/DeleteNode)) else /NonExistentNode" class="noborder"> <xhtml:div> <xhtml:div class="dialog-message">Are you sure you wish to delete [this...]?</xhtml:div> </xhtml:div> <xhtml:div class="dialog-button"> <xforms:trigger> <xforms:label> <xhtml:img src="/images/action_check.png" alt="Checkbox" border="0" height="14" width="14"/> <xhtml:span>Delete</xhtml:span> </xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:delete nodeset="." /> </xforms:action> </xforms:trigger> <xforms:trigger> <xforms:label> <xhtml:img src="/images/action_delete.png" alt="Cancel" border="0" height="14" width="14"/> <xhtml:span>Cancel</xhtml:span> </xforms:label> <xxforms:hide ev:event="DOMActivate" dialog="delete-confirm-dialog"/> </xforms:trigger> </xhtml:div> </xforms:group> </xxforms:dialog> Trigger: <xforms:trigger appearance="minimal"> <xforms:label> <xhtml:img src="{$baseUrl}/images/action_delete.png" border="0" height="14" width="14"/> </xforms:label> <xforms:hint>Delete</xforms:hint> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="instance('variables-instance')/DeleteNode" value="context()/saxon:path()" /> <xxforms:show dialog="delete-confirm-dialog" /> </xforms:action> </xforms:trigger> ------------------------------------------------------------------------ Jeremy Nix Senior Application Developer Cincinnati Children's Hospital Medical Center On 08/19/2010 09:33 AM, Tijana Momirov wrote: > > > Hi! > > Is there a way to implement a confirmation dialog? I need it to appear > when a trigger is activated, so the action ('xforms:delete' in my > case) would be performed or not depending on the user response. > > > Thanks! > > BR, > Tijana > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
There is also an XBL component to do something like this:
http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components/alert-dialog -Erik On Thu, Aug 19, 2010 at 6:54 AM, Jeremy Nix <[hidden email]> wrote: > You'd create your own modal dialog to do this. I facilitate it by copying > the node path into a different instance and then referring to that node path > within the modal dialog. I'm sure there are other ways of doing this, its > just the way I did it as everything in my forms are dynamic, so I'm reusing > the same dialog for multiple fields. > > Dialog: > <xxforms:dialog id="delete-confirm-dialog" level="modal" close="false" > draggable="true"> > <xforms:label>Confirm</xforms:label> > <xforms:group ref="if > (normalize-space(instance('variables-instance')/DeleteNode)!='') then > saxon:evaluate(concat('instance(''odm-instance'')/root()', > instance('variables-instance')/DeleteNode)) else /NonExistentNode" > class="noborder"> > <xhtml:div> > <xhtml:div class="dialog-message">Are you sure you wish to delete > [this...]?</xhtml:div> > </xhtml:div> > <xhtml:div class="dialog-button"> > <xforms:trigger> > <xforms:label> > <xhtml:img src="/images/action_check.png" alt="Checkbox" border="0" > height="14" width="14"/> > <xhtml:span>Delete</xhtml:span> > </xforms:label> > <xforms:action ev:event="DOMActivate"> > <xforms:delete nodeset="." /> > </xforms:action> > </xforms:trigger> > <xforms:trigger> > <xforms:label> > <xhtml:img src="/images/action_delete.png" alt="Cancel" border="0" > height="14" width="14"/> > <xhtml:span>Cancel</xhtml:span> > </xforms:label> > <xxforms:hide ev:event="DOMActivate" dialog="delete-confirm-dialog"/> > </xforms:trigger> > </xhtml:div> > </xforms:group> > </xxforms:dialog> > > Trigger: > <xforms:trigger appearance="minimal"> > <xforms:label> > <xhtml:img src="{$baseUrl}/images/action_delete.png" border="0" height="14" > width="14"/> > </xforms:label> > <xforms:hint>Delete</xforms:hint> > <xforms:action ev:event="DOMActivate"> > <xforms:setvalue ref="instance('variables-instance')/DeleteNode" > value="context()/saxon:path()" /> > <xxforms:show dialog="delete-confirm-dialog" /> > </xforms:action> > </xforms:trigger> > > ------------------------------------------------------------------------ > Jeremy Nix > Senior Application Developer > Cincinnati Children's Hospital Medical Center > > On 08/19/2010 09:33 AM, Tijana Momirov wrote: >> >> >> Hi! >> >> Is there a way to implement a confirmation dialog? I need it to appear >> when a trigger is activated, so the action ('xforms:delete' in my case) >> would be performed or not depending on the user response. >> >> >> Thanks! >> >> BR, >> Tijana >> > > > -- > You receive this message as a subscriber of the [hidden email] mailing > list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |