Re: Input string 'login;jsessionid=082793EE9A197CEB7F7750090DD0423D' is not valid; the character ';' at position 6 is not valid.

2011-10-28 Thread Leon Derks

This also works... and now we don't have to set the previousPage to null.

 public static ReferrerRequest fromUri(final String uri, final Request request) 
{
if (uri == null) {
return null;
}

final String serverRegexp = "^.*://" + request.getServerName() + "(:" + 
request.getServerPort()
+ ")?" + request.getContextPath();

if (!uri.matches(serverRegexp + ".*$")) {
return null;
}

final String path = uri.replaceFirst(serverRegexp, "");

int index = path.contains(";jsessionid") ? path.indexOf(";jsessionid") 
: path.length() - 1;

return new ReferrerRequest(path.substring(0,  index), request);
}



On Oct 28, 2011, at 12:43 PM, Joakim Olsson wrote:

> Aaah...Sounds like an easy fix. Care to send a pull request at Github?
> Since you have already solved the problem I mean. :-)
> 
> /Joakim
> 
> 
> 2011/10/28 Dávið Klein Sundsskarð :
>> Hi,
>> 
>> I have had the same issue with the Breadcrumb component.
>> The problem is that the referrer contains a ";", which comes from 
>> tapestryRequest.getHeader("Referer") in the BreadCrumbDispatcher.
>> decodePageRenderRequest  doesn't like the ";" 
>> (componentEventLinkEncoder.decodePageRenderRequest(referrerRequest);)
>> 
>> I just check the string for ; and set previousPage to null if is true. I've 
>> only experienced it to be true after the login page which is never part of 
>> the breadcrumb.
>> Not the prettiest workaround but it works...
>> We use Jetty so it isn't a Tomcat issue per se.
>> 
>> /david
>> 
>> -Original Message-
>> From: Leon Derks [mailto:leon.de...@aurumeurope.com]
>> Sent: 28. oktober 2011 12:29
>> To: Tapestry users
>> Subject: Re: Input string 
>> 'login;jsessionid=082793EE9A197CEB7F7750090DD0423D' is not valid; the 
>> character ';' at position 6 is not valid.
>> 
>> Hello Joakim,
>> 
>> That would be great!!
>> 
>> regards,
>> Leon
>> 
>> On Oct 28, 2011, at 12:23 PM, Joakim Olsson wrote:
>> 
>>> Hi,
>>> 
>>> Being the author of the breadcrumb component, I can confirm that I
>>> have seen that from time to time as well. I can try to find out if
>>> there is something that I can do about it or if it has it's roots
>>> deeper into the Tapestry code.
>>> 
>>> Regards,
>>> Joakim
>>> 
>>> 
>>> On Fri, Oct 28, 2011 at 11:04 AM, Leon Derks  
>>> wrote:
>>>> Hello
>>>> 
>>>> Thank you all for your great support!
>>>> 
>>>> I am using Tapestry 5.2.6.
>>>> 
>>>> I just found out something what causes this issue.
>>>> 
>>>> I use a breadcrumb component with a BreadCrumbDispatcher see
>>>> https://github.com/argoyle/tapestry-breadcrumbs
>>>> 
>>>> When I don't use this breadcrumb mechanism, everything works fine.
>>>> 
>>>> When I use this component, I get the error only after I have cleared my 
>>>> web history (cache, cookie etc) and I guess also when my session has 
>>>> expired.
>>>> 
>>>> Does somebody now understand what might be the cause and how I can fix 
>>>> this?
>>>> 
>>>> regards,
>>>> Leon
>>>> 
>>>> 
>>>> On Oct 28, 2011, at 10:36 AM, Steve Eynon wrote:
>>>> 
>>>>> On what version of T5 are you using and under what circumstances exactly?
>>>>> 
>>>>> For on T5.2.6 I can't generate the error with PageLinks or EventLinks.
>>>>> 
>>>>> Steve.
>>>>> 
>>>>> 
>>>>> 
>>>>> On 28 October 2011 16:24, Christian Riedel  
>>>>> wrote:
>>>>>> I see the same exception in log files for years now. Last thing I 
>>>>>> remember is that it happened in T5.1 apps already. It's definitely 
>>>>>> something that tapestry does not always ignore.
>>>>>> I'd say, Leon, you should create a JIRA for this!
>>>>>> 
>>>>>> 
>>>>>> Am 28.10.2011 um 04:49 schrieb Steve Eynon:
>>>>>> 
>>>>>>> jsessionid's are unique id's created by the web-server (i.e. jetty
>>>>>>> or
>>>>&

Re: Input string 'login;jsessionid=082793EE9A197CEB7F7750090DD0423D' is not valid; the character ';' at position 6 is not valid.

2011-10-28 Thread Leon Derks
Thanks guys!

But what is now the final conclusion?  Is this now a Tapestry issue, because 
the decodePageRenderRequest doesn't like the ";" ?

regards,
Leon





On Oct 28, 2011, at 12:43 PM, Joakim Olsson wrote:

> Aaah...Sounds like an easy fix. Care to send a pull request at Github?
> Since you have already solved the problem I mean. :-)
> 
> /Joakim
> 
> 
> 2011/10/28 Dávið Klein Sundsskarð :
>> Hi,
>> 
>> I have had the same issue with the Breadcrumb component.
>> The problem is that the referrer contains a ";", which comes from 
>> tapestryRequest.getHeader("Referer") in the BreadCrumbDispatcher.
>> decodePageRenderRequest  doesn't like the ";" 
>> (componentEventLinkEncoder.decodePageRenderRequest(referrerRequest);)
>> 
>> I just check the string for ; and set previousPage to null if is true. I've 
>> only experienced it to be true after the login page which is never part of 
>> the breadcrumb.
>> Not the prettiest workaround but it works...
>> We use Jetty so it isn't a Tomcat issue per se.
>> 
>> /david
>> 
>> -Original Message-
>> From: Leon Derks [mailto:leon.de...@aurumeurope.com]
>> Sent: 28. oktober 2011 12:29
>> To: Tapestry users
>> Subject: Re: Input string 
>> 'login;jsessionid=082793EE9A197CEB7F7750090DD0423D' is not valid; the 
>> character ';' at position 6 is not valid.
>> 
>> Hello Joakim,
>> 
>> That would be great!!
>> 
>> regards,
>> Leon
>> 
>> On Oct 28, 2011, at 12:23 PM, Joakim Olsson wrote:
>> 
>>> Hi,
>>> 
>>> Being the author of the breadcrumb component, I can confirm that I
>>> have seen that from time to time as well. I can try to find out if
>>> there is something that I can do about it or if it has it's roots
>>> deeper into the Tapestry code.
>>> 
>>> Regards,
>>> Joakim
>>> 
>>> 
>>> On Fri, Oct 28, 2011 at 11:04 AM, Leon Derks  
>>> wrote:
>>>> Hello
>>>> 
>>>> Thank you all for your great support!
>>>> 
>>>> I am using Tapestry 5.2.6.
>>>> 
>>>> I just found out something what causes this issue.
>>>> 
>>>> I use a breadcrumb component with a BreadCrumbDispatcher see
>>>> https://github.com/argoyle/tapestry-breadcrumbs
>>>> 
>>>> When I don't use this breadcrumb mechanism, everything works fine.
>>>> 
>>>> When I use this component, I get the error only after I have cleared my 
>>>> web history (cache, cookie etc) and I guess also when my session has 
>>>> expired.
>>>> 
>>>> Does somebody now understand what might be the cause and how I can fix 
>>>> this?
>>>> 
>>>> regards,
>>>> Leon
>>>> 
>>>> 
>>>> On Oct 28, 2011, at 10:36 AM, Steve Eynon wrote:
>>>> 
>>>>> On what version of T5 are you using and under what circumstances exactly?
>>>>> 
>>>>> For on T5.2.6 I can't generate the error with PageLinks or EventLinks.
>>>>> 
>>>>> Steve.
>>>>> 
>>>>> 
>>>>> 
>>>>> On 28 October 2011 16:24, Christian Riedel  
>>>>> wrote:
>>>>>> I see the same exception in log files for years now. Last thing I 
>>>>>> remember is that it happened in T5.1 apps already. It's definitely 
>>>>>> something that tapestry does not always ignore.
>>>>>> I'd say, Leon, you should create a JIRA for this!
>>>>>> 
>>>>>> 
>>>>>> Am 28.10.2011 um 04:49 schrieb Steve Eynon:
>>>>>> 
>>>>>>> jsessionid's are unique id's created by the web-server (i.e. jetty
>>>>>>> or
>>>>>>> tomcat) when it first creates a session for a client. (In your
>>>>>>> case, after you login.) It is usually stored in a cookie but it is
>>>>>>> also equally valid to have them stored as part of refering URLs.
>>>>>>> (As you are seeing) Often this is only done for the first request
>>>>>>> / response cycle until your cookie is created.
>>>>>>> 
>>>>>>> Anyhow, the jsessionid is nothing to do with T5, T5 just has to
>>>>>>> happily ignore it - which (after a quick check

Re: Input string 'login;jsessionid=082793EE9A197CEB7F7750090DD0423D' is not valid; the character ';' at position 6 is not valid.

2011-10-28 Thread Leon Derks
Hello Joakim,

That would be great!!

regards,
Leon

On Oct 28, 2011, at 12:23 PM, Joakim Olsson wrote:

> Hi,
> 
> Being the author of the breadcrumb component, I can confirm that I
> have seen that from time to time as well. I can try to find out if
> there is something that I can do about it or if it has it's roots
> deeper into the Tapestry code.
> 
> Regards,
> Joakim
> 
> 
> On Fri, Oct 28, 2011 at 11:04 AM, Leon Derks  
> wrote:
>> Hello
>> 
>> Thank you all for your great support!
>> 
>> I am using Tapestry 5.2.6.
>> 
>> I just found out something what causes this issue.
>> 
>> I use a breadcrumb component with a BreadCrumbDispatcher see 
>> https://github.com/argoyle/tapestry-breadcrumbs
>> 
>> When I don't use this breadcrumb mechanism, everything works fine.
>> 
>> When I use this component, I get the error only after I have cleared my web 
>> history (cache, cookie etc) and I guess also when my session has expired.
>> 
>> Does somebody now understand what might be the cause and how I can fix this?
>> 
>> regards,
>> Leon
>> 
>> 
>> On Oct 28, 2011, at 10:36 AM, Steve Eynon wrote:
>> 
>>> On what version of T5 are you using and under what circumstances exactly?
>>> 
>>> For on T5.2.6 I can't generate the error with PageLinks or EventLinks.
>>> 
>>> Steve.
>>> 
>>> 
>>> 
>>> On 28 October 2011 16:24, Christian Riedel  wrote:
>>>> I see the same exception in log files for years now. Last thing I remember 
>>>> is that it happened in T5.1 apps already. It's definitely something that 
>>>> tapestry does not always ignore.
>>>> I'd say, Leon, you should create a JIRA for this!
>>>> 
>>>> 
>>>> Am 28.10.2011 um 04:49 schrieb Steve Eynon:
>>>> 
>>>>> jsessionid's are unique id's created by the web-server (i.e. jetty or
>>>>> tomcat) when it first creates a session for a client. (In your case,
>>>>> after you login.) It is usually stored in a cookie but it is also
>>>>> equally valid to have them stored as part of refering URLs. (As you
>>>>> are seeing) Often this is only done for the first request / response
>>>>> cycle until your cookie is created.
>>>>> 
>>>>> Anyhow, the jsessionid is nothing to do with T5, T5 just has to
>>>>> happily ignore it - which (after a quick check on my sites) it does
>>>>> for T5.1 and T5.3 so I'm not sure where your error is coming from.
>>>>> 
>>>>> Steve.
>>>>> 
>>>>> 
>>>>> 
>>>>> On 28 October 2011 04:43, Muhammad Gelbana  wrote:
>>>>>> Please specify the exact scenario to reproduce this issue and state the
>>>>>> version you are using
>>>>>> 
>>>>>> On Thu, Oct 27, 2011 at 12:17 PM, Leon Derks 
>>>>>> wrote:
>>>>>> 
>>>>>>> 
>>>>>>> Hello
>>>>>>> 
>>>>>>> I see this error message a lot. Almost always after my first login
>>>>>>> attempt...
>>>>>>> 
>>>>>>> What is causing this error?
>>>>>>> 
>>>>>>> Input string 'login;jsessionid=082793EE9A197CEB7F7750090DD0423D' is not
>>>>>>> valid; the character ';' at position 6 is not valid.
>>>>>>> 
>>>>>>> regards,
>>>>>>> Leon
>>>>>>> -
>>>>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> *Regards,*
>>>>>> *Muhammad Gelbana
>>>>>> Java Developer*
>>>>>> 
>>>>> 
>>>>> -
>>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>>> 
>>>> 
>>>> 
>>>> -
>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>> 
>>>> 
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>> 
>> 
>> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


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



Re: Input string 'login;jsessionid=082793EE9A197CEB7F7750090DD0423D' is not valid; the character ';' at position 6 is not valid.

2011-10-28 Thread Leon Derks
Hello

Thank you all for your great support!

I am using Tapestry 5.2.6. 

I just found out something what causes this issue.

I use a breadcrumb component with a BreadCrumbDispatcher see 
https://github.com/argoyle/tapestry-breadcrumbs

When I don't use this breadcrumb mechanism, everything works fine. 

When I use this component, I get the error only after I have cleared my web 
history (cache, cookie etc) and I guess also when my session has expired.

Does somebody now understand what might be the cause and how I can fix this? 

regards,
Leon


On Oct 28, 2011, at 10:36 AM, Steve Eynon wrote:

> On what version of T5 are you using and under what circumstances exactly?
> 
> For on T5.2.6 I can't generate the error with PageLinks or EventLinks.
> 
> Steve.
> 
> 
> 
> On 28 October 2011 16:24, Christian Riedel  wrote:
>> I see the same exception in log files for years now. Last thing I remember 
>> is that it happened in T5.1 apps already. It's definitely something that 
>> tapestry does not always ignore.
>> I'd say, Leon, you should create a JIRA for this!
>> 
>> 
>> Am 28.10.2011 um 04:49 schrieb Steve Eynon:
>> 
>>> jsessionid's are unique id's created by the web-server (i.e. jetty or
>>> tomcat) when it first creates a session for a client. (In your case,
>>> after you login.) It is usually stored in a cookie but it is also
>>> equally valid to have them stored as part of refering URLs. (As you
>>> are seeing) Often this is only done for the first request / response
>>> cycle until your cookie is created.
>>> 
>>> Anyhow, the jsessionid is nothing to do with T5, T5 just has to
>>> happily ignore it - which (after a quick check on my sites) it does
>>> for T5.1 and T5.3 so I'm not sure where your error is coming from.
>>> 
>>> Steve.
>>> 
>>> 
>>> 
>>> On 28 October 2011 04:43, Muhammad Gelbana  wrote:
>>>> Please specify the exact scenario to reproduce this issue and state the
>>>> version you are using
>>>> 
>>>> On Thu, Oct 27, 2011 at 12:17 PM, Leon Derks 
>>>> wrote:
>>>> 
>>>>> 
>>>>> Hello
>>>>> 
>>>>> I see this error message a lot. Almost always after my first login
>>>>> attempt...
>>>>> 
>>>>> What is causing this error?
>>>>> 
>>>>> Input string 'login;jsessionid=082793EE9A197CEB7F7750090DD0423D' is not
>>>>> valid; the character ';' at position 6 is not valid.
>>>>> 
>>>>> regards,
>>>>> Leon
>>>>> -
>>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> --
>>>> *Regards,*
>>>> *Muhammad Gelbana
>>>> Java Developer*
>>>> 
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>> 
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
>> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 



Input string 'login;jsessionid=082793EE9A197CEB7F7750090DD0423D' is not valid; the character ';' at position 6 is not valid.

2011-10-27 Thread Leon Derks

Hello

I see this error message a lot. Almost always after my first login attempt... 

What is causing this error? 

Input string 'login;jsessionid=082793EE9A197CEB7F7750090DD0423D' is not valid; 
the character ';' at position 6 is not valid.  

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



jsessionid in URL results in RequestExceptionHandler

2011-10-22 Thread Leon Derks
Hello

Every once in a while I get the error below after logging in. The jsessionid is 
then visible in my url.
I don't understand why this happens and why this occurs sometimes. 

Does somebody of you know what is going wrong and what I can do to solve this?

regards,
Leon

ERROR org.apache.tapestry5.services.TapestryModule.RequestExceptionHandler-63 - 
Processing of request failed with uncaught exception: Input string 
'login;jsessionid=76D07FFDD475963D6909F85947390F7A' is not valid; the character 
';' at position 6 is not valid.
java.lang.IllegalArgumentException: Input string 
'login;jsessionid=76D07FFDD475963D6909F85947390F7A' is not valid; the character 
';' at position 6 is not valid.
at 
org.apache.tapestry5.internal.services.URLEncoderImpl.decode(URLEncoderImpl.java:144)
at $URLEncoder_1332c6935b7.decode($URLEncoder_1332c6935b7.java)
at 
org.apache.tapestry5.internal.services.ContextPathEncoderImpl.decodePath(ContextPathEncoderImpl.java:92)
at 
$ContextPathEncoder_1332c6935ab.decodePath($ContextPathEncoder_1332c6935ab.java)
at 
org.apache.tapestry5.internal.services.ComponentEventLinkEncoderImpl.checkIfPage(ComponentEventLinkEncoderImpl.java:328)
at 
org.apache.tapestry5.internal.services.ComponentEventLinkEncoderImpl.decodePageRenderRequest(ComponentEventLinkEncoderImpl.java:320)
at 
org.apache.tapestry5.internal.services.linktransform.LinkTransformerInterceptor.decodePageRenderRequest(LinkTransformerInterceptor.java:68)
at 
$ComponentEventLinkEncoder_1332c69359d.decodePageRenderRequest($ComponentEventLinkEncoder_1332c69359d.java)


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



Re: NumberFormatter

2011-10-12 Thread Leon Derks
Hello all,
Thanks for your support.

It was quite some work, but I managed to get it working..
For everybody else who is struggling with this, here is my code for Tapestry 
5.2.6

Page.tml


CurrencyTranslator.java
import java.text.DecimalFormat;

import org.apache.tapestry5.Field;
import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.ValidationException;
import org.apache.tapestry5.internal.translator.AbstractTranslator;
import org.apache.tapestry5.services.FormSupport;

public class CurrencyTranslator extends AbstractTranslator {

private static DecimalFormat decimalFormat = new 
DecimalFormat("0.");

public CurrencyTranslator() {
super("currency", Double.class, "currency-format-exception");
}

@Override
public String toClient(Double value) {
return decimalFormat.format(value);
}

@Override
public Double parseClient(Field field, String clientValue, String 
message) throws ValidationException {
Double returnValue = null;

if(clientValue != null) {
try{
returnValue =  Double.valueOf(clientValue);
}
catch(Exception e) {
throw new ValidationException(message);
}
}

return returnValue;
}

@Override
public void render(Field field, String message, MarkupWriter writer, 
FormSupport formSupport) {
}

}

AppModule.java
public static void contributeTranslatorSource(MappedConfiguration configuration) {
configuration.override(Double.class, new CurrencyTranslator());
 }


On Oct 12, 2011, at 12:34 PM, Muhammad Gelbana wrote:

> When you need to "contribute" a configuration or anything to tapestry, first
> check this page:
> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/TapestryModule.html
> 
> Find the method likely to satisfy your need, like in your case here:
> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/TapestryModule.html#contributeTranslatorSource(org.apache.tapestry5.ioc.MappedConfiguration,
> org.apache.tapestry5.internal.translator.NumericTranslatorSupport)
> 
> Google it to see it in action:
> http://www.google.com.eg/search?gcx=w&sourceid=chrome&ie=UTF-8&q=contributeTranslatorSource#sclient=psy-ab&hl=en&source=hp&q=tapestry+%22contributeTranslatorSource%22&pbx=1&oq=tapestry+%22contributeTranslatorSource%22&aq=f&aqi=&aql=&gs_sm=e&gs_upl=13088l14418l1l14680l2l3l0l0l0l0l0l0ll1l0&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=127c72f3b5eca502&biw=1366&bih=643
> 
> Check those links too:
> http://tapestryjava.blogspot.com/2008/09/tapestry-5-ioc-introducing-service.html
> http://jumpstart.doublenegative.com.au/jumpstart/examples/input/translators1
> http://jumpstart.doublenegative.com.au/jumpstart/examples/input/creatingtranslators1
> 
> 
> Then love tapestry even more :)
> Good luck.
> 
> On Wed, Oct 12, 2011 at 12:04 PM, Leon Derks 
> wrote:
> 
>> Hello Chris,
>> 
>> Thank you. Yes I have already seen that page, but I couldn't find an
>> example with a FieldTranslator.
>> Does anyone have an example how to do this?
>> 
>> regards,
>> Leon
>> 
>> 
>> On Oct 12, 2011, at 11:57 AM, derkoe wrote:
>> 
>>> 
>>> Leon Derks wrote:
>>>> 
>>>> I have a TextField that shows a double value.
>>>> 
>>>> But I want to format the value in the Textfield as a decimal with 4
>>>> decimals (i.e. 0.1234)
>>>> 
>>>> In Tapestry there is a NumericFormatter and a
>> BigDecimalNumericFormatter.
>>>> But I can't find any documentation on how to use these on a TextField.
>>>> Can someone give me an example how I can format my double value into a
>>>> decimal value with 4 decimals?
>>>> 
>>>> regards,
>>>> Leo
>>>> 
>>> 
>>> For input fields (such as TextField) you can add a parameter "translate"
>> of
>>> type FieldTranslator which translates between the object (e.g.
>> BigDecimal)
>>> and the String representation in the input.
>>> See:
>>> 
>> http://tapestry.apache.org/current/tapestry-core/ref/org/apache/tapestry5/corelib/components/TextField.html
>>> 
>>> You can also define your translator globally by contributing to
>>> TranslatorSource.
>>> 
>>> --
>>> Chris
>>> 
&g

