Saturday, September 29, 2012

Error -Could not create the Java virtual machine" in Jdeveloper 11g

If you notice below error while starting Weblogic server using Jdeveloper 11g, Try below options, It may resolve the issue.

"Could not create the Java virtual machine" in Jdeveloper 11g"

Right click on My Computer, go to properties->Advanced->Environment Variables.
In user Variables add a New variables with below details:

Variable name: EXTRA_JAVA_PROPERTIES
Variable Valute: -Xms256m -Xmx256m

Thursday, September 27, 2012

How to determine the selected tab name with component


Use Case :  If there are multiple <af:showDetailTab> components in <af::pnaelTabbed> , How to identify what tab has been selected ?

Solution :   Use <af:setPropertyListener> component inside <af:showDetailTab> and specify 'type =disclosure' and set a specific value to a page flow scope variable or any binding attribute.



            <af:showDetailItem text="Employee" id="sdi2" >
                <af:setPropertyListener from="EMP"
                                        to="#{bindings.TabName.inputValue}"
                                        type="disclosure"/>
              </af:showDetailItem>


#{bindings.TabName.inputValue} - View object attribute Or you can also specify #{pageFlowScope.tabName}

Tuesday, September 25, 2012

How to use returnListener in ADF


Use case : If you have to invoke a method before any 'Return' activity from any event (eg : Popup, dialog, etc..)

Solution : Use 'returnListener' component as below


     <af:commandButton text="Employee Lookup" id="cb4"
         rendered="true" 
         action="planlookup" 
         windowEmbedStyle="window" useWindow="true" 
         windowModalityType="modeless" windowHeight="480" 
         windowWidth="650"
         returnListener="#{pageFlowScope.empBean.onReturn}"/>

                                           

AFStretchWidth



Specify below styleClass for <af::panelCollection> and <af:panelStrechLayout> components to automatically adjust the width of containing UI Components

 styleClass="AFStretchWidth"


Saturday, September 22, 2012

How to enable Content Style to 'Upper Case' while typing in Input text box


Use Case : Always enable 'Upper Case' while typing for any input text component

Solution :  Set 'contentStyle' attribute value to 'text-transform:uppercase' for all input components.


Wednesday, September 19, 2012

How to keep track of history data using 'Effective Dated Entities' using ADF


Usecase :   How to keep track of database entries with all the previous changes from the time when the row got created
   - > How many times a specific row has been modified ?
   - > Who are all modified a specific row when and what modified ?

Approach
              - Create below four columns in Database table, synchronize the respective entity to reflect these attributes.




 - Modify the Entity Object to 'EffectiveDated' , Open the Entity, Select 'General' , Modify the 'Effective Date Type' attribute to 'EffectiveDated' using property inspector.


 - Set 'Sequece' attribute value to 'true' for 'EffectiveSeq' attribute using Property Inspector

 - Set 'Sequece Flag' attribute value to 'true' for EffectiveSeqFlag' attribute using Property Inspector


 - Set 'Start Date' attribute value to 'true' for 'StartDate' attribute using Property Inspector
 - Set 'End Date' attribute value to 'true' for 'EndDate' attribute using Property Inspector

- Set 'Effective Dated' attribute of corresponding View Object to 'true' using property inspector

- Finally, Set the 'EffeciveDateMode' at row level, You can set this property wherever needed based on the requirement, In this example, I am setting this at constructor of the Row Impl class, so whenever new row inserted/updated/deleted/created this will be invoked and set the value accordingly.
                  
-  Below shows what exactly meant for each mode level in ADF, Mode level can be set based on the requirement.

Row.EFFDT_UPDATE_MODE: When an effective dated row is updated in "update" mode, the modified row is end dated on the effective date and a new row is created with the changed values.

Row.EFFDT_UPDATE_CHANGE_INSERT_MODE: When an effective dated row is updated in "change insert" mode, the modified row is end dated on the effective date and a new row is inserted that fits between the effective date and the start date of the next row in the effective date time line.

Row.EFFDT_UPDATE_CORRECTION: When an effective dated row is updated in "correction" mode, the effective start date and effective end date is left unchanged.

Row.EFFDT_UPDATE_NEW_EARLIEST_CHANGE_MODE: Updating in "new earliest change" mode is supported only in Multiple Changes Per Day.

Row.EFFDT_UPDATE_OVERRIDE_MODE: When an effective dated row is updated in "override" mode, the modified row is end dated on the effective date and the start date of the next row in the effective date time line is set to effective date + 1 day.  

Row.EFFDT_NONE_MODE: Default state of the effective date mode on the row.
ADF Framework automatically updates for all the above attributes upon Create/Update/Delete operations

- All set, Run the app module, Create new row and see how the values are populated in DB table automatically.. ADF will take care of populating these values based on 'EffectiveDateMode'

   Thanks - I hope this may help.
             

How to generate Sequence Number using Groovy expression



Usecase : Generate a sequence number at entity level using Groovy expression
Solution : Goto Entity -> Select the attribute with 'Number' as data type -> Default Values -> Choose expression -> Paste below groovy expression ( Modify with your sequence name)

       

            (new oracle.jbo.server.SequenceImpl("XXATDTPR_AA_DET_S", adf.object.getDBTransaction())).getSequenceNumber()
       
 
(new oracle.jbo.server.SequenceImpl("EMPLOYEES_SEQ",adf.object.getDBTransaction())).getSequenceNumber()