1 Reply Latest reply: Feb 6, 2014 5:42 PM by Timo Hahn RSS

    Dynamic LOV driven by Model Layer

    HusainD

      Hi,

       

      ADF version: 12.1.2

      Build JDEVADF_12.1.2.0.0_GENERIC_130608.2330.6668

       

      My use case is to create choice lists dynamically on a view attribute based on an external table. The attribute's display properties are driven by another table. A dynamic component is used to show the view data as dynamic table.

       

      I am able to currently create dynamic columns and drive label, mandatory, hide/display etc attributes from external table. The UI also changes well when display type is date, number or text.

       

      For dropdowns I followed Jobinesh's blog Binaries: Enabling LOVs for Dynamic ViewObject attributes

      Most of it seems to be working, except that the method "buildListBindingDef" seems to be dropped from API. Or may be gone private. Because of this I am not able to attach the view accessor to an attribute via listBinding.

       

      Is there an alternate way to attach the list binding?

       

      Thanks,

      Husain

        • 1. Re: Dynamic LOV driven by Model Layer
          Timo Hahn

          The method you ate missing is a helper method Jobinesh write to create the list binding definition. It's part of the code you can download from his blog.

          Here is a copy

          /**

               * Helper for creating ListBindingDef

               * @param defMgr

               * @param listVOName

               * @param listBindingName

               * @param attribNames

               * @param listAttribNames

               * @param listDisplayAttribNames

               * @return

               */

              public static ListBindingDef buildListBindingDef(DefinitionManager defMgr,

                                                               String listVOName,

                                                               String listBindingName,

                                                               String[] attribNames,

                                                               String[] listAttribNames,

                                                               String[] listDisplayAttribNames) {

                  ListBindingDef lstbindingDef =

                      new ListBindingDef(defMgr, DefinitionObject.DEF_SCOPE_PERS);

                  lstbindingDef.setListVOName(listVOName);

                  lstbindingDef.setName(listBindingName);

                  lstbindingDef.setListRangeSize(-1);

                  lstbindingDef.setNullValueFlag(AbstractListBinding.LIST_ADD_NULL_NOWHERE);

                  lstbindingDef.setNullValueId("");

                  lstbindingDef.setAttrNames(attribNames);

                  lstbindingDef.setListDisplayAttrNames(listDisplayAttribNames);

                  lstbindingDef.setListAttrNames(listAttribNames);

                  return lstbindingDef;

              }

          Timo