Problem with Xforms Repeat

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

Problem with Xforms Repeat

Phani S
Hi all,
        In my application I have a trigger which adds the controls. For this I followed the bookcast example given in tutorial. When I select the Add One it is not producing another element.

My instance looks like

            <xforms:instance id="books-instance">
                <books xmlns="">
                    <book>
                        <title/>
                        <authors>
                           <author />
                       </authors>
                    </book>
                </books>
            </xforms:instance>

In this one author element gets repeated. Here I have attached the view. When I click Add One the new control should appear last. Please have a look at this and tell me where I made mistake.

Thanks in Advance...
--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398


--
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 (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Xforms Repeat

Phani S
Can someone please look at the code and tell me whats wrong with it.

On Tue, Sep 22, 2009 at 5:31 PM, Phani Sajja <[hidden email]> wrote:
Hi all,
        In my application I have a trigger which adds the controls. For this I followed the bookcast example given in tutorial. When I select the Add One it is not producing another element.

My instance looks like

            <xforms:instance id="books-instance">
                <books xmlns="">
                    <book>
                        <title/>
                        <authors>
                           <author />
                       </authors>
                    </book>
                </books>
            </xforms:instance>

In this one author element gets repeated. Here I have attached the view. When I click Add One the new control should appear last. Please have a look at this and tell me where I made mistake.

Thanks in Advance...
--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398



--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398


--
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: Re: Problem with Xforms Repeat

Kalle Säilä
It should be:

<xforms:insert ev:event="DOMActivate" origin="instance('author-template')"  nodeset="*" at="index('author-repeat')" position="after" context="instance('books-instance')/book/authors" />

In the insert the nodeset points to the nodeset you want't insert from the origin to context.

- Kalle

On 25.9.2009, at 9.09, Phani Sajja wrote:

Can someone please look at the code and tell me whats wrong with it.

On Tue, Sep 22, 2009 at 5:31 PM, Phani Sajja <[hidden email]> wrote:
Hi all,
        In my application I have a trigger which adds the controls. For this I followed the bookcast example given in tutorial. When I select the Add One it is not producing another element.

My instance looks like

            <xforms:instance id="books-instance">
                <books xmlns="">
                    <book>
                        <title/>
                        <authors>
                           <author />
                       </authors>
                    </book>
                </books>
            </xforms:instance>

In this one author element gets repeated. Here I have attached the view. When I click Add One the new control should appear last. Please have a look at this and tell me where I made mistake.

Thanks in Advance...
--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398



--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Problem with Xforms Repeat

Phani S
Thanks Kalle for your help,
 
       Still it didn't work for me. Now I could be able to remove the control but not able to add a control. Please take a look at my new view.xhtml and tell me what went wrong.


On Fri, Sep 25, 2009 at 11:58 AM, Kalle Säilä <[hidden email]> wrote:
It should be:

<xforms:insert ev:event="DOMActivate" origin="instance('author-template')"  nodeset="*" at="index('author-repeat')" position="after" context="instance('books-instance')/book/authors" />

In the insert the nodeset points to the nodeset you want't insert from the origin to context.

- Kalle


--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398


--
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 (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Problem with Xforms Repeat

Kalle Säilä
First in the origin attribute change the instance('author-instance') to instance('author-template') since you don't have any "author-instance". Then change the nodeset from author to * since the author is the root element.

- Kalle

On 25.9.2009, at 10.32, Phani Sajja wrote:

Thanks Kalle for your help,
 
       Still it didn't work for me. Now I could be able to remove the control but not able to add a control. Please take a look at my new view.xhtml and tell me what went wrong.


On Fri, Sep 25, 2009 at 11:58 AM, Kalle Säilä <[hidden email]> wrote:
It should be:

<xforms:insert ev:event="DOMActivate" origin="instance('author-template')"  nodeset="*" at="index('author-repeat')" position="after" context="instance('books-instance')/book/authors" />

In the insert the nodeset points to the nodeset you want't insert from the origin to context.

- Kalle


--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398
<view.xhtml>
--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Problem with Xforms Repeat

Phani S
Thanks Kalle,
                  Now it is working fine.

On Fri, Sep 25, 2009 at 1:23 PM, Kalle Säilä <[hidden email]> wrote:
First in the origin attribute change the instance('author-instance') to instance('author-template') since you don't have any "author-instance". Then change the nodeset from author to * since the author is the root element.

- Kalle

On 25.9.2009, at 10.32, Phani Sajja wrote:

Thanks Kalle for your help,
 
       Still it didn't work for me. Now I could be able to remove the control but not able to add a control. Please take a look at my new view.xhtml and tell me what went wrong.


On Fri, Sep 25, 2009 at 11:58 AM, Kalle Säilä <[hidden email]> wrote:
It should be:

<xforms:insert ev:event="DOMActivate" origin="instance('author-template')"  nodeset="*" at="index('author-repeat')" position="after" context="instance('books-instance')/book/authors" />

In the insert the nodeset points to the nodeset you want't insert from the origin to context.

- Kalle


--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398
<view.xhtml>

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
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




--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398


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