Hi all, I have a problem when using a custom JS script
to modify the XForms repeat results (making the table sortable). From what I
can see its appears to be moving the indexes around, so is there any way I can reindex
the repeat to get around this? I’ve tried doing the sorting server side,
but client-side is so much quicker and interactive! Ryan Puddephatt Software Engineer TFX Group - IT UK Scotand EH54 7DP (
01506 407 110 7 01506 407 108 -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Ryan,
I am not sure what you mean by "moving the indices around". Who is moving those indices (your custom JS code, or the XForms JS code), and what are those indices? Alex On 3/10/06, Ryan Puddephatt <[hidden email]> wrote: > > > > Hi all, > > I have a problem when using a custom JS script to modify the > XForms repeat results (making the table sortable). From what I can see its > appears to be moving the indexes around, so is there any way I can reindex > the repeat to get around this? I've tried doing the sorting server side, but > client-side is so much quicker and interactive! > > > > Ryan Puddephatt > > Software Engineer > > TFX Group - IT UK > > 1 Michaelson Square > > Livingston > > West Lothian > > Scotand > > EH54 7DP > > > > * [hidden email] > > ( 01506 407 110 > > 7 01506 407 108 > > > > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alex,
Sorry I didn't explain myself, I've got a custom JS code that sorts a table. This table is produced by a XForms Repeat. The code takes into account the hidden rows that are produced, but can't change the indices that the engine uses, so when I go to update the repeat after its sorted I get an error. I either want to update the indices with the new order in the table or build my code to sort the table using functions within the xforms engine? Any ideas Ryan Puddephatt Software Engineer TFX Group - IT UK 1 Michaelson Square Livingston West Lothian Scotand EH54 7DP * [hidden email] ( 01506 407 110 7 01506 407 108 >-----Original Message----- >From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro >Vernet >Sent: 13 March 2006 21:00 >To: [hidden email] >Subject: Re: [ops-users] xforms:repeat Problem > >Ryan, > >I am not sure what you mean by "moving the indices around". Who is >moving those indices (your custom JS code, or the XForms JS code), and >what are those indices? > >Alex > >On 3/10/06, Ryan Puddephatt <[hidden email]> wrote: >> >> >> >> Hi all, >> >> I have a problem when using a custom JS script to modify the >> XForms repeat results (making the table sortable). From what I can see >its >> appears to be moving the indexes around, so is there any way I can >reindex >> the repeat to get around this? I've tried doing the sorting server side, >but >> client-side is so much quicker and interactive! >> >> >> >> Ryan Puddephatt >> >> Software Engineer >> >> TFX Group - IT UK >> >> 1 Michaelson Square >> >> Livingston >> >> West Lothian >> >> Scotand >> >> EH54 7DP >> >> >> >> * [hidden email] >> >> ( 01506 407 110 >> >> 7 01506 407 108 >> >> >> >> >> >> -- >> 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 >> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws >> >> >> > > >-- >Blog (XML, Web apps, Open Source): >http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Ryan,
Sequential indices are used in the generated HTML, in document order. If you move the data around, you should not change the indices. When data comes back from the server, you will have to do the sorting again, keeping in mind that only the indices that have changed are updated. So if initially you have: 3 1 2 You sort this, and it becomes: 1 2 3 Then something changes on the server which updates the value 3 to 4. This will update what is on index 1. So you will have: 4 2 3 To handle this, when you do the sorting you would have to store the index changes (3 on position 1 went to position 3, 1 on position 2 went to position 1, 2 on position 3 went to position 2). Then when you see that position 1 gets updated with value 4, you can say "ah, 1 went to 3, so in fact the 4 should to position 3" and change this to: 1 2 4 That seems like a non-trivial thing to do, and if I were you, I wouldn't want to go down that path :). Alex On 3/16/06, Ryan Puddephatt <[hidden email]> wrote: > Alex, > Sorry I didn't explain myself, I've got a custom JS code that sorts > a table. This table is produced by a XForms Repeat. The code takes into > account the hidden rows that are produced, but can't change the indices that > the engine uses, so when I go to update the repeat after its sorted I get an > error. I either want to update the indices with the new order in the table > or build my code to sort the table using functions within the xforms engine? > Any ideas > > Ryan Puddephatt > Software Engineer > TFX Group - IT UK > 1 Michaelson Square > Livingston > West Lothian > Scotand > EH54 7DP > > * [hidden email] > ( 01506 407 110 > 7 01506 407 108 > > > >-----Original Message----- > >From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro > >Vernet > >Sent: 13 March 2006 21:00 > >To: [hidden email] > >Subject: Re: [ops-users] xforms:repeat Problem > > > >Ryan, > > > >I am not sure what you mean by "moving the indices around". Who is > >moving those indices (your custom JS code, or the XForms JS code), and > >what are those indices? > > > >Alex > > > >On 3/10/06, Ryan Puddephatt <[hidden email]> wrote: > >> > >> > >> > >> Hi all, > >> > >> I have a problem when using a custom JS script to modify the > >> XForms repeat results (making the table sortable). From what I can see > >its > >> appears to be moving the indexes around, so is there any way I can > >reindex > >> the repeat to get around this? I've tried doing the sorting server side, > >but > >> client-side is so much quicker and interactive! > >> > >> > >> > >> Ryan Puddephatt > >> > >> Software Engineer > >> > >> TFX Group - IT UK > >> > >> 1 Michaelson Square > >> > >> Livingston > >> > >> West Lothian > >> > >> Scotand > >> > >> EH54 7DP > >> > >> > >> > >> * [hidden email] > >> > >> ( 01506 407 110 > >> > >> 7 01506 407 108 > >> > >> > >> > >> > >> > >> -- > >> 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 > >> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > >> > >> > >> > > > > > >-- > >Blog (XML, Web apps, Open Source): > >http://www.orbeon.com/blog/ > > > > > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |