On 11/5/05, Gary VanMatre <[EMAIL PROTECTED]> wrote:
>
<snip/>
> > Note that my original example should probably have been
> >
> > #{shale:managed-bean-name}
> >
> > because we're not actually talking about an attribute here.
> >
> > The issue you raise, of course, is that you're actually trying to replace
> > part of the expression itself (rather than the whole thing). But, maybe that
> > isn't really necessary? Maybe the evaluaton of the "shale:managed-bean" part
> > of the following expression could return the real managed bean *instance*,
> > instead of just it's name? Then you'd just use:
> >
> >  set name="action" value="#{shale:managed-bean.saveAction}"/>
> >
> > on a button component, without needing any textual substitution of the
> > expression itself.
> >
>
> Ok, I see what you mean now.  That looks good, has some style.
>
<snip/>

Agreed, I'm afraid I was a little lost in all the @ signs that were
previously around, it almost seemed to be another programming model. I
see this has the benefit of having the look and feel of EL with a
couple of implicit maps to refer to Shale managed beans and
attributes. Feels like home.


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

-Rahul


> > Craig
> >
>
> Gary
>
>

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

Reply via email to