The problem here is that you are trying to access the component's clientId without the component being rendered (in your case from an XHR). The clientId is only accurate after the component has rendered itself. See http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/ClientElement.html
Pass the component's clientside id as a context parameter to your handler 
method.

Uli

On 26.08.2009 16:10 schrieb Bruno Santos:
Hi all,

My name is Bruno and I'm new to this mailing list and new to tapestry.

I've been banging my head hard and googling (probably been using wrong
keywords) for an answer for this, why is getClientId returning null,
isn't it suppose to return the client id? If it ain't, is there a
workaround?

Code:

    @InjectComponent
    private Select country;

        @OnEvent(component = "country", value = "change")
        public JSONObject onChangeOperatorEvent(String value) {
                ...
JSONObject finalJsonObject = new JSONObject();
                finalJsonObject.put("clientId", country.getClientId());

                return finalJsonObject;
}


-----------------

                                        <select t:type="select" t:id="country" 
encoder="countryEncoder"
model="countryModel" t:mixins="ck/OnEvent" t:event="change"
t:onCompleteCallback="handleSelectAjaxRequest"/>


------------------

I tried with textfield also, same result. I guess @InjectComponent
isn't enough. Can someone help me clarify this?

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


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

Reply via email to