Forum Stats

  • 3,838,627 Users
  • 2,262,385 Discussions
  • 7,900,712 Comments

Discussions

ADF Table Select all checkbox

Waplak
Waplak Member Posts: 115 Red Ribbon
edited Apr 18, 2018 7:10AM in JDeveloper and ADF

I try to following code for check all rows default.need to select all rows when load table.When load the table first time all rows selected.but when load the fragment again all check box are deselected.

        ViewObjectImpl adv = this.getAdvanceDetailsVl();
        RowSetIterator ri = adv.createRowSetIterator(null);
        ri.reset();
        while (ri.hasNext()) {
            Row currentRow = ri.next();
            currentRow.setAttribute("CheckItem", Boolean.TRUE);
        }
        ri.closeRowSetIterator();
    }

JDev version 12.2.1.2

Tagged:
WaplakUmaMahesh Kanuri

Best Answer

  • ManishPandey
    ManishPandey Member Posts: 1,722 Silver Trophy
    edited Apr 18, 2018 6:19AM Answer ✓

    Hi,

    If view object is not based on EO then every time your view object executed value of transient is reset.

    for e.g

    vo.executeQuery();

    you can set default value using groovy expression

    Sketch.png

    but when your view object re executed  value set to default.

    so my conclusion is that you have to create entity based view object or restrict to re execute your view object.

    WaplakWaplak

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,585 Red Diamond
    edited Apr 17, 2018 10:42AM

    Is the VO based on an EO?

    If yes, is the transient attribute where you store the checkmark, part of the EO?

    Timo

  • Waplak
    Waplak Member Posts: 115 Red Ribbon
    edited Apr 17, 2018 11:54PM

    it's not a EO base VO,but my boolean CheckItem attribute is Transient.

  • Narendra Enamala
    Narendra Enamala Member Posts: 126
    edited Apr 18, 2018 4:48AM

    Hi

    Override createInstanceFromResultSet method in VoImpl java class.

    below is the code for your requirement

        public ViewRowImpl createInstanceFromResultSet(QueryCollection queryCollection, ResultSet resultSet) {

            ViewRowImpl value = super.createInstanceFromResultSet(queryCollection, resultSet);

                   value.setAttribute("TSelect", true);

                   return value;

                   //return super.createInstanceFromResultSet(queryCollection, resultSet);

        }

    Regards

    Naren

    UmaMahesh Kanuri
  • ManishPandey
    ManishPandey Member Posts: 1,722 Silver Trophy
    edited Apr 18, 2018 6:19AM Answer ✓

    Hi,

    If view object is not based on EO then every time your view object executed value of transient is reset.

    for e.g

    vo.executeQuery();

    you can set default value using groovy expression

    Sketch.png

    but when your view object re executed  value set to default.

    so my conclusion is that you have to create entity based view object or restrict to re execute your view object.

    WaplakWaplak
This discussion has been closed.