Preventing context from passivate

2016-12-01 Thread Adam X
Hello!

In my Layout I have action/event links (logout, etc). If a page inside
a layout passivates context, layout links get that context. But I
don't want them to. How do you prevent links from getting page
passivated context?

Cheers,
Adam

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



Re: Custom validator default error message

2016-12-01 Thread Nathan Quirynen

Hmm, I don't need a custom validator annotation.

Example:

I just created a class that extends AbstractValidator and contributed 
this to the FieldValidatorSource in my module:


public class MaxBigDecimal extends 
AbstractValidator {


private static final String MESSAGE_KEY = "max-bigdecimal";

public MaxBigDecimal(JavaScriptSupport javaScriptSupport) {
super(BigDecimal.class, BigDecimal.class, MESSAGE_KEY, 
javaScriptSupport);

}

...

}

This way I can add the validator using the @Validate annotation or 
validate parameter:


@Validate("required, max-bigdecimal=1")


This all works fine, I can even set the message in my page/component for 
a field with id "fldRate" by setting the following in the message catalog:


fldRate-max-bigdecimal-message=Some error message

But if I don't "override" this like above it says " [[missing key: 
max-bigdecimal]]". So I just want to be able to set this default error 
message in the module contributing this validator. Normally I would have 
to add a ValidationMessages.properties file containing 
"max-bigdecimal=Some default error message" and contribute this file to 
the ValidationMessagesSource service. But this service does not exist 
anymore in 5.4 and just adding the file also doesn't seem to do anything.


Or should I now go with the custom validator annotation way as in your 
example to get it all working?


Nathan

On 01/12/16 13:13, JumpStart wrote:

Does this help?


http://jumpstart.doublenegative.com.au/jumpstart7/examples/input/contributingvalidators
 


Cheers,

Geoff


On 1 Dec 2016, at 7:27 PM, Nathan Quirynen  wrote:

Hi,

I have a Tapestry module contributing some custom validator implementations. 
How can i set default validation error messages for these in Tapestry 5.4?

In older Tapestry versions I think you had to contribute a message catalog to 
the ValidationMessagesSource service, but this does not exist in Tapestry 5.4.

Nathan


-
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: Preventing context from passivate

2016-12-01 Thread Chris Poulsen
I would expect action/event links to have page context as they are a part
of the page where they live (for example a logout event link click, would
cause tapestry to activate the containing page and then trigger the logout
event handler on that page).

Things like logout I would handle using a plain html link (in case of a
filter-based system) or using a page link if it is an actual tapestry page
- in most cases it does not make sense to use links that activate their
containing page if you are just interested in leaving it.

-- 
Chris

On Thu, Dec 1, 2016 at 4:21 PM, Adam X  wrote:

> Hello!
>
> In my Layout I have action/event links (logout, etc). If a page inside
> a layout passivates context, layout links get that context. But I
> don't want them to. How do you prevent links from getting page
> passivated context?
>
> Cheers,
> Adam
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Custom validator default error message

2016-12-01 Thread JumpStart
Does this help?


http://jumpstart.doublenegative.com.au/jumpstart7/examples/input/contributingvalidators
 


Cheers,

Geoff

> On 1 Dec 2016, at 7:27 PM, Nathan Quirynen  
> wrote:
> 
> Hi,
> 
> I have a Tapestry module contributing some custom validator implementations. 
> How can i set default validation error messages for these in Tapestry 5.4?
> 
> In older Tapestry versions I think you had to contribute a message catalog to 
> the ValidationMessagesSource service, but this does not exist in Tapestry 5.4.
> 
> Nathan
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 



Firefox: FormFragment hidden fields disabled

2016-12-01 Thread Marvin Monroe
Hi,
so today I found a weird bug: Firefox stores the disabled attribute of
hidden formfragments between page reloads.
It's the browser's autocomplete feature that can be turned off by adding
the attribute autocomplete="off" to either form or input field.
This behavior prevents form fields from being set correctly in the
page/component as the field's hidden action sink command is not transmitted.

I could add more details but the best fix would be if the form fragment
would create its hidden action sink fields with autocomplete="off".

Or is there another workaround?
Anyway, just wanted to share this, since it cost me some time debugging ;)

Best
Christian


Custom validator default error message

2016-12-01 Thread Nathan Quirynen

Hi,

I have a Tapestry module contributing some custom validator 
implementations. How can i set default validation error messages for 
these in Tapestry 5.4?


In older Tapestry versions I think you had to contribute a message 
catalog to the ValidationMessagesSource service, but this does not exist 
in Tapestry 5.4.


Nathan


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