You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by caarney <cr...@centrum.cz> on 2007/12/06 17:29:50 UTC

Tapestry EventListener doesn't seem to submit form

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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry EventListener doesn't seem to submit form

Posted by caarney <cr...@centrum.cz>.
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="isin@TextField" 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="isinComponentID@TextField" 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="recordName@TextField" 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 <cr...@centrum.cz> 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: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> 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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry EventListener doesn't seem to submit form

Posted by caarney <cr...@centrum.cz>.
Thanks a lot, it works.

Maybe this information should be added to @EventListener documentation
(difference between targets and elements parameters).



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="recordName@TextField" 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 <cr...@centrum.cz> 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: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> 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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tapestry-EventListener-doesn%27t-seem-to-submit-form-tf4957057.html#a14209772
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: Tapestry EventListener doesn't seem to submit form

Posted by Jesse Kuhnert <jk...@gmail.com>.
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="recordName@TextField" 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 <cr...@centrum.cz> 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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T3: Type Block

Posted by James Sherwood <js...@rgisolutions.com>.
Actually, is there just a way to have a service render a page and then I 
could just return the html?

--James

----- Original Message ----- 
From: "James Sherwood" <js...@rgisolutions.com>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Thursday, December 06, 2007 12:51 PM
Subject: [Spam Rating:3.20] T3: Type Block


> Hello,
>
> I am trying to make a portal page with DIVs and ajax to fill the html in 
> them.
>
> The problem that I am running into is that currently it just puts out the 
> portlets using the type Block
> then tapestry renders the blocks when the page loads and I cant figure out 
> how to do this without reloading a page.
>
> Basically I want to call a URL(service) and have it return the html of a 
> rendered block then just fill the DIV with it.
>
> Is this possible?
>
> --James
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> __________ NOD32 2706 (20071206) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>
> 


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


T3: Type Block

Posted by James Sherwood <js...@rgisolutions.com>.
Hello,

I am trying to make a portal page with DIVs and ajax to fill the html in 
them.

The problem that I am running into is that currently it just puts out the 
portlets using the type Block
then tapestry renders the blocks when the page loads and I cant figure out 
how to do this without reloading a page.

Basically I want to call a URL(service) and have it return the html of a 
rendered block then just fill the DIV with it.

Is this possible?

--James 


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