Re: [Xsltforms-support] Using an xsf:dialog inside of an xf:repeat
Brought to you by:
alain-couthures
From: David A. <am...@gm...> - 2009-12-30 18:30:43
|
Alain, That sounds great. Please keep me posted on how things go. A full test case is attached to this email. I am also pasting it below. <?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet href="../trunk/build/xsltforms.xsl" type="text/xsl"?> <?xsltforms-options debug="yes"?> <html menu="samples" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsf="http://www.agencexml.com/xsltforms" xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Dialog</title> <xf:model> <xf:instance> <root> <my-item> <value>0</value> </my-item> <my-item> <value>0</value> </my-item> <my-item> <value>0</value> </my-item> </root> </xf:instance> </xf:model> </head> <body> <xf:repeat nodeset="my-item"> <xsf:dialog id="dialog"> <xf:trigger> <xf:label>Close</xf:label> <xsf:hide ev:event="DOMActivate" dialog="dialog"/> </xf:trigger> <br/> <xf:select1 ref="value"> <xf:item> <xf:label>A</xf:label> <xf:value>0</xf:value> </xf:item> <xf:item> <xf:label>B</xf:label> <xf:value>1</xf:value> </xf:item> </xf:select1> </xsf:dialog> <xf:input ref="value"> <xf:label>Value=</xf:label> </xf:input> <xf:output ref="value"> <xf:label>Value=</xf:label> </xf:output> <xf:trigger> <xf:label>Modify</xf:label> <xsf:show ev:event="DOMActivate" dialog="dialog"/> </xf:trigger> </xf:repeat> </body> </html> Thanks, David On Wed, Dec 30, 2009 at 12:54 AM, COUTHURES Alain <ala...@ag...> wrote: > David, >> >> I would like to create multiple dialogs with an xf:repeat and have >> them open/close with multiple triggers. >> >> Because I am using the attribute 'id="dialog"' for the xsf:dialog >> element and that xf:dialog element is inside an xf:repeat, the divs >> generated by the xsf:dialog will all have the same "id" attribute >> value, so only the first generated div gets an "id" attribute of >> "dialog" and the rest all get marked as clones. >> >> Because only the first generated div gets an "id" attribute of >> "dialog", all the triggers open the same overlay dialog (which is the >> first generated div). >> > > In AJAXForms, ajx:dialog couldn't be cloned. To enable this with xsf:dialog, > a new Javascript class has to be created. Probably, required components are > already present, IdManager for example, but I have to perform some tests to > find the best way. > > Can you please send me a full test case? > > Thanks! > > -Alain > |