Guest User

Untitled

a guest
Feb 19th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. There are multiple ways to get the value of Selectonechoice's value,and the most simple way is using this method:
  2.  
  3.  
  4.  
  5. public void reff(ValueChangeEvent valueChangeEvent) {
  6. DCBindingContainer dc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
  7. DCIteratorBinding iter=dc.findIteratorBinding("EmployeesView1Iterator");
  8. AttributeBinding attr = (AttributeBinding)dc.getControlBinding("deptid1");
  9. iter.getViewObject().setWhereClause("department_id=:maindeptid");
  10. iter.getViewObject().defineNamedWhereClauseParam("maindeptid", null, null);
  11. iter.getViewObject().setNamedWhereClauseParam("maindeptid", valueChangeEvent.getNewValue());
  12. System.out.println("Old value is"+attr);
  13. iter.executeQuery();
  14.  
  15.  
  16. My Selectonechoice component's source:
  17.  
  18. <af:selectOneChoice value="#{bindings.deptid1.inputValue}"
  19. label="#{bindings.DepartmentId.label}"
  20. required="#{bindings.DepartmentId.hints.mandatory}"
  21. shortDesc="#{bindings.DepartmentId.hints.tooltip}" id="soc1"
  22. autoSubmit="true" valueChangeListener="#{refresh.reff}">
  23. <f:selectItems value="#{bindings.DepartmentId.items}" id="si1"/>
  24. </af:selectOneChoice>
Add Comment
Please, Sign In to add comment