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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]