Re: NumberFormatter

2011-10-12 Thread Leon Derks
Hello Chris,

Thank you. Yes I have already seen that page, but I couldn't find an example 
with a FieldTranslator.
Does anyone have an example how to do this?

regards,
Leon


On Oct 12, 2011, at 11:57 AM, derkoe wrote:

> 
> Leon Derks wrote:
>> 
>> I have a TextField that shows a double value.
>> 
>> But I want to format the value in the Textfield as a decimal with 4
>> decimals (i.e. 0.1234)
>> 
>> In Tapestry there is a NumericFormatter and a BigDecimalNumericFormatter.
>> But I can't find any documentation on how to use these on a TextField.
>> Can someone give me an example how I can format my double value into a
>> decimal value with 4 decimals?
>> 
>> regards,
>> Leo
>> 
> 
> For input fields (such as TextField) you can add a parameter "translate" of
> type FieldTranslator which translates between the object (e.g. BigDecimal)
> and the String representation in the input.
> See:
> http://tapestry.apache.org/current/tapestry-core/ref/org/apache/tapestry5/corelib/components/TextField.html
> 
> You can also define your translator globally by contributing to
> TranslatorSource.
> 
> -- 
> Chris
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/NumberFormatter-tp4894812p4894939.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
> 


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



NumberFormatter

