Hello,
There is a small bug:
Description:
Using deprecated component ValidField, a validation bean
(IValidator), and enable javascript for this validator, then there is
a null pointer exception.
java.lang.NullPointerException
Stack Trace:
org.apache.tapestry.valid.BaseValidator.processValidatorScript
(BaseValidator.java:292)
org.apache.tapestry.valid.StringValidator.renderValidatorContribution
(StringValidator.java:109)
Test-Case:
--html--
<form jwcid="@Form" delegate="bean:delegate"
clientValidationEnabled="ognl:true">
<input jwcid="@ValidField" type="text" value="ognl:count"
validator="bean:requiredString" displayName="testField"/>
<input type="submit" value="Enregistrer"/>
</form>
--spec--
<bean name="requiredString"
class="org.apache.tapestry.valid.StringValidator,required,minimumLength=
10,clientScriptingEnabled">
</bean>
--java--
public String getMyName() {
System.out.println("get my name " );
return "Numa";
}
public abstract int getCount();
public abstract void setCount(int count);
Tested Solution:
Add the following lines to ValidField.java on line 90 in the method
renderComponent
//Add on 4.1, SetScriptSource was added in 4.1 but is never called,
so _scriptSource was never initialized
validator.setScriptSource(cycle.getInfrastructure().getScriptSource
());
//In case ClientValidationEnabled is set to the form set it also to
the Validator
if (getForm().isClientValidationEnabled() && validator instanceof
BaseValidator)
((BaseValidator)validator).setClientScriptingEnabled(true);
I know the component is deprecated, but still in my case I want to
migrate from 4.0 to 4.1 and I have more then 50 pages using forms
with ValidField, I don't to change all of them, but I would like to take
the advantage of 4.1 for other pages...
Regards,
Numa
Le 5 févr. 08 à 16:51, Jesse Kuhnert a écrit :
A new release has been packaged up and uploaded to the staging area at
http://people.apache.org/~jkuhnert/tapestry_releases/ . The recent
critical bug fixes and some other minor misc improvements have been
made since the last 4.1.4 release vote to ensure a quality release
this time around.
The vote will last for 3 days.
Jesse Kuhnert: +1 (binding)
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]