On 11/5/05, Rahul Akolkar <[EMAIL PROTECTED]> wrote:
>
> On 11/5/05, Gary VanMatre <[EMAIL PROTECTED]> wrote:
>
> > > For the class substitution case that conditionally sets styleClass
> only if
> > > class is actually specified, either the element would need to be smart
> > > about knowing whether there was really a value there, or we could do a
> "set
> > > if" operation that only performed the set if the expression evaluated
> to
> > > something other than null or empty string:
> > >
> > > <set-if name="styleClass" value="#{shale:attribute.class}"/>
> > >
> > > where the expression would evaluate the value of the "class"
> attribute, if
> > > it exists, and perform the set only if a non-null non-empty-string
> value was
> > > returned by evaluating the expression.
> > >
> >
> > That's a interesting idea. Or, we might be able to use a new
> "bindingType" in the "set" node. But, a "set-if" might be more descriptive.
> >
> <snap/>
>
> Does that mean there are scenarios where one wouldn't want the
> behavior in Craig's first suggestions (a "smart" if)? If there aren't,
> IMO, it makes sense to do that since this is one of the cases where
> less is more and not having to remember to differentiate between <set>
> and <set-if> is a good thing while authoring.


Good point. I cannot think of any use cases for the non-conditional setting
off the top of my head, but a "conditional pass-through only if the origin
is not null" seems like a very common case.

Craig


-Rahul
>
>
> > > Craig
> > >
> >
> > Gary
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to