2011-10-12 Thread Leon Derks
I have a TextField that shows a double value.

But I want to format the value in the Textfield as a decimal with 4 decimals 
(i.e. 0.1234)

In Tapestry there is a NumericFormatter and a BigDecimalNumericFormatter. But I 
can't find any documentation on how to use these on a TextField.
Can someone give me an example how I can format my double value into a decimal 
value with 4 decimals?

regards,
Leon



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



Re: Showing Hiding Blocks based on Select

2011-10-12 Thread Leon Derks
Hello

Thanks for your answer. At the moment I am working with Blocks and a 

I think it is almost working, but I want to handle the change event and update 
the activeBlock when changing the value in the select box. How can I do that?

Why do I need a Zone to handle the change event? Because I want to be free in 
using zones or not. 
In my case the zone div breaks my page layout...

On entering the page, the activeBlock is working fine. Now I only need to 
handle the change event from the select.
Do you know how I can do this?

regards,
Leon






On Oct 12, 2011, at 12:29 AM, Thiago H. de Paula Figueiredo wrote:

> On Tue, 11 Oct 2011 15:15:28 -0300, Leon Derks  
> wrote:
> 
>> Hello
> 
> Hi!
> 
>> In my page I have a form with a select. (see below) Based on this select I 
>> want to show/hide different Blocks with  elements.
>> 
>> What is the best way to do this? I tried to use a zone, but the zone div is 
>> automatically moved to the top of the page and I don't want that.
>> How can I show/hide  elements based on the value I have selected?
> 
> Do you really need server-side processing? If not, just give an id the s 
> you want and use JavaScript to show or hide them.
> 
> -- 
> 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



Showing Hiding Blocks based on Select

2011-10-11 Thread Leon Derks
Hello

In my page I have a form with a select. (see below) Based on this select I want 
to show/hide different Blocks with  elements.

What is the best way to do this? I tried to use a zone, but the zone div is 
automatically moved to the top of the page and I don't want that.
How can I show/hide  elements based on the value I have selected?

regards,
Leon




Type







High





Low








Normal






Re: [T5] 5.0.17 URLEncoderImpl.decode error

2008-12-11 Thread Leon Derks

He Martijn,

The URL is not really generated. I was playing with Freemarker (Java 
template engine).

I tried it to send a mail...
The URL is in the mail template and the email param is replaced by 
freemarker:

http://localhost:8090/tapestry/test/user/${user.userEmail}"/>

My test was to send an email with freemarker with a link in it. I want 
to be able to click that link and show the email on the screen.
So for me it is not handy that the URL encoding has changed, because I 
can not use the  org.apache.tapestry5.internal.services.URLEncoderImpl 
inside my template.


Any ideas how I can solve this?

greetz,
Leon


Martijn Brinkers wrote:

I guess the URL is generated outside of Tapestry? because if you
passivate or create a link from Tapestry the parameters are encoded with
the Tapestry 'special' encoding.

You can probably use the default encoder implementation if you want to
encode from outside of Tapestry: 

org.apache.tapestry5.internal.services.URLEncoderImpl 


Martijn Brinkers


On Wed, 2008-12-10 at 23:43 +0100, Leon Derks wrote:
  

Hi Martijn,

Thanks!
Yes,  http://localhost:8090/tapestry/test/user/user$0040company.com 
works, when I change the @ into $0040 manually.


But how can I automatically translate @ into $0040, because my code 
still generates the '@' character in the url.


greetz,
Leon


Martijn Brinkers wrote:

The URL encoder has been changed. 


@ for example is now encoded as $0040

See https://issues.apache.org/jira/browse/TAP5-302


Search the archive for what and why things have changed
http://tapestry.markmail.org

Martijn Brinkers



