在没有支持bean的情况下切换jsf组件?

时间:2022-09-17 10:58:29

How can I use (eg ajax) to show a specific jsf element if I click the button where the ajax tag belongs to? But without having to use any backing bean, just by JSF components without JavaScript? Is that possible?

如果单击ajax标签所属的按钮,如何使用(例如ajax)显示特定的jsf元素?但是不必使用任何支持bean,只需要没有JavaScript的JSF组件?那可能吗?

1 个解决方案

#1


0  

Luiggi is right , You better use js for client side toggling

Luiggi是对的,你最好使用js进行客户端切换

But , I think you can bind like this

但是,我认为你可以像这样绑定

<h:inputText id="first" binding="#{someViewButNonManagedBeanObject}"`... 

and than

<h:inputText id="second" render="#{no empty someViewButNonManagedBeanObject}"`...

or

<h:inputText id="second" render="#{someViewButNonManagedBeanObject.value eq 'wow'}"`...

(Not tested)

#1


0  

Luiggi is right , You better use js for client side toggling

Luiggi是对的,你最好使用js进行客户端切换

But , I think you can bind like this

但是,我认为你可以像这样绑定

<h:inputText id="first" binding="#{someViewButNonManagedBeanObject}"`... 

and than

<h:inputText id="second" render="#{no empty someViewButNonManagedBeanObject}"`...

or

<h:inputText id="second" render="#{someViewButNonManagedBeanObject.value eq 'wow'}"`...

(Not tested)