I've built a "multi-page" form with Form Builder that works by hiding all the sections except for the ones that are supposed to be displayed on the "current page". The "final page" has all of the sections visible. This works very well as it presents the 24 pages in the form to the user in a much more manageable format rather than throwing the whole form at them at once. However, it means that I need to control the availability of the workfow-send-button, and have it only available on the "final page" which has all of the sections visible. I had no luck controlling it by adding attributes to the <fr:workflow-send-button/> and so I tried making my own button which duplicates the behaviour of the workflow-send-button. However, my custom button does not send the workflow to Alfresco - it only saves the form data. If I replace my custom button with the workflow-send-button, it both saves the form data and sends the XML to Alfresco as it is supposed to, confirming that everything else is set up properly.
Obviously something is wrong with my button. How do I correctly duplicate the behaviour of the workflow-send-button? Here is the code for my button: <fr:buttons> . . . <fr:button xxforms:modal="true" ref=".[instance('fr-form-instance')/internal/nav-curr = instance('fr-form-instance')/internal/nav-nparts]"> <xforms:label> <xhtml:img width="32" height="16" src="http://sharesite:8080/web-assets/iconsdrdc/go_group_32x16.png" alt=""/> <xhtml:span> <xforms:output value="$fr-resources/detail/labels/workflow-send"/> </xhtml:span> </xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="instance('fr-persistence-instance')/submit-or-save-or-send">send</xforms:setvalue> <xforms:dispatch name="fr-save-action" target="fr-persistence-model"> <xxforms:context name="fr:check-data-valid" select="true()"/> </xforms:dispatch> </xforms:action> </fr:button> </fr:buttons> |
Administrator
|
Have you tried something like:
<xforms:trigger xxforms:modal="true" id="fr-workflow-send-button" model="fr-persistence-model" ref="instance('fr-triggers-instance')/workflow-send[xxforms:instance('fr-form-instance')/internal/nav-curr = instance('fr-form-instance')/internal/nav-nparts]"> <xforms:label> <xhtml:img width="16" height="16" src="/apps/fr/style/images/pixelmixer/right_16.png" alt=""/> <xhtml:span><xforms:output value="$fr-resources/detail/labels/workflow-send"/></xhtml:span> </xforms:label> </xforms:trigger> The key here is the use of the xxforms:instance() function to reach `fr-form-instance`. -Erik On Mon, Dec 12, 2011 at 5:02 PM, lylesidor <[hidden email]> wrote: > I've built a "multi-page" form with Form Builder that works by hiding all the > sections except for the ones that are supposed to be displayed on the > "current page". The "final page" has all of the sections visible. This works > very well as it presents the 24 pages in the form to the user in a much more > manageable format rather than throwing the whole form at them at once. > However, it means that I need to control the availability of the > workfow-send-button, and have it only available on the "final page" which > has all of the sections visible. I had no luck controlling it by adding > attributes to the <fr:workflow-send-button/> and so I tried making my own > button which duplicates the behaviour of the workflow-send-button. However, > my custom button does not send the workflow to Alfresco - it only saves the > form data. If I replace my custom button with the workflow-send-button, it > both saves the form data and sends the XML to Alfresco as it is supposed to, > confirming that everything else is set up properly. > > Obviously something is wrong with my button. > How do I correctly duplicate the behaviour of the workflow-send-button? > > Here is the code for my button: > > <fr:buttons> > . > . > . > <fr:button xxforms:modal="true" > ref=".[instance('fr-form-instance')/internal/nav-curr = > instance('fr-form-instance')/internal/nav-nparts]"> > <xforms:label> > <xhtml:img width="32" height="16" > src="http://sharesite:8080/web-assets/iconsdrdc/go_group_32x16.png" > alt=""/> > <xhtml:span> > <xforms:output value="$fr-resources/detail/labels/workflow-send"/> > </xhtml:span> > </xforms:label> > <xforms:action ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('fr-persistence-instance')/submit-or-save-or-send">send</xforms:setvalue> > <xforms:dispatch name="fr-save-action" target="fr-persistence-model"> > <xxforms:context name="fr:check-data-valid" select="true()"/> > </xforms:dispatch> > </xforms:action> > </fr:button> > </fr:buttons> > > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/How-to-duplicate-workflow-send-button-behaviour-tp4188316p4188316.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > 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 |
Thanks Erik.
xxforms:instance was indeed the key. However in the code for my button it was the failure to reach the fr-persistence-instance, so I changed the following line and it now works like it should. <xforms:setvalue ref="xxforms:instance('fr-persistence-instance')/submit-or-save-or-send">send</xforms:setvalue> BTW, I did try your code exactly as in your reply, but the button didn't even show up. I guessing that it was meant to be put in the persistence-model.xml file, whereas my button code is in the form definition that Form Builder creates. Lyle |
Administrator
|
Lyle,
It should also work if placed in the form, under the fr:buttons element. -Erik On Tue, Dec 13, 2011 at 8:06 AM, lylesidor <[hidden email]> wrote: > Thanks Erik. > > xxforms:instance was indeed the key. > > However in the code for my button it was the failure to reach the > fr-persistence-instance, so I changed the following line and it now works > like it should. > > <xforms:setvalue > ref="xxforms:instance('fr-persistence-instance')/submit-or-save-or-send">send</xforms:setvalue> > > BTW, I did try your code exactly as in your reply, but the button didn't > even show up. I guessing that it was meant to be put in the > persistence-model.xml file, whereas my button code is in the form definition > that Form Builder creates. > > Lyle > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/How-to-duplicate-workflow-send-button-behaviour-tp4188316p4190931.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > 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 |