xforms-insert, INTO instead of AFTER

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

xforms-insert, INTO instead of AFTER

MoOmEeN
Hi,

In xforms we have some fields that are not required so they are hidden when user opens the form.
There are two ways to unhide the item:
situation 1. there is '>' button that can trigger xforms-insert
situation 2. there are some select elements, that can trigger another one unhide. e.g. if user choose 'name' value on select, then input field for providing name will show up.
In both situations, as "." is given as context.

We have a problem sometimes in second situation.

We observed, that sometimes, when we want to insert a node next to another one, it is inserted into it.
Problematic code starts in line 295 of orbeon-forms / src / java / org / orbeon / oxf / xforms / action / actions / XFormsInsertAction.java  :>
There is isEmptyNodesetBinding variable that determines if node is inserted into another one or before/after.

The variable is based on the size of contextStack.getCurrentBindingContext().getNodeSet() which is sometimes 0 for context nodes that dont have preceding ones (? i am not sure if analysis was correct here). It results in inserting 'into' instead of 'after'. We were trying to change the behavior of orbeon here by inserting in those situations at 0 position of contexts parent node.
But it results in wrong insertion in situation number 1.

thanks
--
Best Regards - MoOmEeN


--
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: xforms-insert, INTO instead of AFTER

Erik Bruchez
Administrator
> In xforms we have some fields that are not required so they are hidden when

> user opens the form.
> There are two ways to unhide the item:
> situation 1. there is '>' button that can trigger xforms-insert
> situation 2. there are some select elements, that can trigger another one
> unhide. e.g. if user choose 'name' value on select, then input field for
> providing name will show up.
> In both situations, as "." is given as context.
>
> We have a problem sometimes in second situation.
>
> We observed, that sometimes, when we want to insert a node next to another
> one, it is inserted into it.
> Problematic code starts in line 295 of orbeon-forms / src / java / org /
> orbeon / oxf / xforms / action / actions / XFormsInsertAction.java  :>
> There is isEmptyNodesetBinding variable that determines if node is inserted
> into another one or before/after.
>
> The variable is based on the size of
> contextStack.getCurrentBindingContext().getNodeSet() which is sometimes 0
> for context nodes that dont have preceding ones (? i am not sure if analysis
> was correct here). It results in inserting 'into' instead of 'after'. We
> were trying to change the behavior of orbeon here by inserting in those
> situations at 0 position of contexts parent node.
> But it results in wrong insertion in situation number 1.
Use:

<insert context="node into which to insert" nodeset="node(s) next to
which to insert" origin="..."/>

This will cover all cases.

-Erik


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