problem with generating a repeat structure with select1

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

problem with generating a repeat structure with select1

ilango_g
Hi
I need to generate a repeat structure. This repeat structure is to be generated after I make a selection each in three dropdowns.
After this I click on "Save Offense" a new row should be added to a dynamic table below that should have as its contents the contents I selected in the dropdowns.

How I planned to accomplish this was as follows:

I have a instance called:

<instance id="taskoutput>
<fe:output>
<fe:charges-r>
        <fe:charge-r>
                <fe:title-name/>
                <fe:section-name/>
                <fe:subsection-name/>
                </fe:charge-r>
</fe:charges-r>
</fe:output>

Into this instance I plan to generate the template for my repeat structure. And the repeat nodeset is based in this. The code attempts to do this. THe code is not able to place the results of the inserts into this instance. This is the first problem.

I have attached the code here. Any suggestions on this are appreciated.

thanks in advance
view.xhtml
Reply | Threaded
Open this post in threaded view
|

Re: problem with generating a repeat structure with select1

Alessandro Vernet
Administrator
On Wed, Mar 5, 2008 at 8:44 AM, someperson <[hidden email]> wrote:
>  I need to generate a repeat structure. This repeat structure is to be
>  generated after I make a selection each in three dropdowns.
>  After this I click on "Save Offense" a new row should be added to a dynamic
>  table below that should have as its contents the contents I selected in the
>  dropdowns.
>
>  How I planned to accomplish this was as follows:
>  [...]

I have done some of this in the attached view.xhtml, which is pretty
much what you had with some updates. I hope that it will be enough to
illustrate what needs to be done. Here the code I now have in the
action handler:

<xforms:insert nodeset="instance('taskoutput')/fe:charges-r/fe:charge-r"/>
<xforms:setvalue
ref="instance('taskoutput')/fe:charges-r/fe:charge-r[last() -
1]/fe:title-name" value="instance('title-chosen')"/>

Essentially, you want to "add a line" in the instance; this is what
the first insert does; it duplicates the last fe:charge-r. Then you
want to populate it with an xforms:setvalue I did this for the title,
and you can do this for the other elements. In your instance, the last
fe:charge-r will always be empty, and this is the one that gets
duplicated. An alternative (and often preferred) way of doing this is
to store the empty fe:charge-r in an other instance and to copy it
from there using the origin attribute of xforms:insert.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.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
OW2 mailing lists service home page: http://www.ow2.org/wws

view.xhtml (61K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: problem with generating a repeat structure with select1

ilango_g
That was very educative and useful. In your view.xhtml, after I ran the sample I think a "Delete" button was generated even for a row with no data in it. Otherwise the code works like a charm,
And I had for the output in the row something like "..output ref="."
What is the best way to break up this output into separate pieces of data, so that it is easier to format it?
Alessandro Vernet wrote
On Wed, Mar 5, 2008 at 8:44 AM, someperson <ilangocal@yahoo.com> wrote:
>  I need to generate a repeat structure. This repeat structure is to be
>  generated after I make a selection each in three dropdowns.
>  After this I click on "Save Offense" a new row should be added to a dynamic
>  table below that should have as its contents the contents I selected in the
>  dropdowns.
>
>  How I planned to accomplish this was as follows:
>  [...]

I have done some of this in the attached view.xhtml, which is pretty
much what you had with some updates. I hope that it will be enough to
illustrate what needs to be done. Here the code I now have in the
action handler:

<xforms:insert nodeset="instance('taskoutput')/fe:charges-r/fe:charge-r"/>
<xforms:setvalue
ref="instance('taskoutput')/fe:charges-r/fe:charge-r[last() -
1]/fe:title-name" value="instance('title-chosen')"/>

Essentially, you want to "add a line" in the instance; this is what
the first insert does; it duplicates the last fe:charge-r. Then you
want to populate it with an xforms:setvalue I did this for the title,
and you can do this for the other elements. In your instance, the last
fe:charge-r will always be empty, and this is the one that gets
duplicated. An alternative (and often preferred) way of doing this is
to store the empty fe:charge-r in an other instance and to copy it
from there using the origin attribute of xforms:insert.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/

 

--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws


-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/
Reply | Threaded
Open this post in threaded view
|

Re: Re: problem with generating a repeat structure with select1

ilangostl
In reply to this post by Alessandro Vernet
Oops, I did not read your reply properly. Yes, you have instructed me to add in the other values after you have exemplified it.

-ilango

On Wed, Mar 5, 2008 at 9:50 PM, Alessandro Vernet <[hidden email]> wrote:
On Wed, Mar 5, 2008 at 8:44 AM, someperson <[hidden email]> wrote:
>  I need to generate a repeat structure. This repeat structure is to be
>  generated after I make a selection each in three dropdowns.
>  After this I click on "Save Offense" a new row should be added to a dynamic
>  table below that should have as its contents the contents I selected in the
>  dropdowns.
>
>  How I planned to accomplish this was as follows:
>  [...]

I have done some of this in the attached view.xhtml, which is pretty
much what you had with some updates. I hope that it will be enough to
illustrate what needs to be done. Here the code I now have in the
action handler:

<xforms:insert nodeset="instance('taskoutput')/fe:charges-r/fe:charge-r"/>
<xforms:setvalue
ref="instance('taskoutput')/fe:charges-r/fe:charge-r[last() -
1]/fe:title-name" value="instance('title-chosen')"/>

Essentially, you want to "add a line" in the instance; this is what
the first insert does; it duplicates the last fe:charge-r. Then you
want to populate it with an xforms:setvalue I did this for the title,
and you can do this for the other elements. In your instance, the last
fe:charge-r will always be empty, and this is the one that gets
duplicated. An alternative (and often preferred) way of doing this is
to store the empty fe:charge-r in an other instance and to copy it
from there using the origin attribute of xforms:insert.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.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
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