This discussion is archived
6 Replies Latest reply: Oct 3, 2013 11:46 AM by user12006535 RSS

Transfering Table data from one page to another page in OAF

user12006535 Newbie
Currently Being Moderated

Hi All,

 

Could you please help me with the following requirement. I am trying to transfer the first page selected records to second page, but running into issue.

 

I have 2 custom OAF pages:

 

1st Page is Invoice Search page and upon searching for an invoice, user can select 'multi records' (its table region with multi-select) and click on upload button.

The button internally calls setForwardUrl method and calls 2nd page, where second page contains Advacned Table region to show the selected records from 1st page.

 

Since user can select more than 1 record in Search region on first page, I would like to hold all rows in an array of Hashmap with Integer index and transfer it to 2nd page. Following is the hashmap syntax I am using:

java.util.HashMap<Integer,InvoiceRow> map=new <Integer,InvoiceRow>(); // Here InvoiceRow is a custom CLASS structure with InvoiceNumber and Customer Number as variables inside.

 

But if I pass the above HashMap to setForwardURL method, the JDeveloper throwing an exception saying that "setForwardURL cannot invoke" message.

 

Could you please help me how can I transfer the first page multiselected records to second page?

 

Appreciate your time.

 

-- Venkat

  • 2. Re: Transfering Table data from one page to another page in OAF
    user12006535 Newbie
    Currently Being Moderated

    Hi Dilip,

     

    Thank you for your information, I appreciate your help.

     

    All the above links are showing how we can transfer hashmap with single key and value to another page. My requirement is, I would like to use hashmap with a Key and ArrayList so that I can hold all my selected rows on first page into this hashmap arraylist and transfer it to second page. Can you help me if we have an example for hashmap with Arraylist/ Class structure? Please suggest if we have any better approach?

     

    -- Venkat

  • 3. Re: Transfering Table data from one page to another page in OAF
    user13424229 Explorer
    Currently Being Moderated

    Hi Venkat,

    If i am correct you want to pass multiple selected rows from a table region from one page to another page.

     

    if it is yes you can try below way.

     

    1>create a transient attribute in ur VO in first page for multiple selection and through  iterator  process all the selected rows by checking the  transient flag value "Y" or "N".

    2>then for each selected rows get unique fields separated by comma like (1,2,3) and store it in a variable.and put it in session variable.

    3>in for your 2nd page you can create another VO with same query and get the variable value that you set  and pass it in dynamic where clause to the VO.

     

    i think it should work for you

     

     

     

    Thnaks

    deb

  • 4. Re: Transfering Table data from one page to another page in OAF
    user12006535 Newbie
    Currently Being Moderated

    Thank Deb. That exactly the requirement and I got it what you are saying. I will try this approach and provide you the results.

     

    While I was searching over internet, I found following link that exactly fit into my requirement. The approach is saying to create 2 VO instances (VO1 and VO2) and assign it to AM. Then copy the selected rows on first page from VO1 to VO2 and then use VO2 in second page to populate the Advanced table. I am able to copy the rows from VO1 to VO2, but after redirecting to 2nd page, if I try couning the VO2.getRowCount() in second page. It is running into Null Pointer exception. Would you be able to identify the issue? Thanks for your time.

     

    multi row checking in advance table and passing this to other OAF page

    https://forums.oracle.com/message/2391837#2391837

     

    -- Venkat

  • 5. Re: Transfering Table data from one page to another page in OAF
    user13424229 Explorer
    Currently Being Moderated

    Venket, the approach i told you can try in below way:

     

    public String getSelectedData()
        {
            String whereclause = "(";
           // String whereclause1 = "(";
         XXCONTAINLINESVOImpl vo = this.getXXCONTAINLINESVO1();
          //OAViewObject vo=(OAViewObject)getXXDPECONTAINLINESVO1();
          // System.out.println("debTEST"+punload);
           Row[] sumVoRow =vo.getFilteredRows("Select1", "Y");
          
            System.out.println("deb multi select test"+sumVoRow.length);
        if (sumVoRow != null && sumVoRow.length > 0)
          {
         for (int i = 0; i < sumVoRow.length; i++) {
             
            
                  String wipEntityId =
                  sumVoRow[i].getAttribute("LineId").toString();             
              
                
                  whereclause = whereclause+sumVoRow[i].getAttribute("LineId").toString()+",";
                 
                System.out.println("deb multi select test"+whereclause);
            
          }
        }
            if (whereclause.length() > 0 && whereclause.charAt(whereclause.length()-1)==',')
             {
            
                 StringBuilder b = new StringBuilder(whereclause);
                 b.replace(whereclause.lastIndexOf(","), whereclause.lastIndexOf(",") + 1, ")" );
                 whereclause = b.toString();
               //  return whereclause;          
              
             }
            System.out.println("deb where clause test"+whereclause);
           
        return whereclause;
        }  
      

    so this method will return the value as like : whereclause=(111,222,333) then put this in one session varibale and pass to the below method from CO

    ----------------------------
        public void processPOData (String wherclause)
          {
         

            String query = getXXDPECONTAINDATAVO1().getQuery();//Old queryStringBuffer stringbuffer = new StringBuffer();
                      String newwhereclause ="LINE.LINE_ID IN "+wherclause;

                        System.out.println("DEB NEW where clause:"+newwhereclause);
                         StringBuffer stringbuffer = new StringBuffer();  
                          
                       // stringbuffer.append("SELECT rownum LINE_NUM,A.* FROM (");
                        stringbuffer.append(query);
                        stringbuffer.append("  where ");
                       stringbuffer.append(newwhereclause);
                       
                        ViewDefImpl viewdefimpl = getXXDPECONTAINDATAVO1().getViewDefinition();

                        viewdefimpl.setQuery(stringbuffer.toString());
                       
        
               
                        System.out.println("DEB NEW QUERY TEST:"+stringbuffer.toString());
                        getXXDPECONTAINDATAVO1().executeQuery();
              
            }

     

    Let me know if stil r u facing isssue

     

    Thnaks

    Deb

  • 6. Re: Transfering Table data from one page to another page in OAF
    user12006535 Newbie
    Currently Being Moderated

    Awesome Deb. It's perfect and worked. Thanks a lot for your help.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points