On Wed, 2008-12-10 at 23:19 +0100, Leon Derks wrote:
  
  

Hello
This evening I tried tapestry 5.0.17

When I type in the following url in my application:
http://localhost:8090/tapestry/test/user/[EMAIL PROTECTED]

I do get an java.lang.IllegalArgumentException
It says: "Input string '[EMAIL PROTECTED]' is not valid; the character 
'@' at position 5 is not valid."

Stacktrace:

org.apache.tapestry5.internal.services.URLEncoderImpl.decode(URLEncoderImpl.java:143)

org.apache.tapestry5.internal.services.ContextPathEncoderImpl.decodePath(ContextPathEncoderImpl.java:70)

org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:88)

org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:71)

org.apache.tapestry5.services.TapestryModule$17.service(TapestryModule.java:1029)


I didn't had this problem in tapestry 5.0.14.
I searched in the changes, but couldn't find a change that would cause 
this error.


Any ideas?

Leon

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


__ NOD32 3682 (20081210) Informatie __

Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem.
http://www.nod32.nl



  
  

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



__ NOD32 3682 (20081210) Informatie __

Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem.
http://www.nod32.nl



  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T5] 5.0.17 URLEncoderImpl.decode error

2008-12-10 Thread Leon Derks

Hi Martijn,

Thanks!
Yes,  http://localhost:8090/tapestry/test/user/user$0040company.com 
works, when I change the @ into $0040 manually.


But how can I automatically translate @ into $0040, because my code 
still generates the '@' character in the url.


greetz,
Leon


Martijn Brinkers wrote:
The URL encoder has been changed. 


@ for example is now encoded as $0040

See https://issues.apache.org/jira/browse/TAP5-302


Search the archive for what and why things have changed
http://tapestry.markmail.org

Martijn Brinkers



On Wed, 2008-12-10 at 23:19 +0100, Leon Derks wrote:
  

Hello
This evening I tried tapestry 5.0.17

When I type in the following url in my application:
http://localhost:8090/tapestry/test/user/[EMAIL PROTECTED]

I do get an java.lang.IllegalArgumentException
It says: "Input string '[EMAIL PROTECTED]' is not valid; the character 
'@' at position 5 is not valid."

Stacktrace:

org.apache.tapestry5.internal.services.URLEncoderImpl.decode(URLEncoderImpl.java:143)

org.apache.tapestry5.internal.services.ContextPathEncoderImpl.decodePath(ContextPathEncoderImpl.java:70)

org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:88)

org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:71)

org.apache.tapestry5.services.TapestryModule$17.service(TapestryModule.java:1029)


I didn't had this problem in tapestry 5.0.14.
I searched in the changes, but couldn't find a change that would cause 
this error.


Any ideas?

Leon

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


__ NOD32 3682 (20081210) Informatie __

Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem.
http://www.nod32.nl



  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[T5] 5.0.17 URLEncoderImpl.decode error

2008-12-10 Thread Leon Derks

Hello
This evening I tried tapestry 5.0.17

When I type in the following url in my application:
http://localhost:8090/tapestry/test/user/[EMAIL PROTECTED]

I do get an java.lang.IllegalArgumentException
It says: "Input string '[EMAIL PROTECTED]' is not valid; the character 
'@' at position 5 is not valid."

Stacktrace:
   
org.apache.tapestry5.internal.services.URLEncoderImpl.decode(URLEncoderImpl.java:143)
   
org.apache.tapestry5.internal.services.ContextPathEncoderImpl.decodePath(ContextPathEncoderImpl.java:70)
   
org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:88)
   
org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:71)
   
org.apache.tapestry5.services.TapestryModule$17.service(TapestryModule.java:1029)


I didn't had this problem in tapestry 5.0.14.
I searched in the changes, but couldn't find a change that would cause 
this error.


Any ideas?

Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: What's the easiest way to implement two dependent select lists ?

2008-12-10 Thread Leon Derks

Indeed I agree with Hugo.
I had this use case a couple of times and solved it in the same way as 
Hugo did.


I also hoped there is an easier way to implement dependable selects, 
using zones...


Also filling selects with objects is not really easy. I need to 
implement a selection model and a value encoder.

I have the feeling that things are more complicated than they should be.

For example, it would be easier to add a select into my page and bind a 
list with objects to it with setting the labelField and idField to 
object properties.

So like this;
labelField="name", idField="id" value="selectedProduct" />


I get the feeling that sometimes tapestry 5 is doing things to complicated.

Leon



Hugo Palma wrote:
Everything i used in the example is built into Tapestry except the 
OnEvent mixin that is provided by the library 
t5-components(http://87.193.218.134:8080/t5components/index.html).
The javascript stuff is part of prototype that is already bundled with 
Tapestry.


James Hillyerd wrote:

Hugo,

That's a great example.  I think this belongs on the Wiki!

Is the JSON stuff built into Tapestry, or do I need a third party 
library

for that?

-james

On Tue, Dec 9, 2008 at 10:17 AM, Hugo Palma <[EMAIL PROTECTED]> 
wrote:


 

Here's how i'm doing this now:

On the source select i'm using the OnEvent mixin to fire the change 
event:




The event listener method is then responsible for querying the 
database for

the value to be set in the destination select:

@OnEvent(component = "operator", value = "change")
   public JSONArray onChangeOperatorEvent(String value) {
   JSONArray jsonArray = new JSONArray();

   for (Plaza plaza : getDestinationSelectValues(value)) {
   JSONObject jsonObject = new JSONObject();
   jsonObject.put("value", plaza.getId());
   jsonObject.put("label", plaza.getDescription());

   jsonArray.put(jsonObject);
   }

   return jsonArray;
   }

Finally, the onCompleteOperatorChange javascript function has to 
parse the

return JSON and update the select input options:

function onCompleteOperatorChange(response) {
   selectElement = $("entryPlaza");
   responseJSON = response.evalJSON();

   while (selectElement .options.length > 0) {
   selectElement .options[0] = null;
   }

   for (index = 0; index < responseJSON .length; index++) {
   selectElement.options[index] = new Option(responseJSON
[index].label, responseJSON [index].value);
   }

   Tapestry.ElementEffect.highlight($("entryPlaza"));
   }

It would make things a little easier if the selects weren't inside a 
form
because then my event listener method could return the component 
instance

itself and then on the client i would just have to replace the current
element with the new rendered one.

On Sun, Dec 7, 2008 at 10:46 PM, Hugo Palma <[EMAIL PROTECTED]>
wrote:

   
 I'm already using the OnEvent component. Still, because the model 
of the
select list i want to update is calculated server-side i need to 
pass it
  

in
   

json to the client, parse it again in javascript and then update the
  

select
   

input. This does work but i feel that there should be a simpler way of
  

doing
   

this, maybe using zones.

thermus wrote:

I'm a Tapestry novice, but you may want to have a look at
  
http://code.google.com/p/tapestry5-components/ t5components .  It 
allows

you
   

to add a mixin to components to respond to an OnChange event with AJAX
  

(see: http://87.193.218.134:8080/t5c-demo/oneventpage this  and
http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html 

   
this  for details).  You could then change the data model for the 
other
select component with a tiny bit of JavaScript in the 
onCompleteCallback

function.

I'm curious how a Tapestry expert would handle it.


HugoPalma wrote:


 I have a very usual use where in a form i have two selects, and 
when the
user selects a value on one the values on the second should be 
filtered

accordingly.
As the Select component doesn't support ajax out-of.the-box i see 
myself

forced to implement a lot of plumbing and javascript stuff.

Still, i feel that this kind of use case should be much easier to
implement.
Maybe i'm missing something.
I'd like to hear some ideas about how u would handle this.

Thanks.





  




  




__ NOD32 3680 (20081210) Informatie __

Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem.
http://www.nod32.nl




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Include multiple css in @IncludeStylesheet

2008-09-25 Thread Leon Derks

Hello

How can I add multiple stylesheets to the @includeSysheet annotation?
In the documentation I read that one or more paths can be injected. But 
how can I do that?


For example I want something like this:
@IncludeStylesheet("context:css/page.css",  
"context:css/tapestry-custom.css")


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T4.0 PropertySelection + onChange

2008-09-03 Thread Leon Derks

Hello

Is it possible to catch an onchange Event for the PropertySelection 
component?


I don't want the form te be submitted, but want to update a section in 
my page.


I use tapestry 4.0.2 with Java 1.4

Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: url localization

2008-08-18 Thread Leon Derks
I know that localization support is well integrated into Tapestry 5, but 
is it also possible to get localized urls?


Example:
english:  http://www.someserver.com/cars/15
german: http://www.someserver.com/autos/15

If so, how can I do that?





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: tapestry-test tutorial, sceencast?

2008-07-29 Thread Leon Derks
I want to use the tapestry-test module, but can't find much information 
about how to get started.


Is there some kind of screencast or tutorial planned for how to use the 
tapestry-test module with all kind of examples?




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Setup render for authentication check?

2008-05-22 Thread Leon Derks

Hello

Is the SetupRender method the correct place to check if the user has the 
priviliges to view the page?


For example something like this:

@SetupRender
boolean setupRender() {
   if(user has priviliges) {
  return true;
   }
   return false;
}

Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: get name of Start page

2008-05-21 Thread Leon Derks

Hello

Is it possible to get the name of the (default) start page?

Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



show page title in layout component

2008-05-21 Thread Leon Derks

Hello

I use a layout component for all my pages, like below.
But for some reason, the page title is not passed to the layout 
component. What am I doing wrong?

Leon

Page.tml
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"; 
t:type="layout" title="${message:page-title}">

.


Laout.tml:

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml"; 
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

   
   
   
   ${title}
   
   
   
   
   t:breadCrumbs="basePage.breadCrumbHolder.breadCrumbs" />

   
   
   
   


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: Exception Handling

2008-05-20 Thread Leon Derks

Hi Filip,

I use an Transaction Filter where I catch all exceptions (see code part 
below). But can I use your redirect service in my catch part?

I tried to get it work, but had no success.

public RequestFilter buildTransactionFilter(final EntityManager 
entityManager, final RedirectService redirectService, final Logger logger) {

   return new RequestFilter() {
   EntityTransaction transaction;

   public boolean service(Request request, Response response, 
RequestHandler handler) throws IOException {

   boolean result = false;
   try {
   transaction = entityManager.getTransaction();
   transaction.begin();
   result = handler.service(request, response);
   transaction.commit();
   } catch (Exception exception) {
   logger.error(exception.toString());
   if (transaction.isActive()) {
   transaction.rollback();
   }
   result = false;
   redirectService.sendRedirect(Error.class, false);
   } finally {
   entityManager.close();
   }
   return result;
   }
   };
   }




Filip S. Adamsen wrote:

Hi Leon,

How to override server error pages depends on what server you're 
using. As far as I'm aware it's unfortunately not possible to use 
Tapestry pages as server error pages - if I'm wrong here, I'd really 
like to know how to do it. :)


