Advantage of tapestry 3 is that you can use spindle, which makes things
much easier to begin with.
The advantage of 4 is, among many others, a much better validation
implementation.
If you can live without spindle you should use 4, since it is de facto
state of the art, also if it is not final yet.
As to your question - I would think the problem you are having is when
you try to use "form" parameter -
let the ValidField handle that.
There are some difficulties in tapestry 3 with parameter direction
(choosing the right one...)
In tapestry 4 parameters "just work".
Cheers,
Ron
ציטוט Fabiano Choueiri:
No, this type of code is easer in Tapestry 4 ? Which are the advantages
?
I dont know Tapestry 4.
-----Mensagem original-----
De: news [mailto:[EMAIL PROTECTED] Em nome de Ron Piterman
Enviada em: quarta-feira, 9 de novembro de 2005 08:15
Para: [email protected]
Assunto: Re: Begginer in a bad day. Help.
Is there a reason why you start with tapestry 3 ?
ציטוט Fabiano Choueiri:
Hi, i am facing a little problem here.
I've made a component that represents a ValidField to let the user
enters a month of the year ( numbers between 1 and 12 ).
Take a look, i put a comment where its necessary
My jwc file.
<component-specification allow-body="no" allow-informal-parameters="no"
<parameter name="required" direction="in" required="yes"
type="boolean"/>
<parameter name="value" direction="form" required="yes"
type="java.lang.Integer"/>
<parameter name="displayName" direction="in"
default-value='"Month"' required="no" type="java.lang.String"/>
<bean name="validator"
class="org.apache.tapestry.valid.NumberValidator" lifecycle="page">
<set-property name="required" expression="required"/>
<set-property name="valueType"
expression='"java.lang.Short"'/>
<set-property name="minimum" expression="1"/>
<set-property name="maximum" expression="12"/>
<set-property name="numberTooSmallMessage"
expression='"Minimum is : 1"'/>
<set-property name="numberTooLargeMessage"
expression='"Maximum is : 12"'/>
</bean>
<component id="month" type="ValidField">
<binding name="value" expression="value"/> --> this is the
parameter named value
<binding name="validator" expression="beans.validator"/> -->
this is the validator named validator.
<binding name="displayName" expression="displayName"/> --> this
is the paramenter named displayName.
</component>
</component-specification>
My html file.
<td><input jwcid="@FieldLabel" field="ognl:components.month"/></td>
<td ><input jwcid="month"/> </td>
In another html file I've write a code like this :
<span jwcid=mymonth <mailto:[EMAIL PROTECTED]:MyMonthConponent>
@MyLib:MyMonthConponent required="false" value="ognl:myobject.month"/>
--> myobject.month is a atribute (Integer) from a domain object.
Here is the error I am having when submitting the form
java.lang.ClassCastException
Stack Trace:
*
org.apache.tapestry.param.AbstractParameterConnector.resetParameter(Ab
st
ractParameterConnector.java:148)
*
org.apache.tapestry.param.ParameterManager.resetParameters(ParameterMa
na
ger.java:124)
*
org.apache.tapestry.AbstractComponent.cleanupAfterRender(AbstractCompo
ne
nt.java:932)
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]