W3C home > Mailing lists > Public > www-forms@w3.org > December 2006

Re: Questions about switching orders of instance's elements.

From: Aaron Reed <aaronr@us.ibm.com>
Date: Tue, 05 Dec 2006 14:38:47 -0600
To: www-forms@w3.org
Message-ID: <el4lek$k58$1@sea.gmane.org>

Also, if you must do it today in XForms 1.0 and using JavaScript doesn't 
bother you (for example, every xforms processor that this form will run 
on supports JS) you could manipulate the instance document via JS using 
model.getInstanceDocument and a bunch of DOM calls to set up the 
instance document the way you want it, and then call model.rebuild(), 
model.recalculate(), model.revalidate() and model.refresh().  Leigh's 
server-based solution is certainly better if you are planning on using a 
variety of XForms processors, though.

--Aaron

Kisub Song wrote:
> Hi~
> 
> I have a question about XForms.
> Are there any ways to change the order of the structure of XML instances in
> XForms code?
> 
> For example,
> I want to change this instance...
> <xforms:instance id="model">
>   <R>
>     <A>...</A>
>     <B>...</B>
>     <C>...</C>
>   </R>
> </xforms:instance>
> into this form...
> <xforms:instance id="model">
>   <R>
>     <B>...</B>
>     <A>...</A>
>     <C>...</C>
>   </R>
> </xforms:instance>
> when the user presses a button or does some other action.
> ....
> As you see, the order of elements are changed, locations of A and B are
> swapped.
> How should the XForms code be made to work like it?
> 
> Plz tell me 
> 
> Kisub Song
> The Master's Course in Computer Science
> Internet Computing Laboratory at Yonsei University
> C503 Engineering Building, 134 Shinchon-Dong Seodaemoon-Gu Seoul 120-749
> South Korea
> Tel: +82-2-2123-3878
> 
> 
> 
> 
Received on Tuesday, 5 December 2006 20:50:55 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:08 GMT