What I mean by turning the RequestExceptionHandler into a pipeline is 
that I've overridden the original service with my own that uses a 
pipeline.

http://tapestry.apache.org/tapestry5/tapestry-ioc/pipeline.html

So I define my filter:

  public interface RequestExceptionFilter {

void handleRequestException(Throwable exception, 
RequestExceptionHandler handler)

throws IOException;
  }

Then I create a new RequestExceptionHandler as a pipeline:

  public static RequestExceptionHandler 
buildImprovedRequestExceptionHandler(

  List configuration,
  @InjectService("RequestExceptionHandler") 
RequestExceptionHandler requestExceptionHandler,

  PipelineBuilder builder,
  Logger logger
  ) {
return builder.build(
logger,
RequestExceptionHandler.class,
RequestExceptionFilter.class,
configuration,
requestExceptionHandler
);
  }

I then contribute this to AliasOverrides to replace the default 
RequestExceptionHandler:


  public static void contributeAliasOverrides(
  Configuration configuration,
  @InjectService("ImprovedRequestExceptionHandler") 
RequestExceptionHandler requestExceptionHandler

  ) {

configuration.add(AliasContribution.create(RequestExceptionHandler.class, 
requestExceptionHandler));

  }

I can then contribute filters to the pipeline like this:

  public static void contributeImprovedRequestExceptionHandler(
  OrderedConfiguration configuration,
  RequestExceptionErrorFilter requestExceptionErrorFilter
  ) {
configuration.add("Error", requestExceptionErrorFilter);
  }

Where RequestExceptionErrorFilter looks like this:

  public class RequestExceptionErrorFilter
  implements RequestExceptionFilter {

private final RedirectService redirectService;
private final SecurityService securityService;
private final Logger logger;

public RequestExceptionErrorFilter(RedirectService 
redirectService, SecurityService securityService, Logger logger) {

  this.redirectService = redirectService;
  this.securityService = securityService;
  this.logger = logger;
}

public void handleRequestException(Throwable exception, 
RequestExceptionHandler handler)

throws IOException {
  if (securityService.isProductionModeEnabled()) {
logger.error("Exception during request", exception);
redirectService.sendRedirect(ErrorIndex.class, false);
  }
  else {
handler.handleRequestException(exception);
  }
}
  }

RedirectService and SecurityService are my own classes. They just make 
some things easier for me. As you can see I show an error page when 
I'm in production but invoke the next filter in the pipeline if I'm 
not. You could contribute more filters if needed.


I've been wanting to contribute a strategy filter before this one 
allowing to do different things depending on the type of exception 
thrown, but haven't had the time nor need to do so yet.


http://tapestry.apache.org/tapestry5/tapestry-ioc/strategy.html

Anyhow, hope this helps - if not, you know where to ask. :)

-Filip

On 2008-05-16 17:37, Leon Derks wrote:

Thanks Peter,

Your original question in the post is also what I would like to know.

Do you now know how to override server error pages(404, 505 etc)?
And I don't understand what Flip means with :I'v

Error serializing component action for component Gears:loop:

2008-05-19 Thread Leon Derks

Hello

I did get the error :Error serializing component action for component 
Gears:loop:


When I add "implements Serializable" to my Gear class everything works fine.

But I have also other objects that I looped throught with a 
t:type="loop" but these objects didn't need an "implements Serializable".


So what makes it that my Gear object needs an "implements Serializable" ?

All my other objects are extending BaseEntity and the Gear is extending 
Product (which again extends BaseEntity).


Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: Exception Handling

2008-05-19 Thread Leon Derks

Hi Filip,

Thanks for your answer. I understand now.
But one final question. How does your redirectService looks like?

Leon

Filip S. Adamsen wrote:

Hi Leon,

How to override server error pages depends on what server you're 
using. As far as I'm aware it's unfortunately not possible to use 
Tapestry pages as server error pages - if I'm wrong here, I'd really 
like to know how to do it. :)


What I mean by turning the RequestExceptionHandler into a pipeline is 
that I've overridden the original service with my own that uses a 
pipeline.


http://tapestry.apache.org/tapestry5/tapestry-ioc/pipeline.html

So I define my filter:

  public interface RequestExceptionFilter {

void handleRequestException(Throwable exception, 
RequestExceptionHandler handler)

throws IOException;
  }

Then I create a new RequestExceptionHandler as a pipeline:

  public static RequestExceptionHandler 
buildImprovedRequestExceptionHandler(

  List configuration,
  @InjectService("RequestExceptionHandler") 
RequestExceptionHandler requestExceptionHandler,

  PipelineBuilder builder,
  Logger logger
  ) {
return builder.build(
logger,
RequestExceptionHandler.class,
RequestExceptionFilter.class,
configuration,
requestExceptionHandler
);
  }

I then contribute this to AliasOverrides to replace the default 
RequestExceptionHandler:


  public static void contributeAliasOverrides(
  Configuration configuration,
  @InjectService("ImprovedRequestExceptionHandler") 
RequestExceptionHandler requestExceptionHandler

  ) {

configuration.add(AliasContribution.create(RequestExceptionHandler.class, 
requestExceptionHandler));

  }

I can then contribute filters to the pipeline like this:

  public static void contributeImprovedRequestExceptionHandler(
  OrderedConfiguration configuration,
  RequestExceptionErrorFilter requestExceptionErrorFilter
  ) {
configuration.add("Error", requestExceptionErrorFilter);
  }

Where RequestExceptionErrorFilter looks like this:

  public class RequestExceptionErrorFilter
  implements RequestExceptionFilter {

private final RedirectService redirectService;
private final SecurityService securityService;
private final Logger logger;

public RequestExceptionErrorFilter(RedirectService 
redirectService, SecurityService securityService, Logger logger) {

  this.redirectService = redirectService;
  this.securityService = securityService;
  this.logger = logger;
}

public void handleRequestException(Throwable exception, 
RequestExceptionHandler handler)

throws IOException {
  if (securityService.isProductionModeEnabled()) {
logger.error("Exception during request", exception);
redirectService.sendRedirect(ErrorIndex.class, false);
  }
  else {
handler.handleRequestException(exception);
  }
}
  }

RedirectService and SecurityService are my own classes. They just make 
some things easier for me. As you can see I show an error page when 
I'm in production but invoke the next filter in the pipeline if I'm 
not. You could contribute more filters if needed.


I've been wanting to contribute a strategy filter before this one 
allowing to do different things depending on the type of exception 
thrown, but haven't had the time nor need to do so yet.


http://tapestry.apache.org/tapestry5/tapestry-ioc/strategy.html

Anyhow, hope this helps - if not, you know where to ask. :)

-Filip

On 2008-05-16 17:37, Leon Derks wrote:

Thanks Peter,

Your original question in the post is also what I would like to know.

Do you now know how to override server error pages(404, 505 etc)?
And I don't understand what Flip means with :I've turned the 
RequestExceptionHandler service into a pipeline.


Can you show me some code of how to do this?
Leon


Peter Stavrinides wrote:

Hi Leon

I posted a number of questions to the list about this topic, but got 
only a few perls. One of them was this post, particularly Filip's 
answer:

http://www.mail-archive.com/users@tapestry.apache.org/msg21914.html

Also see this page, for how to override Tapestry's error page with 
your own friendly error page:

