Wednesday, February 17, 2016

Check if the VO Row is updated! ADF


  • Add a Transient Attribute to the View Object (e.g Row Status(Integer / BigDecimal), make sure this attribute is made Updatable - Always)
  • Define the Row Impl for the VO
  • Getter method the row-

 
    /**
     * Gets the attribute value for the calculated attribute RowStatus.
     * @return the RowStatus
     */
    public Integer getRowStatus() {
        //return (Integer) getAttributeInternal(ROWSTATUS);
        byte entityState = this.getEntity(0).getEntityState();
        return new Integer(entityState);
    }
   

Integer values:
2 - Modified
0 - New
1 - Unmodified
-1 - Initialized 


// In the backingBean, We can update this row (e.g Last Updated by) only if the RowStatus is 2 













http://docs.oracle.com/cd/B14099_19/web.1012/b14022/oracle/jbo/server/EntityImpl.html

// Example
byte entityState= eo.getEntityState();
if(entityState==EntityImpl.STATUS_MODIFIED)
// .....

Friday, February 12, 2016

Remove Advance Button Feature from af:query ADF

// TBD

Ref :http://www.awasthiashish.com/2015/04/adf-skinning-remove-search-or-more-link.html

Monday, February 8, 2016

Reset View Criteria (af:QueryListener) on tab diclosure ADF

 private RichQuery queryComp;      
    public void setQueryComp(RichQuery queryComp) {
        this.queryComp= queryComp;
    }

    public RichQuery getQueryComp() {
        return queryComp;
    }
 public void onTabDisclosure(DisclosureEvent disclosureEvent) {
        RichQuery queryComp = this.queryComp;
        QueryModel queryModel = queryComp.getModel();
        QueryDescriptor queryDescriptor = queryComp.getValue();
        queryModel.reset(queryDescriptor);
        queryComp.refresh(FacesContext.getCurrentInstance());
        ADFUtils.findIterator("ViewObjectROVOIterator").executeQuery();
        AdfFacesContext.getCurrentInstance().addPartialTarget(treeTable);
        return;
    }

Monday, February 1, 2016

Custom ADF Skinning

       
<!-- trinidad-config.xml-->
     <?xml version="1.0" encoding="windows-1252"?>
      <trinidad-config xmlns="http://myfaces.apache.org/trinidad/config"> 
       <skin-family>CustomSkin</skin-family>
      </trinidad-config>  
 
       
<!-- trinidad-skins.xml (create this file in the same parent folder as trinidad-config.xml)-->
       <?xml version="1.0" encoding="windows-1252"?>
<skins xmlns="http://myfaces.apache.org/trinidad/skin">
    <skin>
        <id>Custom.desktop</id>
        <family>Custom</family>
        <extends>skyros-v1.desktop</extends>
        <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
        <style-sheet-name>skins/Custom/Custom.css</style-sheet-name>
        <bundle-name>com.fm.demoapp.view.skinBundle</bundle-name>
    </skin>
    <skin>
        <id>CustomSkin.desktop</id>
        <family>CustomSkin</family>
        <extends>alta-v1.desktop</extends>
        <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
        <style-sheet-name>resources/Skins/CustomSkin.css</style-sheet-name> <!--create css file and specify the folder path-->
          <bundle-name>com.fm.demoapp.view.skinBundle</bundle-name> <!--create skinBundle.properties in the package defined-->

    </skin>
</skins>
 
Oracle Fusion Middleware Tag Reference for Oracle ADF Faces Skin Selectors 

Update (web.xml) this context-param to true (make sure you change it back to false...before deploying the app to production environment); this reflects the changes made in 'css' without being to redeploy the ear again

 <context-param>
        <description>If this parameter is true, there will be an automatic check of the modification date of your JSPs,
                     and saved state will be discarded when JSP's change. It will also automatically check if your
                     skinning css files have changed without you having to restart the server. This makes development
                     easier, but adds overhead. For this reason this parameter should be set to false when your
                     application is deployed.</description>
        <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
        <param-value>true</param-value> <!--by default it's false-->
    </context-param>