Hello All
Hope Everyone knows about list of values and autoSuggest beahvior of ADF Framework,
For those who are new to framework can look at this post
ADF Basics : Implementing auto suggest behavior in ADF Faces lov (list of values)
Blog about Oracle ADF, JDeveloper, PL/SQL, Java, JavaScript, jQuery and Other Web Technologies
commandToolbarButton
appears in the LOV popup dialog box with a icon, this button's action triggers custom popUp (i have added before)import oracle.adf.model.BindingContext; import oracle.binding.BindingContainer; import oracle.binding.OperationBinding; /**Method to get Bindings of current page * @return */ public BindingContainer getBindings(){ return BindingContext.getCurrent().getCurrentBindingsEntry(); } /**Method to execute OperationBinding * @param operation * @return */ public OperationBinding executeOperation(String operation){ return getBindings().getOperationBinding(operation); } /**Method to create new Department * @param actionEvent */ public void createDeptAction(ActionEvent actionEvent) { executeOperation("CreateInsert").execute(); }
import javax.faces.event.ActionEvent; import oracle.adf.model.BindingContext; import oracle.binding.BindingContainer; import oracle.jbo.uicli.binding.JUCtrlListBinding; public BindingContainer getBindings() { return BindingContext.getCurrent().getCurrentBindingsEntry(); } public void getSelectedValue(ActionEvent actionEvent) { JUCtrlListBinding listBindings = (JUCtrlListBinding)getBindings().get("DepartmentsView1"); Object str[] = listBindings.getSelectedValues(); for (int i = 0; i < str.length; i++) { System.out.println(str[i]); } }
/**Method to get BindingContainer of page * @return */ public BindingContainer getBindings() { return BindingContext.getCurrent().getCurrentBindingsEntry(); } /**Method to get Selected Values * @param actionEvent */ public void getSelectedValue(ActionEvent actionEvent) { JUCtrlListBinding listBindings = (JUCtrlListBinding)getBindings().get("DepartmentsView1"); Object str[] = listBindings.getSelectedValues(); StringBuilder saveMsg = new StringBuilder("<html><body><b><p style='color:red'>Selected Departments are-</p></b>"); saveMsg.append("<ul>"); for (int i = 0; i < str.length; i++) { System.out.println(str[i]); saveMsg.append("<li> <b>" + str[i].toString() + "</b></li>"); } saveMsg.append("</ul><br>"); saveMsg.append("</body></html>"); FacesMessage msg = new FacesMessage(saveMsg.toString()); FacesContext.getCurrentInstance().addMessage(null, msg); }
<af:selectOneChoice value="#{bindings.LocationId.inputValue}" label="#{bindings.LocationId.label}" required="#{bindings.LocationId.hints.mandatory}" shortDesc="#{bindings.LocationId.hints.tooltip}" id="soc1" contentStyle="width:150px;color:red;"> <af:forEach items="#{bindings.Locations1.rangeSet}" var="list"> <af:selectItem label="#{list.City}" id="si1" value="#{list.LocationId}" disabled="#{ (bindings.DepartmentId.inputValue==100 and (list.LocationId==1000 || list.LocationId==1300)) || (bindings.DepartmentId.inputValue==110 and (list.LocationId==1500 || list.LocationId==1600 || list.LocationId==1700 || list.LocationId==1800 || list.LocationId==1900))}"/> </af:forEach> </af:selectOneChoice>