Hi,
I would like to add a button to the form runner summary view (near the "new" and "pdf" etc buttons). I've been looking in the summary.xhtml but it's quite hard to understand where to begin. It looks like I need to define a button somehow and then make sure it shows up by adding it the the correct property. The config stuff I understand but defining the button looks hard. I need a button that takes the user to a simple external link (well, a different context on the same server, but I guess that doesn't matter), using GET. However, I need the app- and formnames in the webaddress: something like: I the button is clicked, go to http://localhost:8080/otherapp/my-service/appname/formname I have the feeling this should be relatively simple, but the summary page makes it look difficult. Could someone give an example of how to do this? Advanced question: in the future I may need this button to do a POST, and add some xml to the body with a list of the currenlty shown/searched submissions. Thanks, Koen Vanderkimpen -- 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
|
Koen,
It's reasonably simple with current builds. You can add such a button with, for example: <xforms:group ref="instance('fr-summary-triggers-instance')/view">
<fr:href-button ref="." href="/fr/{$app}/{$form}/foo/{normalize-space(instance('fr-selection-instance'))}{if (property('xxforms:noscript')) then '?fr-noscript=true' else ''}">
<xforms:label> <xhtml:img width="16" height="16" src="/forms/orbeon/builder/images/play.png" alt="" title="Test Form"/>
<xhtml:span>Foo</xhtml:span> </xforms:label> </fr:href-button> </xforms:group> Doing a POST is a bit more complex: you have to create an xforms:submission element for that. It'd be nice to have a better button extension API for Form Runner.
-Erik
On Fri, Jun 8, 2012 at 7:44 AM, <[hidden email]> wrote: Hi, -- 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,
It did not immediately work: using your code, it showed the picture and label, but it was not a button, and I could not click it (but the source showed my link in there somewhere). Perhaps the href-button does not work? (using 3.9.1 PE) I played around a bit, and eventually, the following worked: <xhtml:span class="fr-button"> <xforms:group ref="instance('fr-summary-triggers-instance')/view"> <fr:button> <xforms:label> <xhtml:img width="16" height="16" src="/forms/orbeon/builder/images/play.png" alt="play it"/> <xhtml:span>Play</xhtml:span> </xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:load resource="/../link-to-my-service/{$parameters/app}/{$parameters/form}" xxforms:show-progress="true" f:url-type="resource"/> </xforms:action> </fr:button> </xforms:group> </xhtml:span> I also had to remove ref="." from the fr:button tag, or the button would only work if an item was selected. (also, make sure to move it outside of the repeat :-) ) Sincerely, Koen Vanderkimpen Connect:
Koen, It's reasonably simple with current builds. You can add such a button with, for example: <xforms:group ref="instance('fr-summary-triggers-instance')/view"> <fr:href-button ref="." href="/fr/{$app}/{$form}/foo/{normalize-space(instance('fr-selection-instance'))}{if (property('xxforms:noscript')) then '?fr-noscript=true' else ''}"> <xforms:label> <xhtml:img width="16" height="16" src="/forms/orbeon/builder/images/play.png" alt="" title="Test Form"/> <xhtml:span>Foo</xhtml:span> </xforms:label> </fr:href-button> </xforms:group> Doing a POST is a bit more complex: you have to create an xforms:submission element for that. It'd be nice to have a better button extension API for Form Runner. -Erik On Fri, Jun 8, 2012 at 7:44 AM, <Koen.Vanderkimpen@...> wrote: Hi, I would like to add a button to the form runner summary view (near the "new" and "pdf" etc buttons). I've been looking in the summary.xhtml but it's quite hard to understand where to begin. It looks like I need to define a button somehow and then make sure it shows up by adding it the the correct property. The config stuff I understand but defining the button looks hard. I need a button that takes the user to a simple external link (well, a different context on the same server, but I guess that doesn't matter), using GET. However, I need the app- and formnames in the webaddress: something like: I the button is clicked, go to http://localhost:8080/otherapp/my-service/appname/formname I have the feeling this should be relatively simple, but the summary page makes it look difficult. Could someone give an example of how to do this? Advanced question: in the future I may need this button to do a POST, and add some xml to the body with a list of the currenlty shown/searched submissions. Thanks, Koen Vanderkimpen
-- 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 |