On Wed, 28 Sep 2011 14:46:00 -0300, Vasyl Shevchuk <vasyl.shevc...@devcom.com> wrote:

Hello, Thiago!

Hi!

But, could you please explain this part more detailed
"Your TextField should be bound to some property. Can't you read this
property directly?"

TextFields edits properties of type String. In your case, it's bound to the applyCouponCodeValue property. As you're inside the processSubmission() method, you should get the submitted value from the request itself, as the TextField's processSubmission() may not be invoked yet. I always avoided writing form field components with form field components in their template. It's easy to create a form field component with multiple HTML form fields inside.

I have this on template now (using @Component)

<input t:id="applyCouponCode" name="applyCouponCode" size="17"
value="applyCouponCodeValue" class="stxt"/>

Ah, I haven't noticed that you didn't use t:type in your template, so you need to use @Component instead of @InjectComponent. Your code was and is right. :)

And will have the folllowing if I'll not use @Component annotation

<t:textfield t:id="applyCouponCode" name="applyCouponCode" size="17"
value="applyCouponCodeValue" class="stxt" />

Yep, or, my preference, <input type="text" t:type="TextField" t:id="applyCouponCode" name="applyCouponCode" size="17" value="applyCouponCodeValue" class="stxt" />

How can I read property directly?

getApplyCouponCodeValue(). :)

Cheers!

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to