Search This Blog

Reading Values From Resource Bundle ADF - Java Code

Reading Values From Resource Bundle ADF - Java Code


ResourceBundle res = ResourceBundle.getBundle("Resource_FileName");
String value=res.getString(" keyOne");

Operator Binding in ADF - Call Client method in BC from View


 
Operator Binding in ADF -  Call Client method in BC from View


          

Calling Client method from ViewControllerProject 
 
            BindingContext bcx = BindingContext.getCurrent();
            DCBindingContainer bc = (DCBindingContainer)bcx.getCurrentBindingsEntry();
            
            // Method Name 
            OperationBinding opb = (OperationBinding)bc.getOperationBinding("TestMethod");
           
             //  Arguments in method
             opb.getParamsMap().put("arg", "Moorthi");
             opb.invoke();



AM Client Method :


    public void TestMethod( String arg){
        // Add your logic
    }
 


Client Method exposed in data control


Select one Choice ADF - ValueChange Event ( Selected Values From Drop down )

   
 Select one Choice ADF - ValueChange Event ( Selected Values From Drop down ) 


Most of the developers face issue when using Select One Choice. Index display rather than selected Value.  





Jspx Code :
 

  <af:selectOneChoice value="#{bindings.DepartmentId.inputValue}"
                            label="#{bindings.DepartmentId.label}"
                            required="#{bindings.DepartmentId.hints.mandatory}"
                            shortDesc="#{bindings.DepartmentId.hints.tooltip}"
                            id="soc1" autoSubmit="true"
                            valueChangeListener="#{pageFlowScope.ValueMbean.ValueChnageMethod}">
          <f:selectItems value="#{bindings.DepartmentId.items}" id="si1"/>
        </af:selectOneChoice>


 Java Code :

 public void ValueChnageMethod(ValueChangeEvent valueChangeEvent) {
  

         System.out.println(" Selected Index ::: " + valueChangeEvent.getNewValue());

         BindingContainer bindings =BindingContext.getCurrent().getCurrentBindingsEntry();
         JUCtrlListBinding listBinding =(JUCtrlListBinding)bindings.get("DepartmentId");
         listBinding.setSelectedIndex(Integer.parseInt(valueChangeEvent.getNewValue().toString()));
         Row selectedValue = (Row) listBinding.getSelectedValue();

        System.out.println(" Selected Value ::: " +selectedValue.getAttribute("DepartmentId"));
    }



OutPut :


 Selected Index::: 11
 Selected Value ::: 100

 Selected Index::: 17
  Selected Value ::: 30

 Selected Index::: 23
 Selected Value :::  50