Thread: [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 02:11:35
|
I've been playing with the new xsf:dialog feature. 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). Here is an example: <xf:repeat nodeset="my-item" appearance="full"> <xf:trigger appearance="minimal"> <xf:label>Modify</xf:label> <xsf:show ev:event="DOMActivate" dialog="dialog"/> </xf:trigger> <xsf:dialog id="dialog"> <xf:trigger> <xf:label>Close</xf:label> <xsf:hide ev:event="DOMActivate" dialog="dialog"/> </xf:trigger> <span>This field value appears in the overlay: <xf:output ref="my-field"/></span> </xsf:dialog> </xf:repeat> Thank you, David |
From: COUTHURES A. <ala...@ag...> - 2009-12-30 08:54:03
|
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 |
From: David A. <am...@gm...> - 2009-12-30 18:30:43
Attachments:
dialog-repeat.xhtml
|
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 > |
From: COUTHURES A. <ala...@ag...> - 2010-01-02 18:09:17
|
David, I have finally found a trick for xsf:dialog support inside of an xf:repeat so the test case you sent is now working for me with the latest SVN version. BTW, I have also added nested xsf:dialog support, with a workaround for IE6 bug about select and z-index. xsf:dialog is now richer than AJAXForms ajx:dialog (there is also, in AJAXForms, ajx:confirm which allows Javascript confirm() use for aborting an action processing but it's not supported in XSLTForms). When comparing xsf:dialog and xf:message, it appears to me that xf:message can just contain constant text strings and text output controls whereas controls of any kind can be in xsf:dialog. So xsf:dialog is a sort of extension of xf:message but with a different syntax. I now think it would be interesting to allow any kind of controls in xf:message without defining any new element with its own syntax. The first step for XSLTForms should be to render xf:message as a specific xsf:dialog (not anymore with Javascript alert()...). Suggestions and points of view are welcome in this mailing list. Happy New Year! -Alain |
From: Klotz, L. <Lei...@xe...> - 2010-01-04 22:59:42
|
Alain, If you allow XForms controls in UI inline content in your XForms integration (which XSLTForms does), then XForms controls are allowed in xf:message. However, as John Boyer has pointed out, there are issues with bubbling of DOMActivate targeted at controls inside the xf:message. XForms 1.2 is scheduled to have xf:dialog defined. The repeat ID issues you are dealing with are also handled similarly, I believe, but you might want to check. We briefly considered using a component language to allow separate definition and instantiation of XForms dialogs, but decided against it. Leigh. -----Original Message----- From: COUTHURES Alain [mailto:ala...@ag...] Sent: Saturday, January 02, 2010 10:09 AM To: David Amusin Cc: David Amusin; xsl...@li...; Micah Dubinko Subject: Re: [Xsltforms-support] Using an xsf:dialog inside of an xf:repeat David, I have finally found a trick for xsf:dialog support inside of an xf:repeat so the test case you sent is now working for me with the latest SVN version. BTW, I have also added nested xsf:dialog support, with a workaround for IE6 bug about select and z-index. xsf:dialog is now richer than AJAXForms ajx:dialog (there is also, in AJAXForms, ajx:confirm which allows Javascript confirm() use for aborting an action processing but it's not supported in XSLTForms). When comparing xsf:dialog and xf:message, it appears to me that xf:message can just contain constant text strings and text output controls whereas controls of any kind can be in xsf:dialog. So xsf:dialog is a sort of extension of xf:message but with a different syntax. I now think it would be interesting to allow any kind of controls in xf:message without defining any new element with its own syntax. The first step for XSLTForms should be to render xf:message as a specific xsf:dialog (not anymore with Javascript alert()...). Suggestions and points of view are welcome in this mailing list. Happy New Year! -Alain ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Xsltforms-support mailing list Xsl...@li... https://lists.sourceforge.net/lists/listinfo/xsltforms-support |