Serial number of PK column for table

Hi Experts,

I hung out and view object to the data control on the page jspx,.


First VO1 as ADF, as master and primary key (PkMaster)

Second VO2 as ADF Table, details and primary key(PkMaster,PkDetail)


I want to add a column autoincrement PkDetail do serial for every PkMaster for the table,

This autoincrements to the value with the number of rows in table

When to insert a new line.


Thanks in advance.


JDeve 12 c

You can call this method after calling createInsert to detail to generate new sno and place it in the column

    /**Method to generate Serial Number for Table     * ***/
    public void generateSerial(String voName, String columnNm) {

        ViewObjectImpl vo = (ViewObjectImpl) this.findViewObject(voName);
       Row curRow = vo.getCurrentRow();
        Integer Srno = 0;
       Integer max = 0;
       vo.setRangeSize(-1);
        Row row[] = vo.getAllRowsInRange();
        for (Row r : row) {
            try {
                Srno = Integer.parseInt(r.getAttribute(columnNm).toString());
           } catch (NullPointerException e) {
                Srno = 0;
            }
       if (Srno > max) {
              max = Srno;
          }
       }
        max = max + 1;
       // System.out.println("Serial No is-" + max);
      curRow.setAttribute(columnNm, max);    }

just pass vo name and name of the pk column detail

Ashish

Tags: Java

Similar Questions

Maybe you are looking for

  • What is 14brmon.exe and 39brmon.exe and others with brmon.exe, and these are BAD?

    I have several processes running on my laptop, Vista Home, and I use the McAfee antivirus software.  Are these supposed to be on my computer process, 14brmon, and 39brmon.exe?  If this is not the case, how can I get rid of them?  Or are these harmles

  • Minimize windows on the desktop, no taskbar

    original title: taskbar My windows minimize to the desktop instead of the taskbar.

  • Disable "Do you want to put an end to this process?" pop up

    What is a necessity to do to eliminate that pop-up of the elimination of the unnecessary process (do you want to put an end to this process?) that anyone gets any time we use the Task Manager to remove a process? Do it!!

  • ACS 5.1 - Exception permission policy assessment

    Hello I get the error "no rule has been balanced. Authentication happens; the "identity of Radius Servers" are to return the accept. Tcpdump shows that the ACS does not request such advertising as defined in the compound condition. What Miss me? Any

  • Cannot create Interface WLAN

    I m using WLAN 4400 with4.1.185.0 code. I tried to create an interface more, it says "cant creat the port." However, it creates the port but does not IP DHCP. It is also broadcast this SSID. Any solution? Thank you very much