3 Replies Latest reply: Sep 11, 2013 8:47 AM by user9546252 RSS

    dynamic:form not refreshing

    aalopez
      Hi. I'm using JDev 11.1.2.3 and I want to use the dynamic form component as in Shay's blog:

      [https://blogs.oracle.com/shay/entry/creating_dynamic_adf_input_forms|https://blogs.oracle.com/shay/entry/creating_dynamic_adf_input_forms]

      However, instead of having one page to write the SQL and another page to render the dynamic form, I want to do it all in the same page. I have already developed this functionality but I have to press the button that executes the method in the AM twice in order to see the components in the dynamic form. It is something in the view becasue when I debug the AM method that changes the dynamic View Object and I can see it is executing correctly.

      =======================================================
      My AM method:

      ...
      public void createDynamicVO(String sql) {
      ViewDefImpl reportParamsViewDef = new ViewDefImpl("model.view.DynamicVO1");
      reportParamsViewDef.setQuery(sql);
      reportParamsViewDef.setFullSql(true);
      reportParamsViewDef.resolveDefObject();
      reportParamsViewDef.registerDefObject();

      oracle.jbo.server.ViewObjectImpl vo = this.getDynamicVO1();
      vo.remove();

      vo = (oracle.jbo.server.ViewObjectImpl)this.createViewObject("DynamicVO1", reportParamsViewDef);
      vo.executeQuery();
      }
      ...

      =======================================================

      My Page:

      ...
      <af:form id="f1">
      <af:panelStretchLayout id="psl1">
      <f:facet name="center">
      <af:panelHeader text="panelHeader 1" id="ph1" partialTriggers="cb1">
      <dynamic:form value="#{bindings.DynamicVO1Iterator}" id="f2"/>
      </af:panelHeader>
      </f:facet>
      <f:facet name="top">
      <af:panelFormLayout id="pfl1">
      <af:inputText value="#{bindings.sql.inputValue}" label="#{bindings.sql.hints.label}"
      required="#{bindings.sql.hints.mandatory}"
      columns="#{bindings.sql.hints.displayWidth}"
      maximumLength="#{bindings.sql.hints.precision}"
      shortDesc="#{bindings.sql.hints.tooltip}" id="it1">
      <f:validator binding="#{bindings.sql.validator}"/>
      </af:inputText>
      <af:commandButton actionListener="#{bindings.createDynamicVO.execute}"
      text="createDynamicVO" disabled="#{!bindings.createDynamicVO.enabled}"
      id="cb1"/>
      </af:panelFormLayout>
      </f:facet>
      </af:panelStretchLayout>
      </af:form>

      ..

      =======================================================

      My pageDef:

      ...

      <executables>
      <iterator Binds="DynamicVO1" RangeSize="25" DataControl="AppModuleDataControl" id="DynamicVO1Iterator"/>
      <variableIterator id="variables">
      <variable Type="void" Name="createDynamicVO_return" IsQueriable="false" IsUpdateable="0"
      DefaultValue="${bindings.createDynamicVO.result}"/>
      <variable Type="java.lang.String" Name="createDynamicVO_sql" IsQueriable="false"/>
      </variableIterator>
      </executables>
      <bindings>
      <methodAction id="createDynamicVO" RequiresUpdateModel="true" Action="invokeMethod" MethodName="createDynamicVO"
      IsViewObjectMethod="false" DataControl="AppModuleDataControl"
      InstanceName="data.AppModuleDataControl.dataProvider"
      ReturnName="data.AppModuleDataControl.methodResults.createDynamicVO_AppModuleDataControl_dataProvider_createDynamicVO_result">
      <NamedData NDName="sql" NDType="java.lang.String" NDValue="${bindings.createDynamicVO_sql}"/>
      </methodAction>
      <attributeValues IterBinding="variables" id="sql">
      <AttrNames>
      <Item Value="createDynamicVO_sql"/>
      </AttrNames>
      </attributeValues>
      </bindings>

      ...


      =======================================================

      Any ideas?

      Regards,


      Alexis