Forum Stats

  • 3,838,884 Users
  • 2,262,408 Discussions
  • 7,900,783 Comments

Discussions

Parent - Child table, How to apply blockRowNavigationOnError?

User_3HI31
User_3HI31 Posts: 3 Employee
edited Aug 3, 2022 3:42AM in JDeveloper and ADF

I have two ADF faces tables - Parent table, Child table in 1 to * relationship.

  • InputText Validation exists at parent row and also child row.
  • "blockRowNavigationOnError" attribute is set in either tables. Hence validation error is thrown and prevents switching rows in the corresponding table as expected.
  • However, if there is an error in the child table row, The parent table row is freely allowed to be switched and that is NOT what I want.

How can I block parent table rows navigation when child rows are having validation errors?

Jdev: 12C (12.2.1.5.0)

Answers

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

    There isn't anything out of the box. You can try to use the selection listener of the parent table and check if any errors are pending on the client. If yes don't change the row selection of the parent.


    Timo

  • User_3HI31
    User_3HI31 Posts: 3 Employee

    Thanks for the reply @Timo Hahn .

    I tried that way but doesn't work fully. The new row selection does get skipped internally as expected.

    However, the new 'row highlighting' still takes place, even though the iterator isn't pointing to it. Is there any way to overcome this?

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

    I'm sure there is.

    What have you tried?

    Timo

  • User_3HI31
    User_3HI31 Posts: 3 Employee
    edited Aug 4, 2022 9:08AM
    • Added a "selectionListener" on the parent table.
    • If the childTableHasValidationError, I simply don't use the selectionEvent.
    • I did verify that the internal iterator still points to the prev row, but in the UI the selected row is getting highlighted.

    public void parentTableRowSelectionListener(SelectionEvent selectionEvent) {

         if(childTableHasValidationError){

        return;

      }

      ADFUtil.invokeEL("#{bindings.AwardContractLine11.collectionModel.makeCurrent}", new Class[] { SelectionEvent.class }, new Object[] { selectionEvent });

      //...refresh child table

    }

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

    In case of an error, you just cancel the selection. Try to set the current row back to the old row in the parent.


    Timo