add button to summary view

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

add button to summary view

koenvdk
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

Connect: Twitter









Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.





--
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
Reply | Threaded
Open this post in threaded view
|

Re: add button to summary view

Erik Bruchez
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,


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

Connect: Twitter









Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.






--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: add button to summary view

koenvdk
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: Twitter



From:        Erik Bruchez <[hidden email]>
To:        [hidden email]
Date:        12/06/2012 06:34
Subject:        [ops-users] Re: add button to summary view
Sent by:        [hidden email]





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

Connect:







Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe:
[hidden email]
For general help:
[hidden email]
OW2 mailing lists service home page:
http://www.ow2.org/wws








Overeenkomstig de bepalingen inzake de vertegenwoordiging van de vzw in haar statuten, kan enkel de gedelegeerde bestuurder, de algemeen directeur of zijn uitdrukkelijke lasthebber verbintenissen aangaan namens Smals.
Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en het bericht te vernietigen.

Conformément aux dispositions relatives à la représentation de l'asbl dans ses statuts, seul l'administrateur délégué, le directeur général ou son mandataire exprès est habilité à souscrire des engagements au nom de Smals.
Si ce message ne vous est pas destiné, nous vous prions de nous le signaler immédiatement et de détruire le message.

According to the provisions regarding representation of the non profit association in its bylaws, only the chief executive officer, the general manager or his explicit agent can enter into engagements on behalf of Smals.
If you are not the addressee of this message, we kindly ask you to signal this to us immediately and to delete the message.





--
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