Copying text from one textarea to another

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

Copying text from one textarea to another

ilango_g
Hi
I have a textarea, labelled "Source" in which I enter some text (say Hello World). I have another textarea below it, labelled "Destination". My objective is to copy text from Source to Destination by clicking on a Button (labelled "Same as Above") that is placed  beside Destination. Doing this will cause Hello World to appear in Destination.

What is the best way to do it? I can come up with xforms:insert only at this point of time.

Reply | Threaded
Open this post in threaded view
|

Re: Copying text from one textarea to another

fl.schmitt
Hi XGuy,

> What is the best way to do it? I can come up with xforms:insert only at this
> point of time.

That's a task for the xforms:setvalue element [1], i think. I've attached a very
simple example page to test in the xforms sandbox that demonstrates copying data
from one element to another. xforms:insert is useful if you want to insert "new
entries into a homogenous collection" [2].

HTH
florian

[1] http://www.w3.org/TR/2007/REC-xforms-20071029/#action-setvalue
[2] http://www.w3.org/TR/2007/REC-xforms-20071029/#action-insert


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

copy-test.xhtml (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Copying text from one textarea to another

ilango_g
It worked great. One of the things I was doing wrong was to put an index[] as follows:



fs(gmx) wrote
Hi XGuy,

> What is the best way to do it? I can come up with xforms:insert only at this
> point of time.

That's a task for the xforms:setvalue element [1], i think. I've attached a very
simple example page to test in the xforms sandbox that demonstrates copying data
from one element to another. xforms:insert is useful if you want to insert "new
entries into a homogenous collection" [2].

HTH
florian

[1] http://www.w3.org/TR/2007/REC-xforms-20071029/#action-setvalue
[2] http://www.w3.org/TR/2007/REC-xforms-20071029/#action-insert

 

--
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
Reply | Threaded
Open this post in threaded view
|

RE: Copying text from one textarea to another

Rick Geneva
I tried modifying the example for copying text between two fields so
that it works between two instances and I'm not having any luck.   I've
been at it for hours and it's time to ask for help :-)   I copied my
example into the attached file.   There are now two instances "data1"
and "data2".   The desired result is to have a trigger copy from

"instance('data1')/data/source"   to
"instance('data2')/data/destination"

The syntax I was trying to use is as follows:

<xforms:setvalue ev:event="DOMActivate"
ref="instance('data1')/data/destination"
value="instance('data1')/data/source" />



The model definition:
<xforms:model id="main-model">
        <xforms:instance id="data1">
                <data xmlns="">
                        <source />
                        <destination />
                </data>
        </xforms:instance>
       
        <xforms:instance id="data2">
                <data xmlns="">
                        <source />
                        <destination />
                </data>
        </xforms:instance>
</xforms:model>


The result I'm getting is nothing.  It doesn't appear to do anything at
all.    What am I missing?


Thanks!
- Rick

-----Original Message-----
From: XGuy [mailto:[hidden email]]
Sent: Sunday, December 16, 2007 7:08 PM
To: [hidden email]
Subject: Re: [ops-users] Copying text from one textarea to another


It worked great. One of the things I was doing wrong was to put an
index[] as
follows:
<!--<xforms:setvalue
ref="instance('taskinput')/fe:A_Loc_Textarea[index('A_Loc_Textarea')]"
value="instance('taskinput')/fe:C_Inc_Loc_Textarea" />-->



fs(gmx) wrote:
>
> Hi XGuy,
>
>> What is the best way to do it? I can come up with xforms:insert only
>> at this point of time.
>
> That's a task for the xforms:setvalue element [1], i think. I've
> attached a very simple example page to test in the xforms sandbox that

> demonstrates copying data from one element to another. xforms:insert
> is useful if you want to insert "new entries into a homogenous
> collection" [2].
>
> HTH
> florian
>
> [1] http://www.w3.org/TR/2007/REC-xforms-20071029/#action-setvalue
> [2] http://www.w3.org/TR/2007/REC-xforms-20071029/#action-insert
>
>  
>
> --
> 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 this message in context:
http://www.nabble.com/Copying-text-from-one-textarea-to-another-tp143386
56p14368177.html
Sent from the ObjectWeb 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

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

Re: Copying text from one textarea to another

David McIntyre
Hi Rick,

I think the problem you have is that the instance() expression does not point to the <instance> node but to the root of the XML document the instance contains.  In other words, with the instance
        <xforms:instance id="data1">
                <data xmlns="">
                        <source />
                        <destination />
                </data>
        </xforms:instance>
the expression instance('data1') refers to the <data> node, not the <instance> node.

So, what you need is
<xforms:setvalue ev:event="DOMActivate"
ref="instance('data1')/destination"
value="instance('data1')/source" />

Cheers,

Dave Mc
----- Original Message -----
From: "Rick Geneva" <[hidden email]>
To: [hidden email]
Cc: [hidden email]
Sent: 30 December 2007 05:52:35 o'clock (GMT+1200) Auto-Detected
Subject: RE: [ops-users] Copying text from one textarea to another

I tried modifying the example for copying text between two fields so
that it works between two instances and I'm not having any luck.   I've
been at it for hours and it's time to ask for help :-)   I copied my
example into the attached file.   There are now two instances "data1"
and "data2".   The desired result is to have a trigger copy from

"instance('data1')/data/source"   to
"instance('data2')/data/destination"

The syntax I was trying to use is as follows:

<xforms:setvalue ev:event="DOMActivate"
ref="instance('data1')/data/destination"
value="instance('data1')/data/source" />



The model definition:
<xforms:model id="main-model">
        <xforms:instance id="data1">
                <data xmlns="">
                        <source />
                        <destination />
                </data>
        </xforms:instance>
       
        <xforms:instance id="data2">
                <data xmlns="">
                        <source />
                        <destination />
                </data>
        </xforms:instance>
</xforms:model>


The result I'm getting is nothing.  It doesn't appear to do anything at
all.    What am I missing?


Thanks!
- Rick

-----Original Message-----
From: XGuy [mailto:[hidden email]]
Sent: Sunday, December 16, 2007 7:08 PM
To: [hidden email]
Subject: Re: [ops-users] Copying text from one textarea to another


It worked great. One of the things I was doing wrong was to put an
index[] as
follows:
<!--<xforms:setvalue
ref="instance('taskinput')/fe:A_Loc_Textarea[index('A_Loc_Textarea')]"
value="instance('taskinput')/fe:C_Inc_Loc_Textarea" />-->



fs(gmx) wrote:
>
> Hi XGuy,
>
>> What is the best way to do it? I can come up with xforms:insert only
>> at this point of time.
>
> That's a task for the xforms:setvalue element [1], i think. I've
> attached a very simple example page to test in the xforms sandbox that

> demonstrates copying data from one element to another. xforms:insert
> is useful if you want to insert "new entries into a homogenous
> collection" [2].
>
> HTH
> florian
>
> [1] http://www.w3.org/TR/2007/REC-xforms-20071029/#action-setvalue
> [2] http://www.w3.org/TR/2007/REC-xforms-20071029/#action-insert
>
>  
>
> --
> 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 this message in context:
http://www.nabble.com/Copying-text-from-one-textarea-to-another-tp143386
56p14368177.html
Sent from the ObjectWeb 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
Reply | Threaded
Open this post in threaded view
|

accessing controls inside repeat table through javascript

Jency Thomas

Hi,

I have a textbox inside a repeat table with an id as:

<xforms:input ref="//name" id="stxname" />

On a button click(Button is also inside the repeat table), I need to get access the input control through javascript. I used the following code:

<xxforms:script>
var var1=ORBEON.xforms.Document.getValue("stxname");
alert(var1);
</xxforms:script>

But this code does not return the value of the input control. I checked the view source and found that there is an input control with id as stxname.1 but when I try to access the input control using this id, Orbeon throws error saying 'element has no properties'. From the error, I assume that, such  a control does not exist. But how do we access the controls inside the repeat table?

Please help.

Thanks in advance
Jency



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

winmail.dat (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

doubt in xslt

Jency Thomas

Hi,

In my xslt, I have a statement as
<xsl:variable name="repeatid" select="ancestor::xforms:repeat/@id"></xsl:variable>

This will return an array of string with 2 strings say, a and b.
From this, I need to construct the following string in a variable:
The resultant string should be "concat(index('a'),'.',index('b'))"

Please help me in doing this. I'm not so good in xslt.

Thanks in advance
Jency


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

winmail.dat (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: doubt in xslt

Erik Bruchez-3
Jency,

You should be able to write in XPath 2.0:

   string-join(ancestor::xforms:repeat/@id, '.')

-Erik

On Jan 3, 2008, at 2:49 PM, Jency Thomas wrote:

>
> Hi,
>
> In my xslt, I have a statement as
> <xsl:variable name="repeatid" select="ancestor::xforms:repeat/@id"></
> xsl:variable>
>
> This will return an array of string with 2 strings say, a and b.
> From this, I need to construct the following string in a variable:
> The resultant string should be "concat(index('a'),'.',index('b'))"
>
> Please help me in doing this. I'm not so good in xslt.
>
> Thanks in advance
> Jency
> <winmail.dat>
> --
> 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
--
Erik Bruchez's Ponderings
http://erik.bruchez.name/



--
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: doubt in xslt

Jency Thomas

Hi Erik,

 string-join(ancestor::xforms:repeat/@id, '.') will result in "a.b" . But I need the resultant string as
"concat(index(''RiskDetails''),''.'',index(''RiskItem''))".

Please help

Thanks in advance
Jency

-----Original Message-----
From: Erik Bruchez [mailto:[hidden email]]
Sent: Fri 1/4/2008 1:42 AM
To: [hidden email]
Subject: Re: [ops-users] doubt in xslt
 
Jency,

You should be able to write in XPath 2.0:

   string-join(ancestor::xforms:repeat/@id, '.')

-Erik

On Jan 3, 2008, at 2:49 PM, Jency Thomas wrote:

>
> Hi,
>
> In my xslt, I have a statement as
> <xsl:variable name="repeatid" select="ancestor::xforms:repeat/@id"></
> xsl:variable>
>
> This will return an array of string with 2 strings say, a and b.
> From this, I need to construct the following string in a variable:
> The resultant string should be "concat(index('a'),'.',index('b'))"
>
> Please help me in doing this. I'm not so good in xslt.
>
> Thanks in advance
> Jency
> <winmail.dat>
> --
> 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
--
Erik Bruchez's Ponderings
http://erik.bruchez.name/




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

winmail.dat (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: accessing controls inside repeat table through javascript

Jency Thomas
In reply to this post by Jency Thomas


Please help me in solving the below issue.

Thanks in advance
Jency
-----Original Message-----
From: Jency Thomas [mailto:[hidden email]]
Sent: Thu 1/3/2008 11:38 AM
To: [hidden email]
Subject: accessing controls inside repeat table through javascript
 

Hi,

I have a textbox inside a repeat table with an id as:

<xforms:input ref="//name" id="stxname" />

On a button click(Button is also inside the repeat table), I need to get access the input control through javascript. I used the following code:

<xxforms:script>
var var1=ORBEON.xforms.Document.getValue("stxname");
alert(var1);
</xxforms:script>

But this code does not return the value of the input control. I checked the view source and found that there is an input control with id as stxname.1 but when I try to access the input control using this id, Orbeon throws error saying 'element has no properties'. From the error, I assume that, such  a control does not exist. But how do we access the controls inside the repeat table?

Please help.

Thanks in advance
Jency




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

winmail.dat (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Copying text from one textarea to another

ilango_g
In reply to this post by Rick Geneva
Hi Rick
Did you get it to work? Sorry about the late reply.


Rick Geneva wrote
I tried modifying the example for copying text between two fields so
that it works between two instances and I'm not having any luck.   I've
been at it for hours and it's time to ask for help :-)   I copied my
example into the attached file.   There are now two instances "data1"
and "data2".   The desired result is to have a trigger copy from

"instance('data1')/data/source"   to
"instance('data2')/data/destination"

The syntax I was trying to use is as follows:

<xforms:setvalue ev:event="DOMActivate"
ref="instance('data1')/data/destination"
value="instance('data1')/data/source" />



The model definition:
<xforms:model id="main-model">
        <xforms:instance id="data1">
                <data xmlns="">
                        <source />
                        <destination />
                </data>
        </xforms:instance>
       
        <xforms:instance id="data2">
                <data xmlns="">
                        <source />
                        <destination />
                </data>
        </xforms:instance>
</xforms:model>


The result I'm getting is nothing.  It doesn't appear to do anything at
all.    What am I missing?


Thanks!
- Rick

-----Original Message-----
From: XGuy [mailto:ilangocal@yahoo.com]
Sent: Sunday, December 16, 2007 7:08 PM
To: ops-users@ow2.org
Subject: Re: [ops-users] Copying text from one textarea to another


It worked great. One of the things I was doing wrong was to put an
index[] as
follows:




fs(gmx) wrote:
>
> Hi XGuy,
>
>> What is the best way to do it? I can come up with xforms:insert only
>> at this point of time.
>
> That's a task for the xforms:setvalue element [1], i think. I've
> attached a very simple example page to test in the xforms sandbox that

> demonstrates copying data from one element to another. xforms:insert
> is useful if you want to insert "new entries into a homogenous
> collection" [2].
>
> HTH
> florian
>
> [1] http://www.w3.org/TR/2007/REC-xforms-20071029/#action-setvalue
> [2] http://www.w3.org/TR/2007/REC-xforms-20071029/#action-insert
>
>  
>
> --
> 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
>
>

--
View this message in context:
http://www.nabble.com/Copying-text-from-one-textarea-to-another-tp143386
56p14368177.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.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