开发者

Composite Components - send more than one f:setPropertyActionListener jsf2

开发者 https://www.devze.com 2023-01-07 17:47 出处:网络
I am trying to create a custom component that recieves a link and adds style class. In the original link, that the user may have f:setPropertyActionListener more than once.

I am trying to create a custom component that recieves a link and adds style class.

In the original link, that the user may have f:setPropertyActionListener more than once.

I don't want to create propertyActionListenerValue1 and propertyActionListenerTarget1 propertyActionListenerValue2 propertyActionListenerTarget2 etc for each one.

How can I recieve it in something like actionProperties="name:Daniel,surname:Smith" where name and surname represent name and Daniel and Smith represent value and in my compo开发者_JS百科site element I will be able to send it as

<f:setPropertyActionListener value="name" target="Daniel" /> for each of them?

It can be that the user will send an object as name, and not only a String


In JSF 2.0 you can use the recent EL (2.2), which allows you to pass arguments to methods. I.e.

 action="bean.method('value2', 'value2')"

So no need of action listeners.

0

精彩评论

暂无评论...
验证码 换一张
取 消