June 21, 2013

Defining default action to button in ADF



There are many cases where user wants to submit a page or form on press of “Enter”  key.
ADF provides a direct solution to this.
af:form or af:subform has a property called defaultCommand.
If we give button id as its value then on press of enter key, the given button will be executed.

Example:

<af:subform defaultCommand="cb1" id="s2">
  <af:panelFormLayout id="pfl1">   
    <af:inputText label="User Name" id="it1" />
    <af:inputText label="Password" id="it2" secret="true"/>
    <af:commandButton text="Login" id="cb1"  action="#{pageFlowScope.mbean.doLogin}" />
  </af:panelFormLayout>
  </af:subform>

June 10, 2013

ERROR: No j2ee modules detected in EAR archive. Deployment aborted. == (oracle.jdeveloper.deploy.VetoableDeployException)



When I was deploying my ADF application to EAR file from JDeveloper, got the below error.

ERROR: No j2ee modules detected in EAR archive. Deployment aborted. == (oracle.jdeveloper.deploy.VetoableDeployException)


To solve this issue, I have done below steps.
  • Go to application properties (not project properties)
  • Go to deployment
  • Select the deployment profile and click on Edit
  • Go to “Application Assembly”
  • Select the check boxes which you want to include in the EAR file from the available “Java EE Modules” (in my case, nothing was selected. So I selected my model and view modules.)
  • Click Ok

java.lang.NoClassDefFoundError: oracle/adf/model/RegionBinding



I have deployed ADF application in weblogic but while accessing the app, I got the error.

Error 500--Internal Server Error
java.lang.NoClassDefFoundError: oracle/adf/model/RegionBinding

To solve this, deploy the application as an EAR instead of web application. After done this, I could able to access the app properly without any issues.