Nested repeat with filters...

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

Nested repeat with filters...

Marco Lebel
Hello all,

You will find attach an xhtml forms that runs on the current sandbox but
does exhibit what I would qualify as a strange behavior.  If you follow the
scenario below you will see what I mean.

1)  When the page is first loaded the filter field is not set if you try to
set it to A.  Nothing happens the reference field does get assigned.  It
will only get an assigned a value if you first select B or C.

2) Select B the form should display the selected master node set and the
associated detail node set... but sadly it does not.

3) Select A then the form display the selected master record and detail
record like I was hoping.

4) Select B then the form does display the master and detail node set like I
was hoping.

5)  Now go back and select A again.  All is fine but when you go about
selecting the second master record you get an xform engine error: XForms
error: repeatChildren and newNodeset have different sizes.

I am assuming that this behavior is related to event(s) not being fired when
they should...

Finally in the form I am trying to put in place a trigger that would modify
a specific field of a nodeset setvalue does not work becuase it acts on a
single node I am searching for a way to assigned a value to a group of field
with a repeat set!!!!

That is it for now... and as always thanks for your help.

Marco.

p.s. To the dev team keep up the good work...

_________________________________________________________________
Off to school, going on a trip, or moving? Windows Live (MSN) Messenger lets
you stay in touch with friends and family wherever you go. Click here to
find out how to sign up!  http://www.telusmobility.com/msnxbox/


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

repeat-details.xhtml (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Nested repeat with filters...

Alexander Žaťko
Marco,

As I recently went through a mental exercise to understand a similar  
problem so I think I can offer some advice:

1) to have the A node selected when the page loads, put that value  
into the instance node:

<discriminantFilter>A</discriminantFilter>


2) To have dependent drop-downs/repeats display a particular item you  
have to use something like this:

<xforms:action ev:event="xforms-value-changed">
   <xforms:setvalue ref="//dependent/node/reference/value"
     value="/dependent/node/itemset/value][1]"/>
</xforms:action>

Basically, you have to implement into your form logic that will  
propagate selection of default values down your "dependence tree".

I agree that it is very misleading to see an item in a control  
selected but the node for the corresponding item value not set - I  
think this should be changed in OF. I think OF should not show  
nothing selected in a select control if a corresponding node does not  
contain the value of the selected item.

As for...

> Finally in the form I am trying to put in place a trigger that  
> would modify a specific field of a nodeset setvalue does not work  
> becuase it acts on a single node I am searching for a way to  
> assigned a value to a group of field with a repeat set!!!!

This was brought up on the list recently by yours truly and Eric gave  
a very useful response. Check the list archive (http://
www.objectweb.org/wws/arc/ops-users/) - the subject of that email  
thread was:

populating node set dynamically using xxforms:call-xpl

Let me know if my explanation of how to set up the default values in  
dependent repeat structures (select boxes and repeats) is  
incomprehensible.

A.

On Dec 13, 2006, at 11:50 PM, Marco Lebel wrote:

> Hello all,
>
> You will find attach an xhtml forms that runs on the current  
> sandbox but does exhibit what I would qualify as a strange  
> behavior.  If you follow the scenario below you will see what I mean.
>
> 1)  When the page is first loaded the filter field is not set if  
> you try to set it to A.  Nothing happens the reference field does  
> get assigned.  It will only get an assigned a value if you first  
> select B or C.
>
> 2) Select B the form should display the selected master node set  
> and the associated detail node set... but sadly it does not.
>
> 3) Select A then the form display the selected master record and  
> detail record like I was hoping.
>
> 4) Select B then the form does display the master and detail node  
> set like I was hoping.
>
> 5)  Now go back and select A again.  All is fine but when you go  
> about selecting the second master record you get an xform engine  
> error: XForms error: repeatChildren and newNodeset have different  
> sizes.
>
> I am assuming that this behavior is related to event(s) not being  
> fired when they should...
>
> Finally in the form I am trying to put in place a trigger that  
> would modify a specific field of a nodeset setvalue does not work  
> becuase it acts on a single node I am searching for a way to  
> assigned a value to a group of field with a repeat set!!!!
>
> That is it for now... and as always thanks for your help.
>
> Marco.
>
> p.s. To the dev team keep up the good work...
>
> _________________________________________________________________
> Off to school, going on a trip, or moving? Windows Live (MSN)  
> Messenger lets you stay in touch with friends and family wherever  
> you go. Click here to find out how to sign up!  http://
> www.telusmobility.com/msnxbox/
> <repeat-details.xhtml>
>
> --
> You receive this message as a subscriber of the ops-
> [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



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Nested repeat with filters...

Marco Lebel
Thanks for your response... My comments are interseeded...


>From: Alexander Zatko <[hidden email]>
>Reply-To: [hidden email]
>To: [hidden email]
>Subject: Re: [ops-users] Nested repeat with filters...
>Date: Thu, 14 Dec 2006 10:36:20 +0100
>
>Marco,
>
>As I recently went through a mental exercise to understand a similar  
>problem so I think I can offer some advice:
>
>1) to have the A node selected when the page loads, put that value  into
>the instance node:
>
><discriminantFilter>A</discriminantFilter>
I know that works, but unfortunately I can't do that.  i.e. I do not know
what the discriminant field value(s) will be so setting to an arbitrary
value is not an option, there is even some condition where my itemlist might
be empty!!!!.  On a side note it seems to me that if I select A with the
drop down it should/must set the ref node to that value no matter what the
ref node value