http://wiki.apache.org/tapestry/Tapestry5ExceptionPage

I am not sure what you are trying to do, but would suggest you 
familiarize yourself a bit more with Tapestry's error reporting 
mechanisms, which imho are incredibly powerful and easy to use.


Hope this helps,
Peter


- Original Message -
From: "Leon Derks" <[EMAIL PROTECTED]>
To: "Tapestry users" 
Sent: Friday, 16 May, 2008 1:35:19 PM GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul

Subject: T5: Exception Handling

Hello

What is the best way to handle exceptions in Tapestry 5?

I want to show some kind of general error page, when an exception 
occurs.


At the m

Re: T5: Exception Handling

2008-05-16 Thread Leon Derks

Thanks Peter,

Your original question in the post is also what I would like to know.

Do you now know how to override server error pages(404, 505 etc)?
And I don't understand what Flip means with :I've turned the 
RequestExceptionHandler service into a pipeline.


Can you show me some code of how to do this?
Leon


Peter Stavrinides wrote:

Hi Leon

I posted a number of questions to the list about this topic, but got only a few 
perls. One of them was this post, particularly Filip's answer:
http://www.mail-archive.com/users@tapestry.apache.org/msg21914.html

Also see this page, for how to override Tapestry's error page with your own 
friendly error page:
http://wiki.apache.org/tapestry/Tapestry5ExceptionPage

I am not sure what you are trying to do, but would suggest you familiarize 
yourself a bit more with Tapestry's error reporting mechanisms, which imho are 
incredibly powerful and easy to use.

Hope this helps,
Peter


- Original Message -
From: "Leon Derks" <[EMAIL PROTECTED]>
To: "Tapestry users" 
Sent: Friday, 16 May, 2008 1:35:19 PM GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: T5: Exception Handling

Hello

What is the best way to handle exceptions in Tapestry 5?

I want to show some kind of general error page, when an exception occurs.

At the moment I have a onException method in my BasePage class. But for 
some reason the Error page is not returned.

What is the way in T5 to handle exceptions?

Object onException(Throwable cause) {
return new Error();
}

Leon

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



T5: Exception Handling

2008-05-16 Thread Leon Derks

Hello

What is the best way to handle exceptions in Tapestry 5?

I want to show some kind of general error page, when an exception occurs.

At the moment I have a onException method in my BasePage class. But for 
some reason the Error page is not returned.

What is the way in T5 to handle exceptions?

Object onException(Throwable cause) {
   return new Error();
   }

Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Failure writing parameter 'value' of component characteristic/Edit:nominaltextfield:

2008-05-15 Thread Leon Derks

Hi Nicholas,

Indeed, that was it.

Thanks!
Leon

nicholas Krul wrote:

${X} is a one way output...

it uses the prop: binding by default... remove the EL-style ${} and it
should work.

On Thu, May 15, 2008 at 2:24 PM, Leon Derks <[EMAIL PROTECTED]> wrote:

  

I get this error:

Failure writing parameter 'value' of component
characteristic/Edit:nominaltextfield: Binding
[EMAIL PROTECTED] is
read-only.

I have the corresponding getter / setter for the property.

What am I doing wrong?

Java Page:

private String nominalDescription;

public String getNominalDescription() {
  String description =
getDescriptionForValueType(CharacteristicValueType.Nominal);
  if(description != null) {
  return description;
  }
  return nominalDescription;
}

public void setNominalDescription(String nominalDescription) {
  this.nominalDescription = nominalDescription;
}

Webpage:



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



Failure writing parameter 'value' of component characteristic/Edit:nominaltextfield:

2008-05-15 Thread Leon Derks

I get this error:

Failure writing parameter 'value' of component 
characteristic/Edit:nominaltextfield: Binding 
[EMAIL PROTECTED] 
is read-only.


I have the corresponding getter / setter for the property.

What am I doing wrong?

Java Page:

private String nominalDescription;

public String getNominalDescription() {
   String description = 
getDescriptionForValueType(CharacteristicValueType.Nominal);

   if(description != null) {
   return description;
   }
   return nominalDescription;
}

public void setNominalDescription(String nominalDescription) {
   this.nominalDescription = nominalDescription;
}

Webpage:
value="${nominalDescription}"/>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 + JSON + key name

2008-05-15 Thread Leon Derks

Hi Chris,

I just noticed that the options in the select are initialy not ordered.
But when I persist the options (groups) in my session data, the option 
are ordered after I have clicked the search button and submitted the form.

Then refreshed page, contains a select with ordered group options.

Do you have an explanation for this behaviour?

Leon


Leon Derks wrote:

Thanks Chris,

That worked.
The only thing is that the order of groups in the select is gone.
I know for sure I put them in the correct order in the java jsonObject.
I think the var jsonObject = response.evalJSON(); or the for(var key 
in jsonObject) messes up the order.

Is there a way to solve this?

For the ones interested, I fill my select box now in this way:

Java Page:
@OnEvent(component = "productSelect", value = "change")
   JSONObject onProductSelectChanged(String value) {
   ProductCategory category = 
ProductCategory.getProductCategoryByName(value);

   groups = characteristicDAO.findGroupsByProductCategory(category);
   JSONObject jsonObject = new JSONObject();
   for (CharacteristicGroup group : groups) {
   Long id = group.getId();
   jsonObject.put(id.toString(), group.getName());
   }
   return jsonObject;
   }

javascript:
function productSelectChanged(response) {
   var groupSelect = $('groupSelect');
   clearSelectOption(groupSelect);
 var jsonObject = response.evalJSON();
   for(var key in jsonObject) {
   addSelectOption(groupSelect, jsonObject[key], key, false);
   }
}

Chris Lewis wrote:

Try:

for (var i in object) {}

Where object would be your json object.

Leon Derks wrote:
 

Hi Sven,

I only see that they get the value by using the key name.
For example this:

|var data = '{ "name": "Violet", "occupation": "character" 
}'.evalJSON();

data.name; //prints Violet.
|

But in my case, I don't know the key name, so I can't get the value.
Is there a way to get the key names of a JSON Object?
For example something like this:
|
data.keys; //returns {name, occupation}|

|
|

Leon


Sven Homburg wrote:
   

http://www.prototypejs.org/learn/json

2008/5/15 Leon Derks <[EMAIL PROTECTED]>:

 
 

Hello

I have a  JSON object like this:

JSONObject obj = new JSONObject();

obj.put(entity.getId(), entity.getName());

But how can I get the value from my json object in javascript, if I
don't
know the key name?

Is there a way to get the key name(s) from a json object in 
javascript?


Leon

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



Re: T5 + JSON + key name

2008-05-15 Thread Leon Derks

Thanks Chris,

That worked.
The only thing is that the order of groups in the select is gone.
I know for sure I put them in the correct order in the java jsonObject.
I think the var jsonObject = response.evalJSON(); or the for(var key in 
jsonObject) messes up the order.

Is there a way to solve this?

For the ones interested, I fill my select box now in this way:

Java Page:
@OnEvent(component = "productSelect", value = "change")
   JSONObject onProductSelectChanged(String value) {
   ProductCategory category = 
ProductCategory.getProductCategoryByName(value);

   groups = characteristicDAO.findGroupsByProductCategory(category);
   JSONObject jsonObject = new JSONObject();
   for (CharacteristicGroup group : groups) {
   Long id = group.getId();
   jsonObject.put(id.toString(), group.getName());
   }
   return jsonObject;
   }

javascript:
function productSelectChanged(response) {
   var groupSelect = $('groupSelect');
   clearSelectOption(groupSelect);
  
   var jsonObject = response.evalJSON();

   for(var key in jsonObject) {
   addSelectOption(groupSelect, jsonObject[key], key, false);
   }
}

Chris Lewis wrote:

Try:

for (var i in object) {}

Where object would be your json object.

Leon Derks wrote:
  

Hi Sven,

I only see that they get the value by using the key name.
For example this:

|var data = '{ "name": "Violet", "occupation": "character" }'.evalJSON();
data.name; //prints Violet.
|

But in my case, I don't know the key name, so I can't get the value.
Is there a way to get the key names of a JSON Object?
For example something like this:
|
data.keys; //returns {name, occupation}|

|
|

Leon


Sven Homburg wrote:


http://www.prototypejs.org/learn/json

2008/5/15 Leon Derks <[EMAIL PROTECTED]>:

 
  

Hello

I have a  JSON object like this:

JSONObject obj = new JSONObject();

obj.put(entity.getId(), entity.getName());

But how can I get the value from my json object in javascript, if I
don't
know the key name?

Is there a way to get the key name(s) from a json object in javascript?

Leon

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



Re: T5 + JSON + key name

2008-05-15 Thread Leon Derks

Hi Sven,

I only see that they get the value by using the key name.
For example this:

|var data = '{ "name": "Violet", "occupation": "character" }'.evalJSON();
data.name; //prints Violet.
|

But in my case, I don't know the key name, so I can't get the value.
Is there a way to get the key names of a JSON Object?
For example something like this:
|
data.keys; //returns {name, occupation}|

|
|

Leon


Sven Homburg wrote:

http://www.prototypejs.org/learn/json

