Hi, I believe I have uncovered a bug which occurs with nested repeats when using Orbeon within a portal environment. The findRepeatDelimiter function in xforms.js at the start of the function has the following line:
var parent = ORBEON.xforms.Globals.repeatTreeChildToParent[currentId]; The repeat tree holds the parent id for each repeat only within a portal environment the id's do not match the portlet repeat id's. In a portal environment the ids are prefixed with the portlet name i.e. 'repeat-begin-_torchEventList_WAR_torch_xf-3' instead of 'repeat-begin-xf-3'. This results in an incorrect position and null pointer exception, I have an example form to test below. If you click the second trigger in the sandbox it's ok but in a portal environment this will throw an exception. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:atom="http://www.w3.org/2005/Atom"> <head> <xforms:model id="event-list-model"> <xforms:instance id="event-list-inst"> <feed xmlns="http://www.w3.org/2005/Atom"> <entry> <feed> <entry> <subtitle>sub item 1</subtitle> </entry> <entry> <subtitle>sub item 2</subtitle> </entry> </feed> </entry> </feed> </xforms:instance> </xforms:model> </head> <body>
</html> I have added a workaround ('var currentId = repeatId' to 'var currentId = repeatId.substring(repeatId.indexOf('xf-'),repeatId.length);') to strip the portlet name from the id for now but hope you can provide a better solution. We are using 3.9.0 CE. Regards, Ben. |
bump
|
Administrator
|
In reply to this post by benjamin.dougherty
Funny, your "bump" did not make it to my inbox.
I do reproduce this with the nightly builds and I have entered an issue: https://github.com/orbeon/orbeon-forms/issues/242 -Erik On Sun, Feb 26, 2012 at 8:37 AM, benjamin.dougherty <[hidden email]> wrote: > Hi, I believe I have uncovered a bug which occurs with nested repeats when > using Orbeon within a portal environment. The findRepeatDelimiter function > in xforms.js at the start of the function has the following line: > > var parent = ORBEON.xforms.Globals.repeatTreeChildToParent[currentId]; > > The repeat tree holds the parent id for each repeat only within a portal > environment the id's do not match the portlet repeat id's. In a portal > environment the ids are prefixed with the portlet name i.e. > 'repeat-begin-_torchEventList_WAR_torch_xf-3' instead of > 'repeat-begin-xf-3'. > > This results in an incorrect position and null pointer exception, I have an > example form to test below. If you click the second trigger in the sandbox > it's ok but in a portal environment this will throw an exception. > > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:atom="http://www.w3.org/2005/Atom"> > <head> > <xforms:model id="event-list-model"> > > > <xforms:instance id="event-list-inst"> > <feed xmlns="http://www.w3.org/2005/Atom"> > <entry> > <feed> > <entry> > <subtitle>sub item 1</subtitle> > </entry> > <entry> > <subtitle>sub item 2</subtitle> > </entry> > </feed> > </entry> > </feed> > </xforms:instance> > > > </xforms:model> > </head> > <body> > <table> > <xforms:repeat nodeset="instance('event-list-inst')/atom:entry"> > <tr> > <td> > <xforms:output ref="'name'" /> > </td> > <td> > <table> > <xforms:repeat nodeset="atom:feed/atom:entry"> > <tr> > <td> > <xforms:trigger> > <xforms:label> > <xforms:output value="'clickme'" /> > </xforms:label> > <xforms:action ev:event="DOMActivate"> > <xforms:message value="'hi'" /> > </xforms:action> > </xforms:trigger> > </td> > </tr> > </xforms:repeat> > </table> > </td> > </tr> > </xforms:repeat> > </table> > </body> > </html> > > I have added a workaround ('var currentId = repeatId' to 'var currentId = > repeatId.substring(repeatId.indexOf('xf-'),repeatId.length);') to strip the > portlet name from the id for now but hope you can provide a better solution. > > We are using 3.9.0 CE. -- 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
|
At long last, this bug is now fixed.
-Erik On Sat, May 19, 2012 at 5:51 PM, Erik Bruchez <[hidden email]> wrote: Funny, your "bump" did not make it to my inbox. -- 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 |