Thursday 28 March 2013

Part2 Partial Rendering in OAF Page(Conditional Displaying Item On OAF Page)



Hi Friends , this is the Second and Last part of Partial Rendering in OAF Page(Conditional Displaying Item On OAF Page). Here below is the First part of LOV creating in OAF Page.

Part1:-  https://rpforacle.blogspot.in/2013/03/partial-rendring-in-oaf-page.html

Now we have to set the Application Module for the PageLayoutRN.
Set AM Property for “PageLayoutRN”.
AM=rohit.oracle.apps.fnd.RohitPartialRendring.server.RohitPartialRendringAM.

Now we create a new Region under the “PageLayoutRN”.
Right Click on “PageLayoutRN”.Click New an then Click Region.


Then Region1 has created.Change the Name(ID) of Region1 in Property window with “MainRN”.
ID=MainRN

Right Click On “MainRN”.Click New and then Click messagetextinput.
Item1 has created under MainRN.
 


Same like above create item2,item3,item4.
After this Change properties of item1,item2,item3,item4 in the property window.



For Item1
ID=FirstName
Prompt=First Name.
For Item2
ID=LastName
Prompt=Last Name.
For Item3
ID=Male
Prompt=Male.
Item Style=messagecheckbox.
For Item4
ID=Female.
Prompt=Female.
Item Style=messagecheckbox.



After this Again Right Click on Region MainRN. And then create two messagetextinput as like above.
Item1 and item2 has created after this.



Now we have to make a condition when the user click “Male”CheckBox then item1 display and item2 has hide. And when the user click “FEMALE” then item2 display and item1 has hide.
For this we have set “Action type” Property for Male and Female CheckBox in the property window as below.


Click on Male CheckBox. And then go to property window.
Change Proeprties as below


Action Type=firePartialAction
Event=action1






The property which we have set for Male checkbox the same property we have to set for Female checkbox
Click on Female checkbox
Go to property window for Female Check Box.

Female CheckBox Proeprties
Action Type=firePartialAction.
Event=action2 


 
Now we have to create view Object to implement partial rendring.
Right Click on Project “RohitPartialRendring”.Click New.



Enter the View Object Properties.
Veiw Object Name= RohitPartialRendringVO
Default Package=rohit.oracle.apps.fnd.RohitPartialRendringVO.server

Click Next and then go to step3 in below screen.Click New Button.
 Click New Button.


Enter the View Object Attribute Property as like in below screen
Name=RowKey
Type=Number.
Updatable=Click OK.
As like Below Sceen

After creating “RowKey” Attribute for View Object.Again Click New Button and create 2nd Attribute
2nd Attribute Property.
Name=DummyAttr.
Type=Boolean.
Updateable Always.
 
3rd Attribute Property.
Name=DummyAttr2.
Type=Boolean.
Updateable Always.


Now we have write a logic to implement “Partial Rendring”.We have to create a new controller for this.
Right Click on the the “PageLayoutRN”.Click Set new Controller.




Now we have write a logic to implement “Partial Rendring”.We have to create a new controller for this.
Right Click on the the “PageLayoutRN”.Click Set new Controller.



Enter the Controller Properties.
Controller Name=RohitPartialRendringCO.
Default Package=rohit.oracle.apps.fnd.RohitPartialRendring.webui

We have to display item1 and item2 dynamically based on click on Male Female check box
So we have to set “Rendered” Property for “item1” and “item2”.
Click on item1 and then go to property window.
Set item1 Properties
item1 rendered property= ${oa.RohitPartialRendringVO.DummyAttr}.



Click on item2 and then go to property window.
Set item2 Properties
item2 rendered property= ${oa.RohitPartialRendringVO.DummyAttr2}



Now we will attach the view object “RohitPartialRendringVO” with Application Module “RohitPartialRendringAM”.


Right Click on Application Module “RohitPartialRendringAM”.Click “Edit RohitPartialRendringAM”.


Click next and then finish.

Now our coding Part will be start. So First we will create method under the RohitPartialRendringAMIMPL.java class.

Here is the Code.



public void handlePPRAction() 
  {
    Number val1=1;
    OAViewObject vo=(OAViewObject)findViewObject("RohitPartialRendringVO");
    
     if(vo!=null)
     {
      
       if (vo.getFetchedRowCount()==0)
       {
         vo.setMaxFetchSize(0);
         vo.executeQuery();
         vo.insertRow(vo.createRow());
        
        OARow row=(OARow)vo.first();
        row.setAttribute("RowKey", val1);
        row.setAttribute("DummyAttr",Boolean.TRUE);
         row.setAttribute("DummyAttr2",Boolean.TRUE);
       
       
       }
      
     }
  }
 
Double click on the Controler name "RohitPartialRendringCO".

Put the code under the Process Form Request Block.


 public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
   
    OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(webBean);
    am.invokeMethod("handlePPRAction");
   
  }

  /**
   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(webBean);
   
    OAViewObject vo=(OAViewObject)am.findViewObject("RohitPartialRendringVO");
   
    OARow row=(OARow)vo.getCurrentRow();
   
    if ("action1".equals(pageContext.getParameter(EVENT_PARAM)))
    {
     
      row.setAttribute("DummyAttr",Boolean.TRUE);
       row.setAttribute("DummyAttr2",Boolean.FALSE);
    }
   
   

    if ("action2".equals(pageContext.getParameter(EVENT_PARAM)))
    {
     
      row.setAttribute("DummyAttr",Boolean.FALSE);
       row.setAttribute("DummyAttr2",Boolean.TRUE);
    }

   
   
  }


Now Right click on Project"RohitPartialRendring" and click on "Rebuid" .

Now again Right click on Project"RohitPartialRendring" and click on "Run" .






OutPut:-

 
 
If you want to see Other OAF Related Posts , Please visit Below URL.
https://rpforacle.blogspot.in/2013/03/oaf_10.html



If you want to see  Oracle Fusion Related Posts , Please visit Below URL.

https://rpforacle.blogspot.in/2018/01/oracle-fusion-learning-tutorial.html

If you want to Learn Oracle Workflow Builder, Please visit Below URL.

https://rpforacle.blogspot.in/2018/01/oracle-workflow-learning-tutorial-1.html

0 comments:

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *