Datatable help

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

Datatable help

Tony Mobbs
There are some nice features in the datatable example provided, however I can't see how to find them in the documentation.

Is it possible to be provided with the xhtml file behind the demo?  Sorry if it already available, but I could not find it.


What I am looking for is:
  1. Hovering the mouse over a line highlights the row.
  2. Clicking on a row as a link to another page.
My current approach is to use a trigger within the table so that I can move to a sub-form to edit the data on a separate page.

The instance looks like this.

<users>
  <user>
    <email></email>
    ...
    ...
  </user>
</user>

If I set the value to 'email' (text) then it works well.

                    <xforms:trigger  appearance="minimal">
                      <xforms:label><img src="images/edit.gif" /></xforms:label>
                      <xforms:action ev:event="DOMActivate">
                        <xforms:setvalue ref="instance('Administration')//fooUserToEdit" value="'email'" />
                        <xforms:setvalue ref="instance('Administration')//CurrentSection" value="'Edit Users Details'" />
                      </xforms:action>
                    </xforms:trigger>

If I try to pass the instance value, then the ref element does not get set.  The value of "email" is correctly displayed in the output.  How can I correctly pass a value using the xforms:setvalue from within a datatable?

                    <xforms:trigger  appearance="minimal">
                      <xforms:label><img src="images/edit.gif" /></xforms:label>
                      <xforms:action ev:event="DOMActivate">
                        <xforms:setvalue ref="instance('Administration')//fooUserToEdit" value="email" />
                        <xforms:setvalue ref="instance('Administration')//CurrentSection" value="'Edit Users Details'" />
                      </xforms:action>
                    </xforms:trigger>

Trying an alternative solution, I tried using position(), then the ref element gets set to "1" irrespective of which row is highlighted. 

                    <xforms:trigger  appearance="minimal">
                      <xforms:label><img src="images/edit.gif" /></xforms:label>
                      <xforms:action ev:event="DOMActivate">
                        <xforms:setvalue ref="instance('Administration')//fooUserToEdit" value="position()" />
                        <xforms:setvalue ref="instance('Administration')//CurrentSection" value="'Edit Users Details'" />
                      </xforms:action>
                    </xforms:trigger>

I'm using 3.9.0.pre.201106030324

Cheers
Tony





--
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: Datatable help

Erik Bruchez
Administrator
Tony,

What you are referring to is the Form Runner summary page. Here is the
relevant code:

https://github.com/orbeon/orbeon-forms/blob/master/src/resources/apps/fr/summary/view.xhtml#L527

-Erik

On Wed, Jun 15, 2011 at 6:01 AM, Tony Mobbs <[hidden email]> wrote:

> There are some nice features in the datatable example provided, however I
> can't see how to find them in the documentation.
> Is it possible to be provided with the xhtml file behind the demo?  Sorry if
> it already available, but I could not find it.
>
> http://www.orbeon.com/orbeon/fr/orbeon/contact/summary
> What I am looking for is:
>
> Hovering the mouse over a line highlights the row.
> Clicking on a row as a link to another page.
>
> My current approach is to use a trigger within the table so that I can move
> to a sub-form to edit the data on a separate page.
> The instance looks like this.
> <users>
>   <user>
>     <email></email>
>     ...
>     ...
>   </user>
> </user>
> If I set the value to 'email' (text) then it works well.
>                     <xforms:trigger  appearance="minimal">
>                       <xforms:label><img src="images/edit.gif"
> /></xforms:label>
>                       <xforms:action ev:event="DOMActivate">
>                         <xforms:setvalue
> ref="instance('Administration')//fooUserToEdit" value="'email'" />
>                         <xforms:setvalue
> ref="instance('Administration')//CurrentSection" value="'Edit Users
> Details'" />
>                       </xforms:action>
>                     </xforms:trigger>
> If I try to pass the instance value, then the ref element does not get set.
>  The value of "email" is correctly displayed in the output.  How can I
> correctly pass a value using the xforms:setvalue from within a datatable?
>                     <xforms:trigger  appearance="minimal">
>                       <xforms:label><img src="images/edit.gif"
> /></xforms:label>
>                       <xforms:action ev:event="DOMActivate">
>                         <xforms:setvalue
> ref="instance('Administration')//fooUserToEdit" value="email" />
>                         <xforms:setvalue
> ref="instance('Administration')//CurrentSection" value="'Edit Users
> Details'" />
>                       </xforms:action>
>                     </xforms:trigger>
> Trying an alternative solution, I tried using position(), then the ref
> element gets set to "1" irrespective of which row is highlighted.
>                     <xforms:trigger  appearance="minimal">
>                       <xforms:label><img src="images/edit.gif"
> /></xforms:label>
>                       <xforms:action ev:event="DOMActivate">
>                         <xforms:setvalue
> ref="instance('Administration')//fooUserToEdit" value="position()" />
>                         <xforms:setvalue
> ref="instance('Administration')//CurrentSection" value="'Edit Users
> Details'" />
>                       </xforms:action>
>                     </xforms:trigger>
> I'm using 3.9.0.pre.201106030324
> Cheers
> Tony
>
>
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Datatable help

