Hi to all.
I use Tapestry 5.1.0.5.
I have the following code

@Component(id = "applyCouponCode")
private TextField applyCouponCode;

private void processSubmission() {
...
        if (applyCouponParameterName != null ||
parameterNames.contains("proceedWithoutCoupon")) {
                applyCouponCodeValue = 
request.getParameter(applyCouponParameterName);

                try {
                        shoppingCartService.applyCoupon(applyCouponCodeValue);
                        shoppingCartService.validateCartState();
                } catch (ShoppingCartException e) {
                        tracker.recordError(applyCouponCode, e.getMessage() + " 
Please, enter a
different coupon code or remove coupon code to proceed.");
                }
        }
}

This component doesn't contain Form. It's located inside the form in this
way

<t:form t:id="orderForm" clientValidation="false" autofocus="false">
...
        <t:applyCoupon/>
...
</t:form>


In mentioned processSubmission method in recordError method
applyCouponCode.getControlName() return null. So finally when I'm trying to
decorate error message for specified field I get 
tracker.inError(field) == false

Is it possible do not do

@Component(id = "applyCouponCode")
private TextField applyCouponCode;

and somehow to retrieve necessary Field using some service or something
else?

Otherwise, what can be wrong in existing code?

Thanks a lot

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-retrieve-Field-tp4850061p4850061.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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

Reply via email to