You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by 孟凡振 <fa...@gmail.com> on 2008/04/24 04:39:42 UTC

t5.0.11 help in update my own components

in my component  a html <select> tag is rendered,and I want to add a onchange
envent to it.
below is some code ...

select.attribute("onchange","alert(this.options[this.selectedIndex].value);"
);

select is a element created by /*writer.element("select")*/

trigering a javascript event is ok here ..

but my problem is how to triger this component itself with onchange event.
updating itself in result

any one in warm heart could help me?
thanks in advance!!!
-- 
View this message in context: http://www.nabble.com/t5.0.11-help-in-update-my-own-components-tp16836395p16836395.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: t5.0.11 help in update my own components

Posted by Marcelo Lotif <ml...@gmail.com>.
Take a look at
http://www.nabble.com/T5%3A-Select-component-%2B-onchange%28%29-to16876151.html

2008/4/24 孟凡振 <fa...@gmail.com>:

>
> Thank u for ur warm answer,your suggestion give me some idea indeed.
> but I want to code something special.
> first, a select(A) is rendered for ready,when a onchange event is
> activated,there will be another select(B) which is a children set of some
> value in select(A) is rendered.......and it is in the same way when
> select(B)'s onchange envent is trigerd .....select(C)...........
> some structure in my table is:
> id                 name   pid    ....
> 0                   a1
> 0|1                b1       0
> 0|2                b2       0
> 0|1|3             c1       0|1
> 0|3                b3       0
> 0|2|1             c2       0|2
>
> ....................
> I have no idea do I describe my problem in detail.....but I have tryed my
> best.
>
> thank u very much!!
>
>
>
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/t5.0.11-help-in-update-my-own-components-tp16836395p16880136.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Atenciosamente,
Marcelo Lotif

Re: t5.0.11 help in update my own components

Posted by 孟凡振 <fa...@gmail.com>.
Thank u for ur warm answer,your suggestion give me some idea indeed.
but I want to code something special.
first, a select(A) is rendered for ready,when a onchange event is
activated,there will be another select(B) which is a children set of some
value in select(A) is rendered.......and it is in the same way when
select(B)'s onchange envent is trigerd .....select(C)...........
some structure in my table is:
id                 name   pid    ....
0                   a1       
0|1                b1       0
0|2                b2       0
0|1|3             c1       0|1
0|3                b3       0
0|2|1             c2       0|2

....................
I have no idea do I describe my problem in detail.....but I have tryed my
best.

thank u very much!!







-- 
View this message in context: http://www.nabble.com/t5.0.11-help-in-update-my-own-components-tp16836395p16880136.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: t5.0.11 help in update my own components

Posted by Sven Homburg <ho...@googlemail.com>.
please dont use OnChange, its deprecated.
use
http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.htmlinstead

2008/4/24, Chris Lewis <ch...@bellsouth.net>:
>
> Hi,
>
> I think what you're asking is how to attach application event handlers
> (on the server-side like void onChange()) like you would with other
> components. If I've misunderstood you, I'm sorry. You're first problem
> is how you create the select element. By manually writing a tag, you're
> not actually creating a T5 component, and therefore can't receive any
> events from it. For a proper component use select:
>
>
> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Select.html
>
> Now if you are trying to attach server side handlers to a select's
> client-side onchange event, you'll need some ajax. tapestry5-components
> provides a mixin that handles this, which you can find here:
>
>
> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnChange.html
>
> sincerely,
> chris
>
>
> 孟凡振 wrote:
> > in my component  a html <select> tag is rendered,and I want to add a
> onchange
> > envent to it.
> > below is some code ...
> >
> >
> select.attribute("onchange","alert(this.options[this.selectedIndex].value);"
> > );
> >
> > select is a element created by /*writer.element("select")*/
> >
> > trigering a javascript event is ok here ..
> >
> > but my problem is how to triger this component itself with onchange
> event.
> > updating itself in result
> >
> > any one in warm heart could help me?
> > thanks in advance!!!
> >
>
> --
>
> http://thegodcode.net
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com

Re: t5.0.11 help in update my own components

Posted by Chris Lewis <ch...@bellsouth.net>.
Hi,

I think what you're asking is how to attach application event handlers
(on the server-side like void onChange()) like you would with other
components. If I've misunderstood you, I'm sorry. You're first problem
is how you create the select element. By manually writing a tag, you're
not actually creating a T5 component, and therefore can't receive any
events from it. For a proper component use select:

http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Select.html

Now if you are trying to attach server side handlers to a select's
client-side onchange event, you'll need some ajax. tapestry5-components
provides a mixin that handles this, which you can find here:

http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnChange.html

sincerely,
chris

孟凡振 wrote:
> in my component  a html <select> tag is rendered,and I want to add a onchange
> envent to it.
> below is some code ...
>
> select.attribute("onchange","alert(this.options[this.selectedIndex].value);"
> );
>
> select is a element created by /*writer.element("select")*/
>
> trigering a javascript event is ok here ..
>
> but my problem is how to triger this component itself with onchange event.
> updating itself in result
>
> any one in warm heart could help me?
> thanks in advance!!!
>   

-- 
http://thegodcode.net


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