>
>
>2) To have dependent drop-downs/repeats display a particular item you  have
>to use something like this:
>
><xforms:action ev:event="xforms-value-changed">
>   <xforms:setvalue ref="//dependent/node/reference/value"
>     value="/dependent/node/itemset/value][1]"/>
></xforms:action>
>
????
If you are suggesting to put this value change event on the drop down it
does not work.  I tried it and the event does not get fired when you select
the first value of the itemlist (on initial load... of course once you have
selected the second item on the list then the event gets fired so comming
back to the first item does fire the event... well it seem to rememember it
was doing that).  If not I do not understand what you mean... sorry.

>Basically, you have to implement into your form logic that will  propagate
>selection of default values down your "dependence tree".
I think I understand what you are saying but if you follow my scenario the
form does what it should do under some condition and not under other
conditions... which let me to believe that there are some events that do not
get fired under certain conditions when they should!!!!

>
>I agree that it is very misleading to see an item in a control  selected
>but the node for the corresponding item value not set - I  think this
>should be changed in OF. I think OF should not show  nothing selected in a
>select control if a corresponding node does not  contain the value of the
>selected item.
>
Maybe, but again like I said if I go about selecting it it should at the
very least set my ref node!!!!

>As for...
>
>>Finally in the form I am trying to put in place a trigger that  would
>>modify a specific field of a nodeset setvalue does not work  becuase it
>>acts on a single node I am searching for a way to  assigned a value to a
>>group of field with a repeat set!!!!
>
>This was brought up on the list recently by yours truly and Eric gave  a
>very useful response. Check the list archive (http://
>www.objectweb.org/wws/arc/ops-users/) - the subject of that email  thread
>was:
>
>populating node set dynamically using xxforms:call-xpl
>
Thanks I will go take a look, sorry for the repeat!!!

>Let me know if my explanation of how to set up the default values in  
>dependent repeat structures (select boxes and repeats) is  
>incomprehensible.
>
I guess if you eleborate on the second part I might get a better
understanding of what you are trying to impart... :-)

Marco,

