You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Amit <am...@coreobjects.com> on 2004/04/14 09:19:26 UTC

Java Script in tapestry

Hi ,
How do we add java script code in tapestry to refer to an element on the
screen.
For example in a regular HTML/Java Script code combination w could refer to
it as
document.forms[0].<elementName>.<property>
In the case of tapestry how do we figure out the <element Name >

Thanks
Amit



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Java Script in tapestry

Posted by Robert Zeigler <rd...@u.arizona.edu>.
Take a look at the "script" component. 

http://jakarta.apache.org/tapestry/doc/ComponentReference/Script.html


Robert

Amit wrote:

>Hi ,
>How do we add java script code in tapestry to refer to an element on the
>screen.
>For example in a regular HTML/Java Script code combination w could refer to
>it as
>document.forms[0].<elementName>.<property>
>In the case of tapestry how do we figure out the <element Name >
>
>Thanks
>Amit
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Java Script in tapestry

Posted by Programozás <pr...@hotmail.com>.
You can pass a parameter to the script holding the component instance you'd
like to reference.
Norbi

----- Original Message ----- 
From: "Amit" <am...@coreobjects.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, April 14, 2004 9:19 AM
Subject: Java Script in tapestry


> Hi ,
> How do we add java script code in tapestry to refer to an element on the
> screen.
> For example in a regular HTML/Java Script code combination w could refer
to
> it as
> document.forms[0].<elementName>.<property>
> In the case of tapestry how do we figure out the <element Name >
>
> Thanks
> Amit
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Java Script in tapestry

Posted by Bryan Lewis <br...@maine.rr.com>.
Two other possibilities:

(1)  Chapter 10 of the Tapestry book shows the use of the Script
component for a similar case, the simple referencing of a form element.

(2)  Give the form element an explicit name (e.g., jwcid="myFieldName")
for reference from javascript.  Here's a text field that can be filled
by a <select> list.

    <input jwcid="categoryField@TextField" size="15"
value="ognl:data.category"/>
    <select jwcid="@Select"
onchange="this.form.categoryField.value=this.options[this.selectedIndex]
.text">
        <span jwcid="@Foreach" source="ognl:categories"
value="ognl:currentCategory">
            <span jwcid="@Option" label="ognl:currentCategory"
selected="ognl:categorySelected"/>
        </span>
    </select>


----- Original Message ----- 
From: "Amit" <am...@coreobjects.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, April 14, 2004 3:19 AM
Subject: Java Script in tapestry


> Hi ,
> How do we add java script code in tapestry to refer to an element on
the
> screen.
> For example in a regular HTML/Java Script code combination w could
refer to
> it as
> document.forms[0].<elementName>.<property>
> In the case of tapestry how do we figure out the <element Name >
>
> Thanks
> Amit
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org