jsf drop down button
905946Apr 28 2013 — edited Apr 29 2013Hi,
i have added a drop down button on form having two value either regular or controller, i need to do if user select regular value it display a pop up select stock type is regular or if user select controller from the drop down then it should display a popup stock type is controller
//code in jsf file
<h:selectOneMenu value="#{user.scType}" id="som1" label="stoctType" onchange="display2();" >
<f:selectItems value="#{user.items}" id="si1" />
</h:selectOneMenu>
//bean file
@ManagedBean(name="user")
@SessionScoped
public class UserBean {
protected static Logger log = Logger.getLogger(UserBean.class);
private String scType;
List<SelectItem> items;
public UserBean() {
log.info("i am in user bean class");
items = new ArrayList<SelectItem>(2);
items.add(new SelectItem("Regular"));
items.add(new SelectItem("controlar"));
}
public void setItems(List<SelectItem> items) {
this.items = items;
}
public List<SelectItem> getItems() {
return items;
}
public void setScType(String scType) {
this.scType = scType;
}
public String getScType() {
log.info("my value"+scType);
return scType;
}
}
please help me with code
h:selectOneMenu how to set value to this componant , and then take necessary action on the selection of dropdown value either regular or controller
here i m facing another issue i m not able to check the log on console i.e log.info("my value"+scType); not able to see on jdeveloper console
if need more value please ask