On Wed, 2008-06-25 at 13:16 -0700, hbMailingList wrote:
> hello I'd like to invoke a method on my backing bean.  I realize that
> #{myBackingBean.myMethod} will not work..
> .so I tried
> #{myBackingBean[myMethod]} which also doesn't work.
> 
> Is there a way I can get around this?
> 
> If so can I pass a parameter into the method.

Action components (h:commandButton, h:commandLink) can invoke arbitrary
methods, via either their "action" attribute or a nested
f:actionListener tag.

Otherwise, EL expressions can only invoke javabean property
getter/setter methods. These cannot normally pass parameters. However
there are some options if you really want to. See here:
  http://wiki.apache.org/myfaces/Parameters_In_EL_Functions

However wanting to invoke arbitrary methods from your pages normally
suggests that your design is wrong somewhere. Maybe you should describe
the problem you have and see if someone else can suggest an alternative
approach.

Regards,
Simon

Reply via email to