Tony Mobbs
Thanks Erik

The example cleared up the issue and the key was to put position() into a variable "position" before it can be further used within a trigger.
 
<xxforms:variable name="position" select="position()" as="xs:integer"/>

The hyperlink method was also very neat.

Cheers
Tony


On 16 June 2011 14:20, Erik Bruchez <[hidden email]> wrote:
Tony,

What you are referring to is the Form Runner summary page. Here is the
relevant code:

https://github.com/orbeon/orbeon-forms/blob/master/src/resources/apps/fr/summary/view.xhtml#L527

-Erik

On Wed, Jun 15, 2011 at 6:01 AM, Tony Mobbs <[hidden email]> wrote:
> There are some nice features in the datatable example provided, however I
> can't see how to find them in the documentation.
> Is it possible to be provided with the xhtml file behind the demo?  Sorry if
> it already available, but I could not find it.
>
> http://www.orbeon.com/orbeon/fr/orbeon/contact/summary
> What I am looking for is:
>
> Hovering the mouse over a line highlights the row.
> Clicking on a row as a link to another page.
>
> My current approach is to use a trigger within the table so that I can move
> to a sub-form to edit the data on a separate page.
> The instance looks like this.
> <users>
>   <user>
>     <email></email>
>     ...
>     ...
>   </user>
> </user>
> If I set the value to 'email' (text) then it works well.
>                     <xforms:trigger  appearance="minimal">
>                       <xforms:label><img src="images/edit.gif"
> /></xforms:label>
>                       <xforms:action ev:event="DOMActivate">
>                         <xforms:setvalue
> ref="instance('Administration')//fooUserToEdit" value="'email'" />
>                         <xforms:setvalue
> ref="instance('Administration')//CurrentSection" value="'Edit Users
> Details'" />
>                       </xforms:action>
>                     </xforms:trigger>
> If I try to pass the instance value, then the ref element does not get set.
>  The value of "email" is correctly displayed in the output.  How can I
> correctly pass a value using the xforms:setvalue from within a datatable?
>                     <xforms:trigger  appearance="minimal">
>                       <xforms:label><img src="images/edit.gif"
> /></xforms:label>
>                       <xforms:action ev:event="DOMActivate">
>                         <xforms:setvalue
> ref="instance('Administration')//fooUserToEdit" value="email" />
>                         <xforms:setvalue
> ref="instance('Administration')//CurrentSection" value="'Edit Users
> Details'" />
>                       </xforms:action>
>                     </xforms:trigger>
> Trying an alternative solution, I tried using position(), then the ref
> element gets set to "1" irrespective of which row is highlighted.
>                     <xforms:trigger  appearance="minimal">
>                       <xforms:label><img src="images/edit.gif"
> /></xforms:label>
>                       <xforms:action ev:event="DOMActivate">
>                         <xforms:setvalue
> ref="instance('Administration')//fooUserToEdit" value="position()" />
>                         <xforms:setvalue
> ref="instance('Administration')//CurrentSection" value="'Edit Users
> Details'" />
>                       </xforms:action>
>                     </xforms:trigger>
> I'm using 3.9.0.pre.201106030324
> Cheers
> Tony
>
>
>
>
> --
> 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




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