How to reload all instances in a model on submit

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

How to reload all instances in a model on submit

lakshmipmandava
I am looking to reload all instances present in a model on submit.

Sample code inside my model is as follows:

<xforms:submission  id="consl-submit" ref="instance('consl-num')" method="post" replace="instance"
                        action="/rest/patientFile/conslnum/"/>       

<xforms:instance id="consl-num" xmlns="">
            <data>
                <consl/>
                <consl-id/>
                <tagname/>
            </data>       
<xforms:instance id="status-info" src="/rest/patientFile/savestatus/" xmlns=""/>
   
    <xforms:instance id="modified-tag" xmlns="">
      <data>
          <value/>
      </data>
    </xforms:instance>


-----------------------------

On submission of "consl-submit",  how do i reload "status-info" and "modified-tag" instances?

Regards,
prasad
Reply | Threaded
Open this post in threaded view
|

Re: How to reload all instances in a model on submit

lakshmipmandava
Sample code from the model
<xforms:submission  id="consl-submit" ref="instance('consl-num')" method="post" replace="instance"
                        action="/rest/patientFile/conslnum/"/>	

<xforms:instance id="consl-num" xmlns="">
            <data>
                <consl/>
		<consl-id/>
		<tagname/>
            </data>
</xforms:instance>
<xforms:instance id="status-info" src="/rest/patientFile/savestatus/" xmlns=""/>

<xforms:instance id="modified-tag" xmlns="">
      <data>
	  <value/>
      </data>
</xforms:instance>
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to reload all instances in a model on submit

Erik Bruchez
Administrator
By "reload", what do you mean exactly?

XForms has an <xforms:reset> action, which we unfortunately don't implement yet, but which is meant to reset instances to the point where xforms-ready is dispatched.

Other than that, for status-info, you could create a submission that reloads from rest/patientFile/savestatus/.

For modified-tag, you could create a separate empty template instance your model, then copy from that when you want to restore the instance to its original state, or just blank its values, or create an external instance on disk and use a submission to reload it.

-Erik

On Wed, Mar 9, 2011 at 9:55 PM, lakshmipmandava <[hidden email]> wrote:
Sample code from the model
<xforms:submission  id="consl-submit" ref="instance('consl-num')" method="post" replace="instance"
                        action="/rest/patientFile/conslnum/"/>	

<xforms:instance id="consl-num" xmlns="">
            <data>
                <consl/>
		<consl-id/>
		<tagname/>
            </data>
</xforms:instance>
<xforms:instance id="status-info" src="/rest/patientFile/savestatus/" xmlns=""/>

<xforms:instance id="modified-tag" xmlns="">
      <data>
	  <value/>
      </data>
</xforms:instance>


View this message in context: Re: How to reload all instances in a model on submit

Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.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
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to reload all instances in a model on submit

lakshmipmandava
- I am making some changes in a page and clicking on submit.
- This submit action will call a rest service which will check if there is any conflict.
- If two users user1 and user2 are making changes in the same page, user1 clicks save first and later user2, then i need to intimate user2 that document is modified, reload instance, modify and then save.
The "status-info" instance can capture if document is modified and intimate by reading a log file. This is what i meant by "Reload" instance on click of save