Alternative way to fetch VO attribute using selected in index of LOV

If you have access to the index of the selected item, then you can use value to retrieve value of any attribute of the underlying view object.

I agree that with new releases there are more direct approaches in doing so, however, depending on the business requirement, the following method may just come handy –

    public int getValue(int index){
        
        int value = 0;
        
        ViewObject vo = this.findViewObject(<View Object>);
        Row r = vo.getRowAtRangeIndex(index);
        
        try{
            value = Integer.parseInt(r.getAttribute(<Attribute Name>).toString());
        }catch(NullPointerException npe){
            value = 0;
        }
        return value;
        
    

Author- Ankit Gupta

Happy coding with Techartifact….

Application Module Pooling in Oracle ADF

An application module pool is a collection of application module instances of the same type, such as an Orders application module or a Human Resources application module. This pool of application module instances is shared by multiple browser clients. The amount of time between submitting Web pages enables a smaller number of application module components to serve a larger number of active users. This reduces memory usage and improves performance.
This facility manages a configurable set of application module instances that grows and shrinks as the end-user load on your application changes during the day.

At any one time, the pool may contain application module instances that are partitioned into
three groups, based on their state. When the processing of a current HTTP request completes, the application module instance is checked back into the pool. If the AM instance has managed state, the pool keeps track that the AM is referenced by that particular session.
For example –
We have pool of 5 Application module instances. After having request from multiple browser , request will go to instance, which is available for time being.We have 3 state defined for appModule instances –
1- Available
2- Partially available- but referenced for preferred reuses by an another active session that would be more efficient due to the managed state of the application module.
3- Unavailable- because it is being used at that very moment by a Web container thread

You can configure application module pool behavior, sizing, and cleanup behavior. For more information about this, refer to the Fusion Developer’s Guide for ADF in online Help.

Note: Pools are created only for root application modules, not for nested ones that users access indirectly through a root application module.

In short –

Application module pooling:

• Enables users to share application modules
• Manages application state
• Provides the same instance or one with an identical state
when requested by an application with managed state

State management –
The PS_TXN and PS_TXN_SEQ are used by ADF to serialize user session state to the database (the state management schema).PS_TXN will only get created when/if an application module needs to be passivated. If your application module pool is big enough, it’s possible that you won’t see it get created.

Happy Learning with Vinay Kumar in techartifact…

Get value of the outputtext in javascript and access to backing bean in Oracle ADF

Requirement -Get value of the outputtext in javascript and send it to backing bean in Oracle ADF
Solution – We will use clientListener to call java script function and Serverlistener for calling java function

Below is the code for accomplish this

– page code

    <af:outputText value="value outputText" id="ot32" clientComponent="true"
                    shortDesc="shortDesc">
        <af:clientListener type="mouseOver"
                method="customJsFunction"/>
        <af:serverListener type="mycustomserverEvent" method="#{OutputTextCase11.handleServerEvent}"/>                
    </af:outputText>
    <br></br>
    <af:outputText value="Init" shortDesc="shortDesc" id="ot1" clientComponent="true"/>
 

– find javascript function code

   var customJsFunction = function(event)
   {
      var exceptiondata = event.getSource().findComponent("ot32").getValue();
      AdfCustomEvent.queue(event.getSource(),
                       "mycustomserverEvent",
                       {param1:exceptiondata},
                       true);
      return true;
   }
 

– method in bean

  public void handleServerEvent(ClientEvent ce)
  {
    String param = (String)ce.getParameters().get("param1");
    RichOutputText outputText=(RichOutputText)ce.getComponent().findComponent("ot1");
    outputText.setShortDesc(param);
    outputText.setValue(param);
    AdfFacesContext.getCurrentInstance().addPartialTarget(outputText);
  }
 

happy coding with Vinay in techartifact….