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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to