I was playing with this AJAX functionality and I found some strange
behaviour. If the component id is not the same as element id, the form is
submitted, but the event listener method is not processed. Everything work
fine in this case:

        <input jwcid="[EMAIL PROTECTED]" value="ognl:isin" id="isin" />

        @EventListener(events="onchange", targets="isin") 
        public void onRefresh(IRequestCycle cycle) {
                log.debug("*** AJAX ***");
        }

But if I change the component id, the method is not called:

        <input jwcid="[EMAIL PROTECTED]" value="ognl:isin" id="isin"
/>

        @EventListener(events="onchange", targets="isinComponentID") 
        public void onRefresh(IRequestCycle cycle) {
                log.debug("*** AJAX ***");
        }

Maybe some kind of conflict between component id and DOM id ?


Jessek wrote:
> 
> Using elements="elementId" only targets and listens to dom nodes.
> You only get the majority of automated functionality (like submitting
> forms) when you target a component via
> 
> targets = "componentId"
> 
> Change your example to be:
> 
> <input jwcid="[EMAIL PROTECTED]" value="ognl:recName" id="recName"
> class="text large" type="text" />
> 
> @EventListener(events="onchange", targets = "recordName")
>        public void onRefresh(IRequestCycle cycle) {
>           log.debug(getRecName()); // this returns null (or initial value)
>        }
> 
> 
> and it should work..
> 
> p.s. Internet explorer doesn't do a very good job of reporting changes
> to textfields via the onchange event,  please see the related
> quircksmode links and warnings on the bottom of the documentation page
> for @EventListener for more on this..
> 
> On Dec 6, 2007 11:29 AM, caarney <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>> I'm using Tapestry 4.1.3 (integrated in Appfuse 2.0.1) and the
>> @EventListener functionality. The eventlistener method is called
>> correctly,
>> but I can't get any user-entered values from the form. As I understood
>> from
>> the documentation, the form should submit itself by default and send the
>> values to the server, but it doesn't work for me. I tried to use @Persist
>> annotation for the getter of the requested value, but it didn't help.
>>
>>         <input jwcid="@TextField" value="ognl:recName" id="recName"
>> class="text large" type="text" />
>>
>>         @Persist
>>         public abstract String getRecName();
>>
>>         @EventListener(events="onchange", elements="recName")
>>         public void onRefresh(IRequestCycle cycle) {
>>            log.debug(getRecName()); // this returns null (or initial
>> value)
>>         }
>>
>> I presume that the getRecName() function in the EventListener is supposed
>> to
>> return the value entered by user - is it right? Am I doing something
>> wrong?
>> Thanks
>>
>> (posted on Appfuse forum as well)
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Tapestry-EventListener-doesn%27t-seem-to-submit-form-tf4957057.html#a14195678
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> 
> -- 
> Jesse Kuhnert
> Tapestry / OGNL / Dojo team member/developer
> 
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Tapestry-EventListener-doesn%27t-seem-to-submit-form-tf4957057.html#a14213303
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to