Wednesday 22 October 2014

RowInconsistentException: JBO-25014: Another user has changed the row with primary key

Caused by: oracle.jbo.RowInconsistentException: JBO-25014: Another user has changed the row with primary key oracle.jbo.Key[25544 ]. Sol: when we try to commit or executeQuery on a row which is already modified and comitted by another vo/am, this issue occurs. so if you know that there are chanses of updating by another vo, then better to commit or rollback the existing changes then do EO clear chache.
 service.getDBTransaction().commit();
 service.getDBTransaction().clearEntityCache("oracle.apps.msc.ascp.itemsimulation.model.entity.ItemAttributesEO");
 mscItemAttributesVO.executeQuery();

How to load external javascript or css files in jsff?

Guys, if you want to use external javascript or css, you can use af:resource tag in jsff page.
<source>
  <af:resource source="/customStyles.css" type="css"></af:resource>
</source>
In-line CSS content:
<source>
  <af:resource type="css">
    DIV.customStyle { color: red; }
  </af:resource>
</source>
Include an external JS file:
<source><  af:resource source="/customCode.js" type="javascript"></af:resource></source>
In-line JavaScript code:
<source>
  <af:resource type="javascript">
    function clientListenerFunction(event)
    {
       // content ...
    }
  </af:resource>
</source>

Wednesday 27 August 2014

How to Get Application module object programmatically


You can use any of the below methods to get the application module programmatically.
>> private EmployeeAMImpl getAm() {

        FacesContext fctx = FacesContext.getCurrentInstance();
        DCBindingContainer dc =
            (DCBindingContainer)fctx.getApplication().getExpressionFactory().createValueExpression(fctx.getELContext(),
                                                                                                   DCBindingContainer.class).getValue(fctx.getELContext());
        return (WorkbenchAMImpl)dc.findDataControl("EmployeeAMDataControl").getApplicationModule();
    }
    

>> private EmployeeAMImpl getAm() {
        
        FacesContext fc = FacesContext.getCurrentInstance();
        Application app = fc.getApplication();
        ExpressionFactory elFactory = app.getExpressionFactory();
        ELContext elContext = fc.getELContext();
        ValueExpression valueExp =
            elFactory.createValueExpression(elContext, "#{data.EmployeeAMDataControl.dataProvider}",
                                            Object.class);
        return (WorkbenchAMImpl)valueExp.getValue(elContext);
    }