Show/hide another input fields using h:selectBooleanCheckbox

后端 未结 3 560
猫巷女王i
猫巷女王i 2020-12-09 19:06

I am using JSF2 and Java to build a web application. I want to build a form like the one at the picture below:

\

3条回答
  •  心在旅途
    2020-12-09 19:15

    As suggested by amorfis, the idea of using Ajax here is not the best solution, as you will do a call to your server for a client-side manipulation.

    The best solution is to use Javascript to hide your component(s). For example, if all your labels and input texts are nested in a component, you can do that:

    
    
    
        
    
        
            ...
        
    
    

提交回复
热议问题