ADF

Getting the ID of the selected item in Choice
ValueChangeListener handler:
public void changeAipsUser(ValueChangeEvent valueChangeEvent) {
  BindingContext bindingctx = BindingContext.getCurrent();
  BindingContainer bindings = null;
  bindings = bindingctx.getCurrentBindingsEntry();
  DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
  DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("LOVVO1Iterator");
  Row temp = dciter.getRowAtRangeIndex((Integer.parseInt(valueChangeEvent.getNewValue().toString())));
  String id = temp.getAttribute("Id").toString();
}
Opening a popup window when navigating to a page
Override the initBean method:
@PostConstruct
public void initBean() {
   Boolean p = false;
   p = (Boolean)JSFUtils.getFromSession("SomeName");
   if (p == null || p == false) {
        p = false;
   }
   JSFUtils.putToSession("SomeName", Boolean.valueOf(true));

   if (!p) {
     vo.executeEmptyRowSet(); //vo - element of the class
     JS.javaScriptEvaluate("$(document).ready(function() {AdfPage.PAGE.findComponent(\"pt1:pc1:p1\").show();})"); // path to the element
        }
}
Closing a popup window when clicking on an arbitrary button
The solution is to implement a JavaScript script that emulates clicking the form's close button and attaches a listener
fg
function closeQryId1() {
             jQuery(document.getElementById('pt1:pc1:qryId1::search')).click(function() {document.getElementById('pt1:pc1:pw1::close').click()});    
         }
Forced update of the selected item in valueChangeListener
Without forced updating, the variable in the binding will contain the old value of the associated visual component. We update it:
UIComponent component = event.getComponent();
component.processUpdates(FacesContext.getCurrentInstance());
Clearing bind variables by ViewCriteria
AppModuleImpl mod = (AppModuleImpl)ADFUtils.getBindingApplicationModule();
MyVO vo = mod.getMyVO1();
ViewCriteria vc = null;
vc = vo.getViewCriteria("MyVOCriteria");
VariableValueManager vvm = vc.ensureVariableManager();
vvm.clearVariables();
for (Variable var : vvm.getVariables()) {
     vvm.setVariableValue(var.getName(), null);
} 
GET request from VO attributes
public String getVOParamsAsURL {
    String AMP = "&";
    String EQ = "=";
    String LOV_SIGN = "LOV";
    String NULL_SIGN = "null";
    MyVOImpl vo = am.getMyVO1();
    MyVORowImpl row = (MyVORowImpl)vo.getCurrentRow();

    StringBuffer URL = new StringBuffer();      

    URL.append("/myapp/get?");
 for (int i = 0; i < row.getAttributeCount(); i++)
     if (row.getAttributeNames()[i].indexOf(LOV_SIGN) == -1)
         if (row.getAttributeValues()[i] != null)
             if (row.getAttributeValues()[i].toString().indexOf(NULL_SIGN) == -1)
                 URL.append(AMP + row.getAttributeNames()[i] + EQ + row.getAttributeValues()[i]);
    return URL.toString();
}
ceo@thomsonslegacy.com

We customize Oracle e-Business Suite R12 modules with Oracle Applications Framework and providing Oracle ADF based solutions


© Thomsonslegacy.com, 2025.
If you publish the materials of the site, the reference to the source is obligatory. The site uses cookies.