Forum Stats

  • 3,759,903 Users
  • 2,251,613 Discussions
  • 7,870,859 Comments

Discussions

inputComboboxListOfValues Reseting Fields on Row

Eric K.
Eric K. Member Posts: 173 Bronze Badge

Hallo Everyone,

My JDev Version is 12.2.1.4

I have an issue with inputComboboxListOfValues where it resets InputText components values within a row.

When I click a button, I called CreateInsert on a table so I enter the values in the inputText component, however, while still in the same new row, when I select a value from the inputComboboxListOfValues, it resets the value in the inputText. This happens only with tables and not panelFormLayout.

Any ideas on how this can be prevented?

Below is the column with inputComboboxListOfValues

<af:column sortProperty="#{bindings.ScItemCatgVO.hints.ImcItemCodeGen.name}"

      sortable="true"

      headerText="#{viewcontBundle.ITEM_NO_GEN_CODE}"

      filterable="true"

      id="c9"

      width="250">

<af:inputComboboxListOfValues id="imcItemCodeGenId"

               popupTitle="#{viewcontBundle.ITEM_NO_GEN_CODE}"

               value="#{row.bindings.ImcItemCodeGen.inputValue}"

               model="#{row.bindings.ImcItemCodeGen.listOfValuesModel}"

               required="#{bindings.ScItemCatgVO.hints.ImcItemCodeGen.mandatory}"

               columns="#{row.bindings.ImcItemCodeGen.hints.displayWidth}"

               shortDesc="#{bindings.ScItemCatgVO.hints.ImcItemCodeGen.tooltip}"

               contentStyle="width:200px;height:32px;font-weight:bold;"

               styleClass="icon-dropdown-icon-standard">

<f:validator binding="#{row.bindings.ImcItemCodeGen.validator}"/>

<af:autoSuggestBehavior minChars="2"

            suggestItems="#{row.bindings.ImcItemCodeGen.suggestItems}"/>

</af:inputComboboxListOfValues>

</af:column>


Thank you.

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,566 Red Diamond

    inputText? I don't see any inputText in your code sample.

    Do you have a reproducible test case (built on the HR DB schema)?


    Timo


  • Eric K.
    Eric K. Member Posts: 173 Bronze Badge

    Hi Timo,

    Thank you for your response.

    Here's the code:

    <af:panelCollection id="pc1">

                  <f:facet name="toolbar">

                    <af:toolbar id="Xt10d">

                      <af:panelGroupLayout id="pgl67" layout="horizontal">

                        <af:commandMenuItem text="ADD" id="cb9"

                                  actionListener="#{pageFlowScope.Employees.addNewEmployee}"/>

                      </af:panelGroupLayout>

                    </af:toolbar>

                  </f:facet>

                  <af:table value="#{bindings.EmployeesView1.collectionModel}" var="row"

                       rows="#{bindings.EmployeesView1.rangeSize}"

                       emptyText="#{bindings.EmployeesView1.viewable ? 'No data to display.' : 'Access Denied.'}"

                       rowBandingInterval="0"

                       selectedRowKeys="#{bindings.EmployeesView1.collectionModel.selectedRow}"

                       selectionListener="#{bindings.EmployeesView1.collectionModel.makeCurrent}"

                       rowSelection="single" fetchSize="#{bindings.EmployeesView1.rangeSize}"

                       filterModel="#{bindings.EmployeesView1Query.queryDescriptor}" filterVisible="true"

                       queryListener="#{bindings.EmployeesView1Query.processQuery}" varStatus="vs"

                       id="t1" binding="#{pageFlowScope.Employees.empsTable}">

                    <af:column sortProperty="#{bindings.EmployeesView1.hints.LastName.name}"

                          filterable="true" sortable="true"

                          headerText="#{bindings.EmployeesView1.hints.LastName.label}" id="c3">

                      <af:inputText value="#{row.bindings.LastName.inputValue}"

                             label="#{bindings.EmployeesView1.hints.LastName.label}"

                             required="#{bindings.EmployeesView1.hints.LastName.mandatory}"

                             columns="#{bindings.EmployeesView1.hints.LastName.displayWidth}"

                             maximumLength="#{bindings.EmployeesView1.hints.LastName.precision}"

                             shortDesc="#{bindings.EmployeesView1.hints.LastName.tooltip}"

                             id="it3">

                        <f:validator binding="#{row.bindings.LastName.validator}"/>

                      </af:inputText>

                    </af:column>

                    <af:column sortProperty="#{bindings.EmployeesView1.hints.DepartmentIdXx.name}"

                          sortable="true"

                          headerText="#{bindings.EmployeesView1.hints.DepartmentIdXx.label}"

                          filterable="true" id="c4">

                      <af:inputComboboxListOfValues id="departmentIdXxId"

                                     popupTitle="Search and Select: #{bindings.EmployeesView1.hints.DepartmentIdXx.label}"

                                     value="#{row.bindings.DepartmentIdXx.inputValue}"

                                     model="#{row.bindings.DepartmentIdXx.listOfValuesModel}"

                                     required="#{bindings.EmployeesView1.hints.DepartmentIdXx.mandatory}"

                                     columns="#{row.bindings.DepartmentIdXx.hints.displayWidth}"

                                     shortDesc="#{bindings.EmployeesView1.hints.DepartmentIdXx.tooltip}">

                        <f:validator binding="#{row.bindings.DepartmentIdXx.validator}"/>

                        <af:autoSuggestBehavior minChars="2"

                                    suggestItems="#{row.bindings.DepartmentIdXx.suggestItems}"/>

                      </af:inputComboboxListOfValues>

                    </af:column>

                  </af:table>

                </af:panelCollection>

    This is the method under (addNewEmployee)

      public void addNewEmployee(ActionEvent actionEvent) {

        try {

          DCIteratorBinding dciter = bindings.findIteratorBinding("EmployeesView1Iterator");

          ViewObject vo = dciter.getViewObject();

          Row newRow = vo.createRow();

          newRow.setNewRowState(Row.STATUS_INITIALIZED);

          vo.insertRow(newRow);

          dciter.setCurrentRowWithKey(newRow.getKey().toStringFormat(true));

          AdfFacesContext.getCurrentInstance().addPartialTarget(empsTable);

        } catch (Exception exp) {

          exp.printStackTrace();

        }

      }

    NB: I've removed other fields for readability

    What I have also realized is when I use autoSuggestBehavior to filter and select the value, input text fields are reset to null, when I just select from the af:inputComboboxListOfValues without using autoSuggestBehavior, it works.


    Thanks again.

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,566 Red Diamond

    I'm not sure this will help you, but the doc of af:autoSuggestBehavior tells you

    Note: If EL is used in the EL supported attributes of this tag, this tag will not be stampable.

    This means that you can't use the tab inside an af:table as the table stamps it's elements.

    I can't tell if this results in the behavior you see or not. This is something Oracle support has to tell you.


    Timo


  • Eric K.
    Eric K. Member Posts: 173 Bronze Badge

    Thanks Timo.

    I'll raise the SR. For now, I have disabled the function for autoSuggest


    Eric.

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,566 Red Diamond

    Eric,

    as a workaround you can set the af:inputText to autosubmit="true"


    Timo