Re: How to retrieve Field

2011-09-29 Thread Pups
Hello, Thiago!

Thanks a lot for your feedback.

I use @Component.

Yes, I supposed ordering of processSubmission() methods too.
Is where any workaround those issue? Or maybe it's possible to execut
processSubmission() of TextField inside my processSubmission()?

Thanks,
Vasyl

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-retrieve-Field-tp4850061p4852970.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



Re: How to retrieve Field

2011-09-29 Thread Pups
Hello, Thiago!

Maybe I've incorrect desribed issue. But what I really need is not retrieve
value of field.
I Retrieve it successfully at the moment.
I need exactly *Field* type object to use in the recordError method.

At this moment I do the following:

tracker.recordError(applyCouponCode, e.getMessage() + " Please, enter a
different coupon code or remove coupon code to proceed.");

But in some way *applyCouponCode* injected by

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

has applyCouponCode.getControlName() return NULL. And a final place where I
need it - it is validation decorator. I have

private boolean inError(Field field) {
ValidationTracker tracker = getTracker();
return tracker.inError(field);
}

and tracker.inError(field) use get(field) method wich trying to find
appropriate field using controlName.

THIS IS from tapestry 5.1.0.5 source code

public final class ValidationTrackerImpl extends
BaseOptimizedSessionPersistedObject implements ValidationTracker,
Serializable
{
...
private FieldTracker get(Field field)
{
String key = field.getControlName();

refreshFieldToTracker();

FieldTracker result = InternalUtils.get(fieldToTracker, key);

if (result == null)
result = new FieldTracker(key);

return result;
}
...
public boolean inError(Field field)
{
return InternalUtils.isNonBlank(get(field).errorMessage);
}
}

so... because of 
String key = field.getControlName();
return NULL we will have

if (result == null)
 result = new FieldTracker(key);

*errorMEssage* will be blank and method inError return *FALSE*.

That what I really need. I need to understand *why controlName of my
ApplyCouponCode component is NULL?*

Thanks,
Vasyl

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-retrieve-Field-tp4850061p4852159.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



How to retrieve Field

2011-09-28 Thread Pups
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


...

...



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



Re: Tapestry 5.1.10 Links in Chrome and IE9

2011-06-10 Thread Pups
Hello.
I use this encoding

String encodedUrl = getRequestedUrl();
encodedUrl = java.net.URLEncoder.encode(encodedUrl,
requestGlobals.getHTTPServletRequest().getCharacterEncoding());

return encodedUrl;

As I see in debug it is "UTF-8".

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-5-1-10-Links-in-Chrome-and-IE9-tp4473624p4475440.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



Tapestry 5.1.10 Links in Chrome and IE9

2011-06-09 Thread Pups
Hello everybody,

Let's me try to describe my issue.
I've some ActionLink on the component and when I click it my Tapestry
application generate some link and return it 
part of code is here

public Object onActionFromAddToBundleCart() throws ShoppingCartException {
...
Link addProductsToCartLink =
pageRenderLinkSource.createPageRenderLinkWithContext(BundleAddToCart.class,
addToCartContext.toArray());
addProductsToCartLink.addParameter("return_url", returnUrl);
return addProductsToCartLink;
}

Page BundleAddToCart works properly. When I use Firefox (any version) I have
link like this

http://myserver/BundleAddToCart/contextItem1/contextItem2/contextItem3/contextItem4?return_url=http://externalserver/somecontext/

And everything works. But when I try to use Google Chrome browser or IE9 I
have some strange behaviour.
I see that tapestry parse all string with pattern "/" and I have incorrect
url parameter message like this "contextItem4?return_url=http:" is
incorrect... 
Ok, I'm trying to encode return_url parameter before calling 
addParameter("return_url", returnUrl)

and as a result I have correct link seemingly...

http://myserver/BundleAddToCart/contextItem1/contextItem2/contextItem3/contextItem4?return_url=http%3A%2F%2Fexternalserver%2Fsomecontext%2F

But when this link doesn't return to Tapestry. In the response header I see
the following 
Connection:close
Content-Length:0
Date:Thu, 09 Jun 2011 17:49:15 GMT
Server:Apache-Coyote/1.1

and in the address bar I see the link like this

http://myserver/BundleAddToCart/contextItem1/contextItem2/contextItem3/contextItem4%3Freturn_url=http%3A%2F%2Fexternalserver%2Fsomecontext%2F

('?' encoded to '%3F' ).

In the IE9 the same behaviour.

One thing I've noticed. This start to occure after I've added to my project
described here 

http://tapestry.1045711.n5.nabble.com/Re-Prototype-IE9-update-td4331824.html

What's wrong? There is my error? Please HELP. I spent 3 days trying to
resolve current issue.


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-5-1-10-Links-in-Chrome-and-IE9-tp4473624p4473624.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