Forum Stats

  • 3,852,528 Users
  • 2,264,112 Discussions
  • 7,905,094 Comments

Discussions

ADF table Columns are not getting arranged as per order mentioned in query after performing Drag and

2888183
2888183 Member Posts: 30
edited Nov 9, 2016 6:29AM in JDeveloper and ADF

Hello friends,

I am working on Jdeveloper 12c (12.1.3.0.0) .

In our application we have multiple viewCriterias listed in select one choice as a favourite search . User can select view criteria from select one choice and click on button to execute search.

The ADF table shows the result of favourite search as per selected from select one choice.

As per the functionality provided by ADF user  rearranging the the column order by drag-n-drop action.

After performing drag-n-drop action when user selects another item from favourite Search (select-one-choice component) and click on Execute button to run favourite Search, the columns are not get rearranged as per the order mentioned in query.

The columns are still in same order as they are arranged using drag-n-drop action.

Kindly provide a solution to display columns in an order which is mentioned in query; not in order they are arranged using drag-n-drop action.

Thank you.

Tagged:
2888183

Best Answer

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,733 Red Diamond
    edited Nov 8, 2016 9:05AM Answer ✓

    You can add a button or anything else which can trigger an method in a bean. The method undo the column reorder by iterating through the columns and setting their displayindex to -1

        public void undoColunmReorder(ActionEvent actionEvent) {        _logger.info("Undo reorder...");        List<UIComponent> children = this.table.getChildren();        for (UIComponent comp : children) {            if (comp instanceof RichColumn) {                RichColumn col = (RichColumn) comp;                if (col.getDisplayIndex() >= 0) {                    _logger.info("...unset column "+col);                    col.setDisplayIndex(-1);                }            }        }        _logger.info("... done!");    }

    Then you need to refresh (ppr) the table.

    Timo

    28881832888183

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,733 Red Diamond
    edited Nov 8, 2016 9:05AM Answer ✓

    You can add a button or anything else which can trigger an method in a bean. The method undo the column reorder by iterating through the columns and setting their displayindex to -1

        public void undoColunmReorder(ActionEvent actionEvent) {        _logger.info("Undo reorder...");        List<UIComponent> children = this.table.getChildren();        for (UIComponent comp : children) {            if (comp instanceof RichColumn) {                RichColumn col = (RichColumn) comp;                if (col.getDisplayIndex() >= 0) {                    _logger.info("...unset column "+col);                    col.setDisplayIndex(-1);                }            }        }        _logger.info("... done!");    }

    Then you need to refresh (ppr) the table.

    Timo

    28881832888183
  • 2888183
    2888183 Member Posts: 30
    edited Nov 9, 2016 6:29AM

    Hi @Timo Hahn, thanks for solution

This discussion has been closed.