[seam-dev] Invalid field decorator

Pete Muir pmuir at bleepbleep.org.uk
Fri Jun 4 05:40:46 EDT 2010


Seems to me that s:decorate is more powerful than a facet, as it gave you the full templating power of facelets. If we could somehow automatically attach an s:decorate to each input field, I think that would be very nice.

BTW I think s:decorate still has more than JSF 2 right, does JSF 2 give you the #{required} boolean in EL from the required attribute on h:input? (It does give you the ability to query if there are validation errors and what messages are queued for a field IIRC).

On 4 Jun 2010, at 06:36, Nicklas Karlsson wrote:

> I'm thinking of the case where I have 20+ fields on a page and would like to add an img-icon before the invalid field and the message below the field without having to stick something around every single field (or nest all field in one s:validateAll type construct). Ideally, I would just like to have one facet on the page (with EL-switching between info and warn icons on a per-field basis). Of course, if we want half the field to follow another facet we need some configuring somewhere(tm)
> 
> On Fri, Jun 4, 2010 at 12:43 AM, Lincoln Baxter, III <lincolnbaxter at gmail.com> wrote:
> Continuing on seam-dev:
> 
> It would technically be possible to alter the UIViewRoot during the PreRenderViewEvent. But... explain to me again the benefit of doing this? Not doubting you, just would like to know the end-value you are trying to provide, since we already have UIInputContainer for building composite components that can be used to decorate input fields.
> 
> --LB
> 
> 
> On Thu, Jun 3, 2010 at 5:27 PM, Nicklas Karlsson <nickarls at gmail.com> wrote:
> (continuing from my brainstorming session with Lincoln on #seam-dev)
> 
> Do you think it would be possible to have automatic invalid field decoration for the seam-faces module in the same style has
> Seam 2 had for s:decorate?
> 
> you would place a 
> 
> <facet name="aroundInvalidField>
>    html code with (perhaps) markers for the component and message
> </facet>
> 
> on the page and then (in a phase listener?) check for components with messages and decorate them with the facet contents in the UIView somehow?
> Not sure how it fits the JSF lifecycle to go manipulate the tree at that point, though. But it would be handy to be able to do it without the s:decorate stuff.
> 
> ---
> Nik
> 
> 
> 
> -- 
> Lincoln Baxter, III
> http://ocpsoft.com
> http://scrumshark.com
> "Keep it Simple"
> 
> 
> 
> -- 
> ---
> Nik




More information about the seam-dev mailing list