I have a datatable that is paginated with a <xforms:repeat ... that the items
in the datatable. I have triggers that take some action based on pressed. My code <fr:datatable id="list-program-table" paginated="true" rowsPerPage="10"> <xhtml:thead> <xhtml:tr> <xhtml:th fr:sortable="true" fr:resizeable="true"> Program Name </xhtml:th> </xhtml:tr> </xhtml:thead> <xhtml:tbody> <xforms:repeat nodeset="instance('datatable-instance')/program[position() < last()]" id="record-repeat"> <xhtml:tr> <xhtml:td fr:sortable="true" fr:sortType="text" fr:resizeable="true"> <xforms:output ref="program-name" /> </xhtml:td> </xhtml:tr> </xforms:repeat> </xhtml:tbody> </fr:datatable> Later, when I want to figure out which row in the table the user wants me to I use index('program-repeat'). index will return relative to the page displayed. But I to know relative to ALL pages. For example, if the user is on the second page and focus on the second item in the table then index will return 2. But I want 12. Is some way to calculate this? Thanks, Mike. -- 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
|
Mike,
Am I right to assume that you want the index in the whole repeat so you can access something in the node at that index? If that is the case, you should be able to access that node with xxforms:repeat-nodeset('program-repeat')[index('program-repeat')]. Would that work in your case? Alex On Mon, Jul 26, 2010 at 6:41 PM, <[hidden email]> wrote: > I have a datatable that is paginated with a <xforms:repeat ... that the items > in the datatable. I have triggers that take some action based on pressed. My > code > > <fr:datatable id="list-program-table" paginated="true" rowsPerPage="10"> > <xhtml:thead> > <xhtml:tr> > <xhtml:th fr:sortable="true" fr:resizeable="true"> > Program Name > </xhtml:th> > </xhtml:tr> > </xhtml:thead> > <xhtml:tbody> > <xforms:repeat > nodeset="instance('datatable-instance')/program[position() < last()]" > id="record-repeat"> > <xhtml:tr> > <xhtml:td fr:sortable="true" fr:sortType="text" > fr:resizeable="true"> > <xforms:output ref="program-name" /> > </xhtml:td> > </xhtml:tr> > </xforms:repeat> > </xhtml:tbody> > </fr:datatable> > > Later, when I want to figure out which row in the table the user wants me to I > use index('program-repeat'). index will return relative to the page displayed. > But I to know relative to ALL pages. For example, if the user is on the second > page and focus on the second item in the table then index will return 2. But I > want 12. Is some way to calculate this? > > Thanks, > Mike. > > > -- > 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 > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/avernet -- 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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
In reply to this post by mfpaschal
That did not work. I put the xxforms:repeat-nodset in and get: "No enclosing xforms:repeat found for id: program-repeat". I have triggers outside the xforms:repeat that do the reference. Thanks, Mike. -----Original Message-----
From: Alessandro Vernet <[hidden email]> To: ops-users <[hidden email]> Sent: Thu, Jul 29, 2010 7:38 pm Subject: [ops-users] Re: Finding an item in the datatable Mike,
-- 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
|
Mike,
I see. I think that the fr-selection-changed event is what you are looking for. For more on this event, look for fr-selection-changed on this page: http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components/datatable Alex On Fri, Jul 30, 2010 at 4:59 AM, <[hidden email]> wrote: > Hi Alex. > > That did not work. > > I put the xxforms:repeat-nodset in and get: "No enclosing xforms:repeat > found for id: program-repeat". I have triggers outside the xforms:repeat > that do the reference. > > Thanks, > Mike. > > > > > -----Original Message----- > From: Alessandro Vernet <[hidden email]> > To: ops-users <[hidden email]> > Sent: Thu, Jul 29, 2010 7:38 pm > Subject: [ops-users] Re: Finding an item in the datatable > > Mike, > > > > > > Am I right to assume that you want the index in the whole repeat so > > > you can access something in the node at that index? If that is the > > > case, you should be able to access that node with > > > xxforms:repeat-nodeset('program-repeat')[index('program-repeat')]. > > > Would that work in your case? > > > > > > Alex > > > > > > On Mon, Jul 26, 2010 at 6:41 PM, <[hidden email]> wrote: > > >> I have a datatable that is paginated with a <xforms:repeat ... that the >> items > > >> in the datatable. I have triggers that take some action based on pressed. >> My > > >> code > > >> > > >> <fr:datatable id="list-program-table" paginated="true" rowsPerPage="10"> > > >> <xhtml:thead> > > >> <xhtml:tr> > > >> <xhtml:th fr:sortable="true" fr:resizeable="true"> > > >> Program Name > > >> </xhtml:th> > > >> </xhtml:tr> > > >> </xhtml:thead> > > >> <xhtml:tbody> > > >> <xforms:repeat > > >> nodeset="instance('datatable-instance')/program[position() < last()]" > > >> id="record-repeat"> > > >> <xhtml:tr> > > >> <xhtml:td fr:sortable="true" fr:sortType="text" > > >> fr:resizeable="true"> > > >> <xforms:output ref="program-name" /> > > >> </xhtml:td> > > >> </xhtml:tr> > > >> </xforms:repeat> > > >> </xhtml:tbody> > > >> </fr:datatable> > > >> > > >> Later, when I want to figure out which row in the table the user wants me >> to I > > >> use index('program-repeat'). index will return relative to the page >> displayed. > > >> But I to know relative to ALL pages. For example, if the user is on the >> second > > >> page and focus on the second item in the table then index will return 2. >> But I > > >> want 12. Is some way to calculate this? > > >> > > >> Thanks, > > >> Mike. > > >> > > >> > > >> -- > > >> 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 > > >> > > >> > > > > > > > > > > > > -- > > > Orbeon Forms - Web forms, open-source, for the Enterprise - > > > http://www.orbeon.com/ > > > My Twitter: http://twitter.com/avernet > > > > > > > > > -- > > > 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 > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/avernet -- 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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |