You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kristian Marinkovic <kr...@porsche.co.at> on 2007/01/23 10:27:19 UTC
LinkSubmit and null parameters
hi all,
i just noticed that if an LinkSubmit component with a parameters binding
to a TextField causes an exception (on submit) if that input field remains
empty (null). The reason is that the listener bound to the LinkSubmit
requires
exactly one parameter. And if the TextField remains empty Tapestry tries
to resolve a listener with no parameters that does not exist. This
exception
happens even if the TextField has a required validator assigned to.
Is that an expected behaviour?
<component id="lnk_read" type="LinkSubmit">
<binding name="listener" value="listener:readGPList" />
<binding name="parameters" value="searchFieldValue" />
</component>
<component id="txtSearchField" type="TextField">
<binding name="value" value="searchFieldValue" />
<binding name="validators" value="validators:required,min=2" />
</component>
<property name="searchFieldValue" />
g,
kris
P.S. i'm using Tapestry 4.1.2
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: LinkSubmit and null parameters
Posted by andyhot <an...@di.uoa.gr>.
ok, i see the point now... TAPESTRY-1240is indeed valid - sorry for
my misunderstanding and questionings :)
Kristian Marinkovic wrote:
> this where my considerations:
>
> - i have a listener with useful parameter names/types
> - i do not have to define any abstract properties thus keeping
> my controller class simpler and cleaner (.. and less code in .page :))
>
>
>
>
>
> andyhot
> <andyhot@di.uoa.g
> r> An
> Gesendet von: Tapestry users
> andreas a <us...@tapestry.apache.org>
> <andreoua@gmail.c Kopie
> om>
> Thema
> Re: LinkSubmit and null parameters
> 06.02.2007 11:27
>
>
> Bitte antworten
> an
> "Tapestry users"
> <users@tapestry.a
> pache.org>
>
>
>
>
>
>
> ok, let's see...
> if you have a form that includes a (validated) TextField,
> and a LinkSubmit for that form, why use a parameter?
>
> Kristian Marinkovic wrote:
>
>> i will try as you propose :)
>>
>> but what bothers me is that i have a validator applied to the TextField.
>> Shouldn't Tapestry check the validators before it proceeds to execute
>> the listeners?
>>
>> I'm must admit, i'm not aware at which point of the request processing
>> lifecycle validation is done. i was always expecting validators are
>> always evalutated before anything else.
>>
>> can you give me some hints/clarifications?
>>
>> g,
>> kris
>>
>>
>>
>>
>>
>
>
>> andyhot
>>
>
>
>> <andyhot@di.uoa.g
>>
>
>
>> r>
>>
> An
>
>> Gesendet von: Tapestry users
>>
>
>
>> andreas a <us...@tapestry.apache.org>
>>
>
>
>> <andreoua@gmail.c
>>
> Kopie
>
>> om>
>>
>
>
> Thema
>
>> Re: LinkSubmit and null
>>
> parameters
>
>> 06.02.2007 10:48
>>
>
>
>
>
>
>
>> Bitte antworten
>>
>
>
>> an
>>
>
>
>> "Tapestry users"
>>
>
>
>> <users@tapestry.a
>>
>
>
>> pache.org>
>>
>
>
>
>
>
>
>>
>>
>> The parameter of your LinkSumbit will always by null
>> because when the link is constructed (at render time) that's what
>> the value of searchFieldValue is.
>>
>> Now regarding listeners and null values, I think it was discussed
>> a year ago and that this behaviour is the expected one.
>> If you want to be able to check for nulls, you can:
>> - Make the method accept the RequestCycle parameter and use that to get
>> the parameters
>> - or, use <binding name="parameters" value="{searchFieldValue}" /> (it
>> should work)
>>
>> So, i feel that TAPESTRY-1240 is invalid
>>
>>
>> Kristian Marinkovic wrote:
>>
>>
>>> hi all,
>>>
>>> i just noticed that if an LinkSubmit component with a parameters binding
>>> to a TextField causes an exception (on submit) if that input field
>>>
>>>
>> remains
>>
>>
>>> empty (null). The reason is that the listener bound to the LinkSubmit
>>> requires
>>> exactly one parameter. And if the TextField remains empty Tapestry tries
>>> to resolve a listener with no parameters that does not exist. This
>>> exception
>>> happens even if the TextField has a required validator assigned to.
>>>
>>> Is that an expected behaviour?
>>>
>>>
>>> <component id="lnk_read" type="LinkSubmit">
>>> <binding name="listener" value="listener:readGPList" />
>>> <binding name="parameters" value="searchFieldValue" />
>>> </component>
>>>
>>> <component id="txtSearchField" type="TextField">
>>> <binding name="value" value="searchFieldValue" />
>>> <binding name="validators" value="validators:required,min=2" />
>>> </component>
>>>
>>> <property name="searchFieldValue" />
>>>
>>>
>>> g,
>>> kris
>>>
>>> P.S. i'm using Tapestry 4.1.2
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>>
>>>
>> --
>> Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
>> Tapestry / Tacos developer
>> Open Source / J2EE Consulting
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>>
>
>
> --
> Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
> Tapestry / Tacos developer
> Open Source / J2EE Consulting
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: Re: LinkSubmit and null parameters
Posted by Kristian Marinkovic <kr...@porsche.co.at>.
this where my considerations:
- i have a listener with useful parameter names/types
- i do not have to define any abstract properties thus keeping
my controller class simpler and cleaner (.. and less code in .page :))
andyhot
<andyhot@di.uoa.g
r> An
Gesendet von: Tapestry users
andreas a <us...@tapestry.apache.org>
<andreoua@gmail.c Kopie
om>
Thema
Re: LinkSubmit and null parameters
06.02.2007 11:27
Bitte antworten
an
"Tapestry users"
<users@tapestry.a
pache.org>
ok, let's see...
if you have a form that includes a (validated) TextField,
and a LinkSubmit for that form, why use a parameter?
Kristian Marinkovic wrote:
> i will try as you propose :)
>
> but what bothers me is that i have a validator applied to the TextField.
> Shouldn't Tapestry check the validators before it proceeds to execute
> the listeners?
>
> I'm must admit, i'm not aware at which point of the request processing
> lifecycle validation is done. i was always expecting validators are
> always evalutated before anything else.
>
> can you give me some hints/clarifications?
>
> g,
> kris
>
>
>
>
> andyhot
> <andyhot@di.uoa.g
> r>
An
> Gesendet von: Tapestry users
> andreas a <us...@tapestry.apache.org>
> <andreoua@gmail.c
Kopie
> om>
>
Thema
> Re: LinkSubmit and null
parameters
> 06.02.2007 10:48
>
>
> Bitte antworten
> an
> "Tapestry users"
> <users@tapestry.a
> pache.org>
>
>
>
>
>
>
> The parameter of your LinkSumbit will always by null
> because when the link is constructed (at render time) that's what
> the value of searchFieldValue is.
>
> Now regarding listeners and null values, I think it was discussed
> a year ago and that this behaviour is the expected one.
> If you want to be able to check for nulls, you can:
> - Make the method accept the RequestCycle parameter and use that to get
> the parameters
> - or, use <binding name="parameters" value="{searchFieldValue}" /> (it
> should work)
>
> So, i feel that TAPESTRY-1240 is invalid
>
>
> Kristian Marinkovic wrote:
>
>> hi all,
>>
>> i just noticed that if an LinkSubmit component with a parameters binding
>> to a TextField causes an exception (on submit) if that input field
>>
> remains
>
>> empty (null). The reason is that the listener bound to the LinkSubmit
>> requires
>> exactly one parameter. And if the TextField remains empty Tapestry tries
>> to resolve a listener with no parameters that does not exist. This
>> exception
>> happens even if the TextField has a required validator assigned to.
>>
>> Is that an expected behaviour?
>>
>>
>> <component id="lnk_read" type="LinkSubmit">
>> <binding name="listener" value="listener:readGPList" />
>> <binding name="parameters" value="searchFieldValue" />
>> </component>
>>
>> <component id="txtSearchField" type="TextField">
>> <binding name="value" value="searchFieldValue" />
>> <binding name="validators" value="validators:required,min=2" />
>> </component>
>>
>> <property name="searchFieldValue" />
>>
>>
>> g,
>> kris
>>
>> P.S. i'm using Tapestry 4.1.2
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>>
>
>
> --
> Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
> Tapestry / Tacos developer
> Open Source / J2EE Consulting
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: LinkSubmit and null parameters
Posted by andyhot <an...@di.uoa.gr>.
ok, let's see...
if you have a form that includes a (validated) TextField,
and a LinkSubmit for that form, why use a parameter?
Kristian Marinkovic wrote:
> i will try as you propose :)
>
> but what bothers me is that i have a validator applied to the TextField.
> Shouldn't Tapestry check the validators before it proceeds to execute
> the listeners?
>
> I'm must admit, i'm not aware at which point of the request processing
> lifecycle validation is done. i was always expecting validators are
> always evalutated before anything else.
>
> can you give me some hints/clarifications?
>
> g,
> kris
>
>
>
>
> andyhot
> <andyhot@di.uoa.g
> r> An
> Gesendet von: Tapestry users
> andreas a <us...@tapestry.apache.org>
> <andreoua@gmail.c Kopie
> om>
> Thema
> Re: LinkSubmit and null parameters
> 06.02.2007 10:48
>
>
> Bitte antworten
> an
> "Tapestry users"
> <users@tapestry.a
> pache.org>
>
>
>
>
>
>
> The parameter of your LinkSumbit will always by null
> because when the link is constructed (at render time) that's what
> the value of searchFieldValue is.
>
> Now regarding listeners and null values, I think it was discussed
> a year ago and that this behaviour is the expected one.
> If you want to be able to check for nulls, you can:
> - Make the method accept the RequestCycle parameter and use that to get
> the parameters
> - or, use <binding name="parameters" value="{searchFieldValue}" /> (it
> should work)
>
> So, i feel that TAPESTRY-1240 is invalid
>
>
> Kristian Marinkovic wrote:
>
>> hi all,
>>
>> i just noticed that if an LinkSubmit component with a parameters binding
>> to a TextField causes an exception (on submit) if that input field
>>
> remains
>
>> empty (null). The reason is that the listener bound to the LinkSubmit
>> requires
>> exactly one parameter. And if the TextField remains empty Tapestry tries
>> to resolve a listener with no parameters that does not exist. This
>> exception
>> happens even if the TextField has a required validator assigned to.
>>
>> Is that an expected behaviour?
>>
>>
>> <component id="lnk_read" type="LinkSubmit">
>> <binding name="listener" value="listener:readGPList" />
>> <binding name="parameters" value="searchFieldValue" />
>> </component>
>>
>> <component id="txtSearchField" type="TextField">
>> <binding name="value" value="searchFieldValue" />
>> <binding name="validators" value="validators:required,min=2" />
>> </component>
>>
>> <property name="searchFieldValue" />
>>
>>
>> g,
>> kris
>>
>> P.S. i'm using Tapestry 4.1.2
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>>
>
>
> --
> Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
> Tapestry / Tacos developer
> Open Source / J2EE Consulting
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Re: LinkSubmit and null parameters
Posted by Kristian Marinkovic <kr...@porsche.co.at>.
i will try as you propose :)
but what bothers me is that i have a validator applied to the TextField.
Shouldn't Tapestry check the validators before it proceeds to execute
the listeners?
I'm must admit, i'm not aware at which point of the request processing
lifecycle validation is done. i was always expecting validators are
always evalutated before anything else.
can you give me some hints/clarifications?
g,
kris
andyhot
<andyhot@di.uoa.g
r> An
Gesendet von: Tapestry users
andreas a <us...@tapestry.apache.org>
<andreoua@gmail.c Kopie
om>
Thema
Re: LinkSubmit and null parameters
06.02.2007 10:48
Bitte antworten
an
"Tapestry users"
<users@tapestry.a
pache.org>
The parameter of your LinkSumbit will always by null
because when the link is constructed (at render time) that's what
the value of searchFieldValue is.
Now regarding listeners and null values, I think it was discussed
a year ago and that this behaviour is the expected one.
If you want to be able to check for nulls, you can:
- Make the method accept the RequestCycle parameter and use that to get
the parameters
- or, use <binding name="parameters" value="{searchFieldValue}" /> (it
should work)
So, i feel that TAPESTRY-1240 is invalid
Kristian Marinkovic wrote:
> hi all,
>
> i just noticed that if an LinkSubmit component with a parameters binding
> to a TextField causes an exception (on submit) if that input field
remains
> empty (null). The reason is that the listener bound to the LinkSubmit
> requires
> exactly one parameter. And if the TextField remains empty Tapestry tries
> to resolve a listener with no parameters that does not exist. This
> exception
> happens even if the TextField has a required validator assigned to.
>
> Is that an expected behaviour?
>
>
> <component id="lnk_read" type="LinkSubmit">
> <binding name="listener" value="listener:readGPList" />
> <binding name="parameters" value="searchFieldValue" />
> </component>
>
> <component id="txtSearchField" type="TextField">
> <binding name="value" value="searchFieldValue" />
> <binding name="validators" value="validators:required,min=2" />
> </component>
>
> <property name="searchFieldValue" />
>
>
> g,
> kris
>
> P.S. i'm using Tapestry 4.1.2
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: LinkSubmit and null parameters
Posted by andyhot <an...@di.uoa.gr>.
The parameter of your LinkSumbit will always by null
because when the link is constructed (at render time) that's what
the value of searchFieldValue is.
Now regarding listeners and null values, I think it was discussed
a year ago and that this behaviour is the expected one.
If you want to be able to check for nulls, you can:
- Make the method accept the RequestCycle parameter and use that to get
the parameters
- or, use <binding name="parameters" value="{searchFieldValue}" /> (it
should work)
So, i feel that TAPESTRY-1240 is invalid
Kristian Marinkovic wrote:
> hi all,
>
> i just noticed that if an LinkSubmit component with a parameters binding
> to a TextField causes an exception (on submit) if that input field remains
> empty (null). The reason is that the listener bound to the LinkSubmit
> requires
> exactly one parameter. And if the TextField remains empty Tapestry tries
> to resolve a listener with no parameters that does not exist. This
> exception
> happens even if the TextField has a required validator assigned to.
>
> Is that an expected behaviour?
>
>
> <component id="lnk_read" type="LinkSubmit">
> <binding name="listener" value="listener:readGPList" />
> <binding name="parameters" value="searchFieldValue" />
> </component>
>
> <component id="txtSearchField" type="TextField">
> <binding name="value" value="searchFieldValue" />
> <binding name="validators" value="validators:required,min=2" />
> </component>
>
> <property name="searchFieldValue" />
>
>
> g,
> kris
>
> P.S. i'm using Tapestry 4.1.2
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: Re: LinkSubmit and null parameters
Posted by Kristian Marinkovic <kr...@porsche.co.at>.
hi jesse,
this bug is filed as
https://issues.apache.org/jira/browse/TAPESTRY-1240
greetings
kris
"Jesse Kuhnert"
<jkuhnert@gmail.c
om> An
"Tapestry users"
05.02.2007 05:30 <us...@tapestry.apache.org>
Kopie
Bitte antworten Thema
an Re: LinkSubmit and null parameters
"Tapestry users"
<users@tapestry.a
pache.org>
Sounds like a possible bug.
As with all issues, creating a JIRA issue is the best hope anyone has
of having something fixed.
On 1/23/07, Kristian Marinkovic <kr...@porsche.co.at> wrote:
>
> hi all,
>
> i just noticed that if an LinkSubmit component with a parameters binding
> to a TextField causes an exception (on submit) if that input field
remains
> empty (null). The reason is that the listener bound to the LinkSubmit
> requires
> exactly one parameter. And if the TextField remains empty Tapestry tries
> to resolve a listener with no parameters that does not exist. This
> exception
> happens even if the TextField has a required validator assigned to.
>
> Is that an expected behaviour?
>
>
> <component id="lnk_read" type="LinkSubmit">
> <binding name="listener" value="listener:readGPList" />
> <binding name="parameters" value="searchFieldValue" />
> </component>
>
> <component id="txtSearchField" type="TextField">
> <binding name="value" value="searchFieldValue" />
> <binding name="validators" value="validators:required,min=2" />
> </component>
>
> <property name="searchFieldValue" />
>
>
> g,
> kris
>
> P.S. i'm using Tapestry 4.1.2
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Jesse Kuhnert
Tapestry/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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: LinkSubmit and null parameters
Posted by Jesse Kuhnert <jk...@gmail.com>.
Sounds like a possible bug.
As with all issues, creating a JIRA issue is the best hope anyone has
of having something fixed.
On 1/23/07, Kristian Marinkovic <kr...@porsche.co.at> wrote:
>
> hi all,
>
> i just noticed that if an LinkSubmit component with a parameters binding
> to a TextField causes an exception (on submit) if that input field remains
> empty (null). The reason is that the listener bound to the LinkSubmit
> requires
> exactly one parameter. And if the TextField remains empty Tapestry tries
> to resolve a listener with no parameters that does not exist. This
> exception
> happens even if the TextField has a required validator assigned to.
>
> Is that an expected behaviour?
>
>
> <component id="lnk_read" type="LinkSubmit">
> <binding name="listener" value="listener:readGPList" />
> <binding name="parameters" value="searchFieldValue" />
> </component>
>
> <component id="txtSearchField" type="TextField">
> <binding name="value" value="searchFieldValue" />
> <binding name="validators" value="validators:required,min=2" />
> </component>
>
> <property name="searchFieldValue" />
>
>
> g,
> kris
>
> P.S. i'm using Tapestry 4.1.2
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Jesse Kuhnert
Tapestry/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