From: Ronald v. K. <Rva...@de...> - 2012-01-30 13:38:59
|
This is in my repeat: <xforms:repeat nodeset="LineInfo" id="repeatId"> ... <xforms:trigger style="width: 80px"> <xforms:label>A Label</xforms:label> <bfc:show dialog="dialogId" events:event="DOMActivate"/> </xforms:trigger> ... </xforms:repeat> This is my dialog outside the repeat: <bfc:dialog id="dialogId "> <xforms:label lang="nl">Free text</xforms:label> <xforms:group appearance="full" ref="LineInfo[index('repeatId')]"> <xforms:textarea ref="FreeText" appearance="bfTextArea"> <xforms:label>Label for textarea</xforms:label> </xforms:textarea> <xforms:group appearance="minimal"> <xforms:trigger> <xforms:label>OK</xforms:label> <bfc:hide dialog="dialogId" events:event="DOMActivate"/> </xforms:trigger> <xforms:trigger> <xforms:label>Cancel</xforms:label> <bfc:hide dialog="dialogId" events:event="DOMActivate"/> </xforms:trigger> </xforms:group> </xforms:group> </bfc:dialog> Keep in mind that there is NO DIFFERENCE here between an OK and Cancel. You currently need to implement things for that to do a 'roll back' on cancel of the dialog. I hope the specs will force implementers of dialogs to do this automagically. So what you need to do is copy the elements to a temp instance on opening the dialog and only on 'ok' copy the changed elements to the normal row. Cheers, Ronald > -----Original Message----- > From: Daniel Ebner [mailto:dan...@un...] > Sent: vrijdag 27 januari 2012 16:19 > To: Daniel Ebner > Cc: Ronald van Kuijk > Subject: RE: [Betterform-users] Combing Dialogs and Repeats > > Hi, > > thnaks for the answer. I tried it with one dialog outside the repeat. > But I could not figure out how to get the it bound data of the selected item to the > selected index of the repeat. Any advice how to do this in the example below? > > Cheers Daniel > > >> From what I remember this is still a limitation in the dialog > >> (implemented by me) I did not know how to fix this, so I personally > >> put it outside the repeat and have it bind to the selected index of > >> the repeat... > >> > >> Ronald > >> > >>> -----Original Message----- > >>> From: Daniel Ebner [mailto:dan...@un...] > >>> Sent: vrijdag 20 januari 2012 15:17 > >>> To: bet...@li... > >>> Subject: [Betterform-users] Combing Dialogs and Repeats > >>> > >>> Hi everyone > >>> > >>> I have a nodeset of items elements. > >>> > >>> <xf:model id="my-editor-model"> > >>> <xf:instance id="my-editor-instance"> > >>> <data xmlns=""> > >>> <item id="1" name="one">eins</item> > >>> <item id="2" name="two">zwei</item> > >>> </data> > >>> </xf:instance> > >>> </xf:model> > >>> > >>> The data of this items is displayed using a xf:repeat > >>> > >>> <xf:repeat nodeset="item"> > >>> <xf:group> > >>> <xf:label>Item Dialog</xf:label> > >>> <xf:input ref="./@name" /> > >>> <xf:input ref="./@id" /> > >>> <xf:input ref="." /> > >>> </xf:group> > >>> </xf:repeat> > >>> > >>> But what I want to do is do display this data not directly on the > >>> page but in a bfc:dialog. On the page there should be a button for > >>> each item to open the corresponding data dialog.I tied it this way: > >>> > >>> <xf:repeat nodeset="item"> > >>> <xf:group> > >>> <xf:trigger> > >>> <xf:label ref="./@name"></xf:label> > >>> <bfc:show dialog="itemDialog" > >>> ev:event="DOMActivate"></bfc:show> > >>> </xf:trigger> > >>> <bfc:dialog id="itemDialog"> > >>> <xf:label>Item Dialog</xf:label> > >>> <xf:input ref="./@name" /> > >>> <xf:input ref="./@id" /> > >>> <xf:input ref="." /> > >>> </bfc:dialog> > >>> </xf:group> > >>> </xf:repeat> > >>> > >>> This works as long as no other item elements are inserted into the > >>> nodeset. When inserting a new item using xf:insert The data of the > >>> new Item is displayed on the page under the corresponding button, > >>> not in a dialog. > >>> > >>> Do I do something wrong? Is there another way to solve this? > >>> > >>> Cheers Daniel > >>> > >>> The complete Code: > >>> > >>> <div> > >>> <div> > >>> <xf:model id="my-editor-model"> > >>> <xf:instance id="my-editor-instance"> > >>> <data xmlns=""> > >>> <item id="1" name="one">eins</item> > >>> <item id="2" name="two">zwei</item> > >>> </data> > >>> </xf:instance> > >>> </xf:model> > >>> </div> > >>> <div> > >>> <xf:group model="my-editor-model"> > >>> > >>> <xf:repeat nodeset="item"> > >>> <xf:group> > >>> <xf:trigger> > >>> <xf:label ref="./@name"></xf:label> > >>> <bfc:show dialog="itemDialog" > >>> ev:event="DOMActivate"></bfc:show> > >>> </xf:trigger> > >>> <bfc:dialog id="itemDialog"> > >>> <xf:label>Item Dialog</xf:label> > >>> <xf:input ref="./@name" /> > >>> <xf:input ref="./@id" /> > >>> <xf:input ref="." /> > >>> </bfc:dialog> > >>> </xf:group> > >>> </xf:repeat> > >>> > >>> <xf:trigger> > >>> <xf:label>+</xf:label> > >>> <xf:action> > >>> <xf:insert nodeset="item"></xf:insert> > >>> </xf:action> > >>> </xf:trigger> > >>> </xf:group> > >>> </div> > >>> </div> > >>> > >>> > >>> > >>> > >>> > >>> > >>> -------------------------------------------------------------------- > >>> ---------- Keep Your Developer Skills Current with LearnDevNow! > >>> The most comprehensive online learning library for Microsoft > >>> developers is just $99.99! Visual Studio, SharePoint, SQL - plus > >>> HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when > >>> you subscribe now! > >>> http://p.sf.net/sfu/learndevnow-d2d > >>> _______________________________________________ > >>> Betterform-users mailing list > >>> Bet...@li... > >>> https://lists.sourceforge.net/lists/listinfo/betterform-users > >> > > > > > > > > -- > > > > Daniel Ebner Dipl.-Medienwissenschaftler, Wiss. Mitarbeiter > > Historisch-Kulturwissenschaftliche Informationsverarbeitung > > > > University at Cologne > > Albertus-Magnus-Platz > > D 50923 Cologne > > dan...@un... > > Tel.: +49 - 221 - 470 7736 > > Fax: +49 - 221 - 470 7737 > > www.hki.uni-koeln.de > > > > > > > > -- > > Daniel Ebner Dipl.-Medienwissenschaftler, Wiss. Mitarbeiter Historisch- > Kulturwissenschaftliche Informationsverarbeitung > > University at Cologne > Albertus-Magnus-Platz > D 50923 Cologne > dan...@un... > Tel.: +49 - 221 - 470 7736 > Fax: +49 - 221 - 470 7737 > www.hki.uni-koeln.de > |