FYI: You can pass method bindings in facelets, it just requires a
little bit of work.

I posted a blog on this:
http://andrewfacelets.blogspot.com/2006/06/creating-composite-controls-with-jsf.html

Facelets gives you great power for composite controls. It is much
easier to build them that way then to build them programatically.

-Andrew

On 7/14/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> Mike Kienenberger a écrit :
> > Composite components are a lot easier if you add facelets into the mix
> > as it can all be done in templating code.

On 7/13/06, delbd <[EMAIL PROTECTED]> wrote:
> No, my composition will not be simple in the end  and i need to provide
> a simple to use taglib. (with elements like '<mylib:myComponent
> value=.... id=..../>'

Well, facelets allows you to define a tag for your included template
file it looks just like any other component.   But if you're
developing a public library, you won't want to restrict it to
facelets.

> Thanks for you example, it seems you are going a similar way to mine

Just keep in mind that it's a year old, and that I ended up dropping
it shortly thereafter for a trivial facelets implementation, so while
it's an example, it's probably not a perfect one.

> If i might ask an additionnal question, my component will be a composite
> component containing fields but also actions. I need somehow to be able
> to know on which bean the action will be invoked. I thought about doing
> it this way: action="#{theBean.theAction()}". The problem for my
> composite component is that "theBean" is the result of value field of my
> component tag. So i don't really know how my 'createChildrens()' method
> is supposed to initialize  the action parameter of HtmlCommandButton. I
> tried to set an intermediate bean in the request attributes and
> reference it in action, but, while it works for input fields value, this
> intermediate field is not available at action method evaluation time.
> Have you experience with composite component containg actions?

I would create your own custom MethodBinding class.  I think I created
a custom class in my example as well.    Pass your action as a
ValueBinding, but assign your custom class as the methodBinding for
the button.   Then have your custom class compute a real method
binding using the ValueBinding of the action name plus the value of
the bean name.

Reply via email to