In tap3, you could use the
ValidField
and give it a double (or something else) validator...

Here's the code (for the .jwc):

   <bean name="double"
       class="org.apache.tapestry.valid.NumberValidator"
       lifecycle="page">
<set-property name="valueTypeClass" expression="@[EMAIL PROTECTED]"/> <set-property name="required" expression="false"/> <set-property name="clientScriptingEnabled" expression="true"/>
   </bean>

   <component id="inputDiameter" type="ValidField">
       <message-binding name="displayName" key="diameterLabel"/>
       <binding name="value" expression="monument.diameter"/>
       <binding name="validator" expression="beans.double"/>
   </component>

Peter Ertl wrote:

The main startup time seems to be taken by Hivemind.

Despite that my Jetty-based startup takes about 4 seconds
on a 3GHz machine. the first load of a page (loading of tapestry libraries and services) takes another 7 seconds.

The thing I miss most is a java problem: dynamic class reloading (HotSwap sucks badly). This makes me look at Ruby on Rails enviously.

Spindle support is missing not so much when you use annotations in my opinion as the compiler is able to do
more validations in that case.


--- Ursprüngliche Nachricht ---
Von: Schulte Marcus <[EMAIL PROTECTED]>
An: 'Tapestry users' <[email protected]>
Betreff: RE: Editing int/Integer in a TextField component
Datum: Thu, 29 Sep 2005 17:17:22 +0200

Yes, I see that. What prevents me from moving right now is mainly the lack
of spindle-support and the migration-expenses and (somewhat) the
reportedly
slow startup in dev.

-----Original Message-----
From: Peter Ertl [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 29, 2005 5:15 PM
To: Tapestry users
Subject: RE: Editing int/Integer in a TextField component


You should take a look at @TextField in T4. It got a _lot_ better.
especially you can now specify a numeric format pattern.

e.g.

<input type="text" jwcid="testInputField" displayName="Wert"
translator="translator:number, pattern=0.00"
validators="validators:required, maxLength=10" />



--- Ursprüngliche Nachricht ---
Von: Schulte Marcus <[EMAIL PROTECTED]>
An: 'Tapestry users' <[email protected]>
Betreff: RE: Editing int/Integer in a TextField component
Datum: Thu, 29 Sep 2005 17:05:32 +0200

I use @contrib:NumericField for numbers - that's anyway
nicer - for checks
and such

Marcus

-----Original Message-----
From: Inge Solvoll [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 29, 2005 4:48 PM
To: Tapestry users
Subject: Editing int/Integer in a TextField component


For T3

I have run into a problem I didn't except to run into.

I have an object with a property of type int, which I would like to edit in a TextField on my page. But I get the following error:

"Parameter value (2) is an instance of java.lang.Integer, which does not inherit from java.lang.String."

Is there a solution for this, or do I have to provide a
new field of
type String, that I convert myself? I would not like to do this, since it would force me into a less clean solution.

Inge


---------------------------------------------------------------------
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]

---------------------------------------------------------------------
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]

Reply via email to