adding elements of one instance to another instance

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

adding elements of one instance to another instance

Sathish K Mittapelli
Hai all .........
 
I am trying to develop a smart kit in which i have to perfor operations like adding a new item to list or deleting a item or i can edit an existing document on client side and at last i have to save the data to the databse.
 
Here i am trying to get the deleted instance element to another instance element delete,and i want to do the same for add and update and at last i want to perform the sql operations based on the instance.
 
i have taken a instance like this

<xforms:instance id="operations">

        <operations xmlns="">

            <add></add>

            <delete></delete>

            <edit></edit>

        </operations>

</xforms:instance>


 if i have added a new element to the list it has to add to the <add> tag  as like this
 

<add>

    <employee>

          <firstName>sathish</firstName>

            <lastName>kumar</lastName>

    </employee>

</add>

 

and if iahve deleted the item then it has to add to the delete tag as like for add.

 

I am not getting how to add those instance elements to add to other instance elements.

 

Please help me how to resolve this problem.

 

Thanks in Advance.

 

THANKS & REGARDS
SATHISH K MITTAPELLI  


Bollywood, fun, friendship, sports and more. You name it, we have it.

--
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: adding elements of one instance to another instance

Alessandro Vernet
Administrator
Sathish,

On Fri, May 2, 2008 at 1:34 AM, sathish kumar <[hidden email]> wrote:

>  if i have added a new element to the list it has to add to the <add> tag
> as like this
>
>
>
> <add>
>
>     <employee>
>
>           <firstName>sathish</firstName>
>
>             <lastName>kumar</lastName>
>
>     </employee>
>
> </add>
I think you would be using the <xforms:insert> action for this. You
can read more about this action on:

http://www.w3.org/TR/xforms11/#action-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/
Twitter - http://twitter.com/avernet


--
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: adding elements of one instance to another instance

Sathish K Mittapelli

Hai Alessandro Vernet,

I am trying to add the instance element to another instance so that i can get the entered data.When we are using xforms:insert we can insert a template of our instance element to our instance.but in my case i am trying to add that particular added instance element to other instance with the data entered data.

In my case,I have a instance named operations

<xforms:instance id="operations">
            <operations xmlns="">
                <add>
                   
                </add>
                <delete>
                   
                </delete>
                <edit>
                   
                </edit>
            </operations>
        </xforms:instance>

Whenever i perform a particular operation on my main instance according to the operation the instance element should add to the particular node.

For example if i have added one element to my main instance then with the values entered for the particular instance element it has to add to the add node like this

<xforms:instance id="operations">
            <operations xmlns="">
                <add>
                       
<firstName>Sathish</firstName>
                            <
lastName>Kumar</lastName>

                </add>
.......................
.........
And the same thing when i have deleted a item then it has to add to the delete node with the instance element which is going to be deleted.

Is this possible to do like this....I am trying this.........

Please help me in this.

Thanks in advance....
THANKS & REGARDS
SATHISH K MITTAPELLI  


--- On Sat, 3/5/08, Alessandro Vernet <[hidden email]> wrote:
From: Alessandro Vernet <[hidden email]>
Subject: [ops-users] Re: adding elements of one instance to another instance
To: [hidden email]
Date: Saturday, 3 May, 2008, 4:59 AM

Sathish,

On Fri, May 2, 2008 at 1:34 AM, sathish kumar <[hidden email]>
wrote:
> if i have added a new element to the list it has to add to the
<add> tag

> as like this
>
>
>
> <add>
>
> <employee>
>
> <firstName>sathish</firstName>
>
> <lastName>kumar</lastName>
>
> </employee>
>
> </add>

I think you would be using the <xforms:insert> action for this. You
can read more about this action on:

http://www.w3.org/TR/xforms11/#action-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/
Twitter - http://twitter.com/avernet
--
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


Did you know? You can CHAT without downloading messenger. Click here

--
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: adding elements of one instance to another instance

fl.schmitt(ops-users)
Hi sathish,

> I am trying to add the instance element to another instance so that i
> can get the entered data.When we are using xforms:insert we can insert a
> template of our instance element to our instance.but in my case i am
> trying to add that particular added instance element to other instance
> with the data entered data.

i think you can't do this in _one_ step. You will first have to add the
(empty) elements to your instance as Alessandro explained, and after
that, to issue a xforms:setvalue for each new element to copy the value
from your source element to the newly created copy.

With setvalue, you will have to take care that the setvalue command
addresses the correct elements in both of your instances (source and
destination).


HTH
florian

PS: Using a submission that aggregates the new elements with the
existing data and an xpl that "mirrors" the submitted xml data, it _may_
be possible to copy a fragment from one instance to another in one step,
but this solution is IMHO quite complicated. One would have to aggregate
from the new elements and the nodeset existing in the target instance,
and replace just the existing nodeset with this fragement - i don't know
whether this could work.... i suppose it's easier to use insert / setvalue.



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