>A.
>
>On Dec 13, 2006, at 11:50 PM, Marco Lebel wrote:
>
>>Hello all,
>>
>>You will find attach an xhtml forms that runs on the current  sandbox but
>>does exhibit what I would qualify as a strange  behavior.  If you follow
>>the scenario below you will see what I mean.
>>
>>1)  When the page is first loaded the filter field is not set if  you try
>>to set it to A.  Nothing happens the reference field does  get assigned.  
>>It will only get an assigned a value if you first  select B or C.
>>
>>2) Select B the form should display the selected master node set  and the
>>associated detail node set... but sadly it does not.
>>
>>3) Select A then the form display the selected master record and  detail
>>record like I was hoping.
>>
>>4) Select B then the form does display the master and detail node  set
>>like I was hoping.
>>
>>5)  Now go back and select A again.  All is fine but when you go  about
>>selecting the second master record you get an xform engine  error: XForms
>>error: repeatChildren and newNodeset have different  sizes.
>>
>>I am assuming that this behavior is related to event(s) not being  fired
>>when they should...
>>
>>Finally in the form I am trying to put in place a trigger that  would
>>modify a specific field of a nodeset setvalue does not work  becuase it
>>acts on a single node I am searching for a way to  assigned a value to a
>>group of field with a repeat set!!!!
>>
>>That is it for now... and as always thanks for your help.
>>
>>Marco.
>>
>>p.s. To the dev team keep up the good work...
>>
>>_________________________________________________________________
>>Off to school, going on a trip, or moving? Windows Live (MSN)  Messenger
>>lets you stay in touch with friends and family wherever  you go. Click
>>here to find out how to sign up!  http:// www.telusmobility.com/msnxbox/
>><repeat-details.xhtml>
>>
>>--
>>You receive this message as a subscriber of the ops- [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
>
>

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

_________________________________________________________________
Enter the "Telus Mobility Xbox a Day" contest for your chance to WIN!  Telus
Mobility is giving away an Microsoft Xbox® 360 every day from November 20 to
December 31, 2006! Just download Windows Live (MSN) Messenger to your
IM-capable TELUS mobile phone, and you could be a winner!  
http://www.telusmobility.com/msnxbox/




--
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
Reply | Threaded
Open this post in threaded view
|

Re: Nested repeat with filters...

Marco Lebel
In reply to this post by Alexander Žaťko
Does this information from the xforms spec explains part what I am
experiencing(eractic display behavior)?

"7.5.1 Dynamic Dependencies
Not every possible XPath expression is acceptable as a binding expression.
In particular, there are restrictions on model binding expressions that
create dynamic dependencies, which are defined as follows:

An XPath predicate (in square brackets) is a possibly implicit boolean test.
A dynamic dependency exists on any predicate unless all terms in the test
are "fixed", where fixed means either a constant, or a value that will not
change between operations explicitly defined as rebuilding computational
dependencies.

Note:

For purposes of determining dynamic dependencies, the following
subexpressions are considered fixed: position(), last(), count(), and
property(). This is because the specification mandates a dependency rebuild
after any event that could change the values returned by these functions.

Another dynamic dependency is any use of the id() function, unless both the
parameter to the function and the matching attribute of type xsd:ID are
fixed. In the same way, the instance() function is dynamic unless the
parameter to the function is fixed.

XPath variables that change in value from one recalculate to the next would
also create dynamic dependencies (though XForms defines an empty variable
context for all XPath expressions).

Authors that define extension functions are encouraged to follow these
rules. "



>
>On Dec 13, 2006, at 11:50 PM, Marco Lebel wrote:
>
>>Hello all,
>>
>>You will find attach an xhtml forms that runs on the current  sandbox but
>>does exhibit what I would qualify as a strange  behavior.  If you follow
>>the scenario below you will see what I mean.
>>
>>1)  When the page is first loaded the filter field is not set if  you try
>>to set it to A.  Nothing happens the reference field does  get assigned.  
>>It will only get an assigned a value if you first  select B or C.
>>
>>2) Select B the form should display the selected master node set  and the
>>associated detail node set... but sadly it does not.
>>
>>3) Select A then the form display the selected master record and  detail
>>record like I was hoping.
>>
>>4) Select B then the form does display the master and detail node  set
>>like I was hoping.
>>
>>5)  Now go back and select A again.  All is fine but when you go  about
>>selecting the second master record you get an xform engine  error: XForms
>>error: repeatChildren and newNodeset have different  sizes.
>>
>>I am assuming that this behavior is related to event(s) not being  fired
>>when they should...
>>
>>Finally in the form I am trying to put in place a trigger that  would
>>modify a specific field of a nodeset setvalue does not work  becuase it
>>acts on a single node I am searching for a way to  assigned a value to a
>>group of field with a repeat set!!!!
>>
>>That is it for now... and as always thanks for your help.
>>
>>Marco.
>>
>>p.s. To the dev team keep up the good work...
>>
>>_________________________________________________________________
>>Off to school, going on a trip, or moving? Windows Live (MSN)  Messenger
>>lets you stay in touch with friends and family wherever  you go. Click
>>here to find out how to sign up!  http:// www.telusmobility.com/msnxbox/
>><repeat-details.xhtml>
>>
>>--
>>You receive this message as a subscriber of the ops- [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
>
>

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

_________________________________________________________________
Get the latest Windows Live Messenger 8.1 Beta version. Join now.
http://ideas.live.com




--
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
Reply | Threaded
Open this post in threaded view
|

Re: Nested repeat with filters...

Alessandro  Vernet
Administrator
In reply to this post by Marco Lebel
On 12/13/06, Marco Lebel <[hidden email]> wrote:
> 1)  When the page is first loaded the filter field is not set if you try to
> set it to A.  Nothing happens the reference field does get assigned.  It
> will only get an assigned a value if you first select B or C.

Marco,

For this first problem, add to your <xforms:select1>:

  <xforms:item>
      <xforms:label>No value selected</xforms:label>
      <xforms:value/>
  </xforms:item>

This will be add new entry in the drop-down, which will be selected if
you have no value in the instance. Otherwise, when you have no value
in the instance that matches a value in the itemset, the first value
is selected (A). So when you select again, nothing happens, because it
was already selected before.

Alex
--
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
Reply | Threaded
Open this post in threaded view
|

Re: Nested repeat with filters...

Alessandro  Vernet
Administrator
In reply to this post by Marco Lebel
On 12/13/06, Marco Lebel <[hidden email]> wrote:
> You will find attach an xhtml forms that runs on the current sandbox but
> does exhibit what I would qualify as a strange behavior.  If you follow the
> scenario below you will see what I mean.

Marco,

I have added a bug covering the other issues you mentioned. You can track it at:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=306528&group_id=168&atid=350207

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