2008/5/15 Leon Derks <[EMAIL PROTECTED]>:

  

Hello

I have a  JSON object like this:

JSONObject obj = new JSONObject();

obj.put(entity.getId(), entity.getName());

But how can I get the value from my json object in javascript, if I don't
know the key name?

Is there a way to get the key name(s) from a json object in javascript?

Leon

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



T5 + JSON + key name

2008-05-15 Thread Leon Derks

Hello

I have a  JSON object like this:

JSONObject obj = new JSONObject();

obj.put(entity.getId(), entity.getName());

But how can I get the value from my json object in javascript, if I 
don't know the key name?


Is there a way to get the key name(s) from a json object in javascript?

Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: JSONArray + fillling

2008-05-15 Thread Leon Derks

Thanks,

How can I loop through the jsonObjects in javascript?

I have now something like this:

array.each(function(item) {
 item[0]  item[1]
 //fill options with the item.
}

But I get undefined text in for my select option values.
The number of items in my select is correct, but the key-value is set 
to  "undefined"


Leon

Lance Java wrote:

JSONArray options = new JSONArray();
for(Group group : List groups) {
   JSONObject obj = new JSONObject();
   obj.put(group.getId, group.getName());
   options.put(obj);
}

Cheers,
Lance.

2008/5/14 Leon Derks <[EMAIL PROTECTED]>:

  

Can you give me an example of that?

Leon


Lance Java wrote:



You want a JSONObject not a JSONArray
http://tapestry.formos.com/nightly/tapestry5/apidocs/index.html

Cheers,
Lance.

2008/5/14 Leon Derks <[EMAIL PROTECTED]>:



  

Hello

I found this example:

new JSONArray("[['a', 'value a'], ['b', 'value b'], ['c', 'value c'],
['d',
'value d']]"));

The JSONArray contains information for my select box, with a value -
label
pair.

But in my case, I want to make a new JSONArray filled with properties
from
my List of Groups.

So for example something like this:

for(Group group : List groups) {
 jsonArray.put(group.getId, group.getName());
}

The problem is that a put operation only allows put(Object value) and
put(int index, Object value);

How can I add the group.getId and group.getName() as a value-label pair
to
the JSONArray?

Leon


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



T5: editing textfields values from a collection

2008-05-15 Thread Leon Derks
I have an object which contains a collection with a maximum of 3 
descriptions.


I want to be able to edit the descriptions on the same page.

At the moment I loop through the collection and print the descriptions 
in its own textfield on the screen.


But I also want to be able to edit the textfield values, when I click 
the save button.


How can I do this?

Leon



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: select + enum

2008-05-14 Thread Leon Derks

Okay I will try that.


Toby Hobson wrote:

You might want to look at Java's EnumSet.range() method for this.

Toby

- Original Message 
From: Leon Derks <[EMAIL PROTECTED]>
To: Tapestry users 
Sent: Wednesday, 14 May, 2008 4:33:58 PM
Subject: T5: select + enum

Hello,

Is it possible to show a limited list of my enum values in the select box?

For example, my enum contains 10 objects, is it possible  to show only 5 
of them in the select?


Leon

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



T5: select + enum

2008-05-14 Thread Leon Derks

Hello,

Is it possible to show a limited list of my enum values in the select box?

For example, my enum contains 10 objects, is it possible  to show only 5 
of them in the select?


Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: JSONArray + fillling

2008-05-14 Thread Leon Derks

Can you give me an example of that?

Leon

Lance Java wrote:

You want a JSONObject not a JSONArray
http://tapestry.formos.com/nightly/tapestry5/apidocs/index.html

Cheers,
Lance.

2008/5/14 Leon Derks <[EMAIL PROTECTED]>:

  

Hello

I found this example:

new JSONArray("[['a', 'value a'], ['b', 'value b'], ['c', 'value c'], ['d',
'value d']]"));

The JSONArray contains information for my select box, with a value - label
pair.

But in my case, I want to make a new JSONArray filled with properties from
my List of Groups.

So for example something like this:

for(Group group : List groups) {
  jsonArray.put(group.getId, group.getName());
}

The problem is that a put operation only allows put(Object value) and
put(int index, Object value);

How can I add the group.getId and group.getName() as a value-label pair to
the JSONArray?

Leon


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



T5: JSONArray + fillling

2008-05-14 Thread Leon Derks

Hello

I found this example:

new JSONArray("[['a', 'value a'], ['b', 'value b'], ['c', 'value c'], 
['d', 'value d']]"));


The JSONArray contains information for my select box, with a value - 
label pair.


But in my case, I want to make a new JSONArray filled with properties 
from my List of Groups.


So for example something like this:

for(Group group : List groups) {
   jsonArray.put(group.getId, group.getName());
}

The problem is that a put operation only allows put(Object value) and 
put(int index, Object value);


How can I add the group.getId and group.getName() as a value-label pair 
to the JSONArray?


Leon


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: update select based on first select

2008-05-13 Thread Leon Derks

Hi Chris,

Thanks for your answer,

this is the other part:
blankLabel="${message:text-all}" t:mixins="t5components/OnEvent" 
event="change" />


The System.out.println("Value: " + value) in my java code always prints 
the first selected value. After that always the first value is printed, 
no matter what value I select.


What am I doing wrong?

Leon

Chris Lewis wrote:

Leon,

I can't tell from that code where/how you've used the OnEvent mixin. I
see the @OnEvent annotation, but that's unrelated (as you probably
realize). This exact use case was discussed recently - see:

http://markmail.org/search/?q=ajax-based+data+retrieval+list%3Aorg.apache.tapestry.users#query:ajax-based%20data%20retrieval%20list%3Aorg.apache.tapestry.users+page:1+mid:5srufbsi5jsrdmu2+state:results

chris

Leon Derks wrote:
  

I want to update a select, based on a value from another select.

I have tried the OnEvent mixin from the t5components, but only the
first selected value is printed to the screen.
When I select another value after that, it always prints the first
selected value.

How can I do this with Tapestry 5 at the moment?

Here is a part of the java page code:

@OnEvent(component = "productSelect", value = "change")
   Object onProductSelectChanged(String value)
   {
System.out.println("Value: " + value);
   return null;
}

Leon




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



Re: T5 + DWR integration

2008-05-13 Thread Leon Derks

I don't have that topic.

Is it easy to integrate DWR with tapestry, without Spring?

Leon

Renat Zubairov wrote:

Hi

That's an interesting topic. Actually we had discussed it once with Igor,
and it seems that it shouldn't be too hard.
The question is which objects from the server-side you want to access from
DWR? If you will answer this question
then you can just start a DWR servlet in your web application and try to get
the objects of interest.

Renat

2008/5/13 Leon Derks <[EMAIL PROTECTED]>:

  

How easy is it to integrate T5 with DWR?

Are there examples of how to do this?
How do I need to configure the dwr.xml file?

Leon

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



update select based on first select

2008-05-13 Thread Leon Derks

I want to update a select, based on a value from another select.

I have tried the OnEvent mixin from the t5components, but only the first 
selected value is printed to the screen.
When I select another value after that, it always prints the first 
selected value.


How can I do this with Tapestry 5 at the moment?

Here is a part of the java page code:

@OnEvent(component = "productSelect", value = "change")
   Object onProductSelectChanged(String value)
   {
System.out.println("Value: " + value);
   return null;
}

Leon




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5 + DWR integration

2008-05-13 Thread Leon Derks

How easy is it to integrate T5 with DWR?

Are there examples of how to do this?
How do I need to configure the dwr.xml file?

Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Simple date format question

2008-05-09 Thread Leon Derks

Hi Marcus,

I couldn't find the jira issue. Do you have it? I will vote!

I found this example on 
:http://www.packtpub.com/article/tapestry-5-advanced-component


t:format="%d/%m/%y"/>


But this seems to be outdated, because it doesn't work.

Leon

Marcus wrote:

Leon,

No, you can't, :) it's only for output.
Don't forget to vote on JIRA!

Marcus

  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Simple date format question

2008-05-09 Thread Leon Derks

Okay,

I use Tapestry 5. But can I use the OutputLocale component also on a 
DateField?


Leon

Marcus wrote:

Hi Leon,

There is a JIRA about format parameter for DateField, vote!

