java - JSF: Default selection of all values in -
java - JSF: Default selection of all values in <h:selectManyListbox/> -
i working in jsf 2.0. rich:popup based on user selection adding values h:selectmanylistbox using ajax , re-render enclosing outputpanel display values binding list. able successfully. want values nowadays in selectedmanylistbox should selected default user not suppose select again.
code selectmanylistbox :
<a4j:outputpanel id="grouptablepanel"> <h:selectmanylistbox size="3" style="width:190px; height:100px;" id="table" value="#{usercreatebean.selectedgroups}"> <f:selectitems value="#{usercreatebean.assignedgroups}"></f:selectitems> </h:selectmanylistbox> </a4j:outputpanel>
i explored documentation of same, tried writing own javascript code. looking firebug, not able see associated class selected values in selectmanylistbox. onchange event of same gets executed when manually create alter in same, or click on it. know which event appropriate work kind of requirement? please guide me how can accomplish functionality. in advance.
i thinking much it, in end turned out easy. javascript method helped me solve same.
function defaultusersselect(id){ var select = document.getelementbyid(id); (var = 0; < select.length; i++){ select.options[i].setattribute("selected","selected"); } }
java javascript java-ee jsf-2
Comments
Post a Comment