4 Replies Latest reply: Jan 15, 2013 9:30 PM by 984546 RSS

    Dynamic switcher between select-one choice and input text

    984546
      Hi Oracle community,

      I have a page with an editable adf-table that is based off a View object (via 2 entity objects on Table A &Table B).

      I have another View object (lov) which is to be populated on above page as select one choice.

      I created switcher component to dynamically show each row component in the adf-table as either drop down (select one choice) or input text value that is based on "row.Table A.xyz" value is empty show select on echoice else show as input text.

      Question is, on update values how do i get the selected value from drop-down and/or input text value dynamically based on what was rendered ?

      eg-
      row1 ---> inputtext1 inputtext2 selectonechoice1 inputtext3
      row2 ---> inputtext1 selectonechoice1 inputtext2 inputtext3
      ... etc

      It also has only one command button to update/commit all rows.


      Much appreciated. Thanks.
        • 1. Re: Dynamic switcher between select-one choice and input text
          Puthanampatti
          Not sure about your question..table iterator must have all the values..

          DCIteratorBinding iterator =
          ADFUtils.findIterator("VOIterator");
          Row[] fetchRows = iterator.getAllRowsInRange();
          if (fetchRows != null)
          {
          for (Row row : fetchRows)
          {
          if (null != row)
          {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
          • 2. Re: Dynamic switcher between select-one choice and input text
            984546
            Think of it as an adf editable table in the page with two rows where -

            using switcher component i have my 2 rows displayed as -
            row1.column1 = select one choice (ui row component is select one choice because row1.column2 is null)
            row2.column1 = input text field (ui row component is input text because row2.column2 is not null)

            All i need to find out is (on Update/Commit) once the user selects one choice from drop down or enters text field i want to dynamically get the values of column1 from either select one choice or input text based on the column2 condition?

            Since the select one choice has a different binding from input text how do i get the value dynamically?

            Thanks.
            • 3. Re: Dynamic switcher between select-one choice and input text
              Frank Nimphius-Oracle
              Hi,

              an attribute can be exposed as a select list or as an attribute binding (its not forbidden to create two bindings for the same attribute). This means that if you submit the select one choice component, the attribute binding displays the updated value in which case you access it from

              AttribiteBinding aBinding = (AttribiteBinding) bindings.get(attribute_binding_name);
              Object value = aBinding.getInputValue();

              as you are switching between an input text field (that uses an attribute binding) and a select box (if model driven, this uses a list binding), you can always read the value from the attribute binding. This however works only for the current selected row

              Frank
              • 4. Re: Dynamic switcher between select-one choice and input text
                984546
                Frank,

                But, my UI component is not model driven (attribute in VO is input text). I am only displaying as LOV dynamically on page.

                Is it feasible to modify the Row (jbo.Row) in the managed bean to get the value from select one choice or input text dynamically ?