To format a date output you can use OutputLocale component (
http://wiki.apache.org/tapestry/Tapestry5OutputLocaleNumber)

Marcus

  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Simple date format question

2008-05-09 Thread Leon Derks

How can I format my date in a date field
I want to use the format (dd/MM/). Does tapestry have some build in 
functionality for this?


And how can I format a date printing it to the screen like this:
${person.birthday}

Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



overwrite first element in select

2008-05-08 Thread Leon Derks

Hello

Is it possible to overwrite the first element in a select box?
At the moment this is an empty value, but can I for example overwrite 
this with "All"


Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



@Persist("flash") question

2008-05-08 Thread Leon Derks
In my page I have a the following function that is executed when I click 
on the search button in my page.


@Persist("flash")
private List importRequests = new ArrayList();

@OnEvent(component = "searchForm", value = "submit")
   public void doSearch() {
   importRequests = importDAO.findImportRequests(importRequestSearch);
   }

The results are only shown on my page when I use @Persist("flash") for 
the importRequests.


Is it possible to do this without an @Persist("flash")?

Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Autocomplete mixin + select event

2008-04-29 Thread Leon Derks

Thanks for the tips!

Leon

Steven Woolley wrote:
I've got it working by overriding the Autocomplete mixin and putting 
the following in the AfterRender (instead of using a json object).


String configS = "{indicator:'" + loaderId + "',frequency:.5,minChars:"
+ minChars
+ ",paramName:\"t:input\",afterUpdateElement:onChosen}";

_pageRenderSupport.addScript(
"new Ajax.Autocompleter('%s', '%s', '%s', %s);", id, 
menuId,

link.toURI(), configS);

Basically, in am just using a String instead of a JSON object to write 
out the autocomplete parameters... so I can do the quoting as I 
desire.  There is a JIRA for the quoting issue already, and hopefully 
when it's fixed I can go back to using the default implementation.

Hope that helps.
Steve

On Apr 29, 2008, at 12:21:31, Josh Canfield wrote:


In 5.0.11 I was unable to find a good extension point for the
autocomplete mixin. The scriptaculous Ajax.Autocompleter does support
updateElement and afterUpdateElement methods, but as far as I can tell
you can't get them into the configuration because the JSONObject
quotes its attributes (making the function into a string). If anyone
has solved that problem I'd love to hear about it.
http://wiki.script.aculo.us/scriptaculous/show/Ajax.Autocompleter

One option would be to add a change handler to the input field that
the autocomplete is populating. Something like:
$('mytextfield').observe('change', function(theEvent) { /* update
other fields */});

Hope that helps,
Josh

On Tue, Apr 29, 2008 at 4:47 AM, Leon Derks <[EMAIL PROTECTED]> 
wrote:
Does the autocomplete mixin fire some kind of event, after I have 
selected

an item from the autocomplete-menu?

Because I want to update other fields, based on the value that I 
selected.


How can I do this?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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



T5: Page + render parts based on previous action

2008-04-29 Thread Leon Derks

Hello

I want to render different parts in my page, based on an action in my 
previous page.


For example I have an "edit" section and an "add" section.

Based on the button I clicked in the previous page (edit or add button) 
I want to render the page with the corresponding section.


What is the best way to do this?

Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Autocomplete providecompletions + extra parameter

2008-04-29 Thread Leon Derks

Hello

Is it possible to add an extra context parameter to the 
providecompletions method?


For example like this:

List onProvideCompletionsFromAccountName(Long categoryId, String 
partial) {
List matches = productDAO.findByPartialNameInCategory(partial, 
categoryId);
...
}

How can I do this without an @Persist on my categoryId?

Leon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Autocomplete mixin + select event

2008-04-29 Thread Leon Derks
Does the autocomplete mixin fire some kind of event, after I have 
selected an item from the autocomplete-menu?


Because I want to update other fields, based on the value that I selected.

How can I do this?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



multiple context values

2008-04-28 Thread Leon Derks

How can I add multiple context values to an actionlink?

For example a productId and a categoryId?





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: JPA EntityManager + Tapestry Injection

2008-04-28 Thread Leon Derks
I have added an JPA entity manager to my AppModule, in the same way this 
is done for an HibernateSessionManager/Session in the tapestry-hibernate 
project.

See the code below for some details.

I inject this entity manager with the @Inject into my DAO object.
@Inject
private EntityManager entityManager

In my DAO method I use the injected entityManager to build queries like 
this:
entityManager.createNamedQuery("findProductsByCategory").setParameter("productCategory", 
ProductCategory.Lamps).getResultList();


But the problem is that the entityManager is null. It seems that the 
entityManager is not correctly injected into my DAO class.
Because when I use the entityManager directly in my Java Page class and 
execute the same code, everything works well.


Java Page code:
public void onActivate() {
  // this results in an null pointer exception.
  products = productDAO.findAllByCategory(ProductCategory.Lamps);

  //this is working.
  products = 
entityManager.createNamedQuery("findProductsByCategory").setParameter("productCategory", 
ProductCategory.Lamps).getResultList();

}

What do I need to do so I can use my DAO classes?

Leon


AppModule.java:
  /**
   * The JPAEnitityManagerService manages the entity manager on a 
per-thread/per-request basis. A [EMAIL PROTECTED] 
javax.persistence.EntityTransaction} is created

   * initially, and is committed at the end of the request.
   */
  @Scope(PERTHREAD_SCOPE)
  public static JPAEntityManagerService build(PerthreadManager 
perthreadManager) {
  JPAEntityManagerServiceImpl jpaService = new 
JPAEntityManagerServiceImpl();

  perthreadManager.addThreadCleanupListener(jpaService);
  return jpaService;

  }

  public static EntityManager build(JPAEntityManagerService jpaService, 
PropertyShadowBuilder propertyShadowBuilder) {
 return propertyShadowBuilder.build(jpaService, "entityManager", 
EntityManager.class);

  }

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: Select component + onchange()

2008-04-24 Thread Leon Derks

Hello

Is it possible to catch the onChange event from a select component in 
the java  page?


I would expect something like: onChangeFromSelect(long id) {}

Because I want to update information on my page, based on the value that 
is selected.


How can I do that?

Leon


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: onActivate() called twice

2008-04-21 Thread Leon Derks

Hi Davor,

Indeed, I have a BasePage that implements the public void onActivate() 
{}method.


In my subpage I also have implemented the public void onActivate() {}.
The code in onActivate() of my subpage is executed twice.

BASEPAGE:
public void onActivate() {
   String pageName = resources.getPageName();
   breadCrumbHolder.checkBreadCrumbForRemove(pageName);
}

SUBCLASS:
public void onActivate() {
   logger.debug("OnActivate ");
   products = productDAO.findAllByCategory(ProductCategory.Books);
   if (logger.isDebugEnabled()) {
   logger.debug("Nr of products: " + products.size());
   }
   }

This is the logging when I acces the page:

[DEBUG] Products OnActivate
[DEBUG] Products Nr of products:: 43
[DEBUG] Products OnActivate
[DEBUG] Products Nr of products:: 43

Leon

Davor Hrg wrote:

you have to be more specific,

same OnActivate method will not be called more than once in normal
circumastances,

but overriding onActivate from a base class I belive can cause this ...

some code would be useful.

Davor Hrg

On Mon, Apr 21, 2008 at 12:41 PM, Leon Derks <[EMAIL PROTECTED]> wrote:

  

Hi,

I noticed that my onActivate() is called twice.

I solved the problem by changing onActivate() into onActivate(Object[]
parameters).

Now it is only called once. But is this the way to do this or is there a
better way?

greetings,
Leon



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



T5: onActivate() called twice

2008-04-21 Thread Leon Derks

Hi,

I noticed that my onActivate() is called twice.

I solved the problem by changing onActivate() into onActivate(Object[] 
parameters).


Now it is only called once. But is this the way to do this or is there a 
better way?


greetings,
Leon



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: T5: onchange event from a select

2007-09-24 Thread Leon Derks

I want to be able to update a second select, based on the value in the first 
select box.

So I want to process it on the server-side, or with AJAX.

Is there a way to catch the onchange event in my java page?

JP

> Date: Sun, 23 Sep 2007 23:37:52 -0700
> From: [EMAIL PROTECTED]
> To: users@tapestry.apache.org
> Subject: Re: T5: onchange event from a select
> 
> Do you want it to be processed on the server side, or on the client side?
> For javascript, you should be able to just add an onchange attribute. If you
> want to add AJAX support, I'm not sure how to do that yet.
> 
> Josh
> 
> 
> On 9/23/07, Josh Penza <[EMAIL PROTECTED]> wrote:
> >
> > How can I catch the onchange event from a select in T5?
> >
> > are there examples?
> >
> 
> 
> 
> -- 
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.

_
De leukste video's en de beste concerten vind je op MSN Video
http://video.nl.msn.com/v/nl-nl/v.htm

t:type="loop" problem

2007-09-16 Thread Leon Derks

 
I have a problem with the t:type="loop" component in my Menu Component
 
Every link that is generated gets the id of the first Category. So the html 
source looks like this:
 

   
   CategoryA 
| 1   


 CategoryB | 70


 CategoryC | 110

 
Every categoryId is 1. (and it generates to much  tags).
 
When I click a category link the application thinks I always click the first 
category link.
 
This is what is in Menu.html
 

   
  ${category.name} | 
${category.id}
   

 
And this is what is in Menu.java
 
@Inject
@Service("categoryService")
private CategoryService categoryService;
 
private Category category;

 
Object onActionFromCategory(Long categoryId) {
  System.out.println("Category " + categoryId + " has been clicked");
  categoryDetail.setup(categoryId);
return categoryDetail;
}
 
public Collection getCategories() {
 return categoryService.getRootCategories();
}
 
public Category getCategory() {
 return category;
}

 
public void setCategory(Category category) {
 this.category = category;
}
_
Altijd al willen weten wat jouw naam betekent?
http://search.live.com/results.aspx?q=betekenis+anna&mkt=nl-nl&FORM=LVCP