简体   繁体   English

切换jsf组件而不支持bean?

[英]Toggle jsf components without backing beans?

How can I use (eg ajax) to show a specific jsf element if I click the button where the ajax tag belongs to? 如果我单击ajax标记所属的按钮,如何使用(例如ajax)显示特定的jsf元素? But without having to use any backing bean, just by JSF components without JavaScript? 但是,无需使用任何支持bean,仅由不带JavaScript的JSF组件即可吗? Is that possible? 那可能吗?

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) (未测试)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM