Wednesday, November 28, 2012

usage of setpropertylistener and setactionlistener

https://blogs.oracle.com/vijaymohan/entry/usage_of_setpropertylistener_and_setactionlistener

Tuesday, November 27, 2012

Radio Buttons in ADF

One of the ways is to create a static VO

These are the steps to achieve radio buttons for an attribute

  • Create a static VO and define the attributes(For eg. Primary Key,Data Value & Display Value)
  • Provide the Static Values for the VO
  • Make this VO as View Accessor to a VO where we want to use it for an attribute as an LOV
  • Drag the VO attribute on to the jsff or jspx page as radio button. Here you can select what value to display and what value to commit to the data base



  •  SelectOneRadio could also be achieved with static values, similar to the one described in this blog  

Monday, November 26, 2012

Reusing TaskFlows in another Application


  • Create a Deployment Profile for Model and UI projects as ADFLibrary jars
  • Deploy both the projects
Now in the Application where we have to reuse 
  • Create a jspx page
  • On the UI project properties->Libraries and Classpath->Add Library->Give a Name(e.g ADF Library) and add the adfjars previously defined to it .
  • This should make the previous application as a dependent on the current application.
  • From the component palette of the jspx file we can get to the task flows of the previous application and use it the current application 

Time Zone error in ADF

Try by adding -Duser.timezone=UTC in project properties (Run/Debug/Profile) 

Friday, November 23, 2012

Use an EO as non-updatable object in a VO

We can have an entity object as a non updatable object by unchecking the Updatable property when
creating the VO  



Tree View Auto Height Property to fit in the frame


  • Set this property inlineStyle="height:auto;"

UI Table column stretch


  • Set the ColumnStretching property of the table to last
  • For Column Stretch in AFTreeTable add columnStretching="column:c1" in the source of the jsff or jspx where c1 is the nodeStamp

Pass Parameters to VO with ExecuteWithParams

ExecuteWithParams from the Operations of the Data Control, accepts the parameters from the bindings or through the backing bean


            OperationBinding op = findOperation("ExecuteWithParams");
            op.getParamsMap().put("BindRefId", currentRefId);
            op.execute();


Passing the parameters from UI to App Module method

In the Backing bean we can find the operation and add parameters like in here
         
          Number currentRefId = ((Number)rw.getAttribute("RefId"));
           OperationBinding op = findOperation("moveNode");
           op.getParamsMap().put("newParentId", currentRefId);
           op.execute();

The other way could be by editing the method in the bindings of the page and select the attribute value from the bindings(note: attribute value should be added to the bindings before)


FYI: If we have 2 parameters to be sent to AM method,  one parameter  could be sent through backing bean and other through bindings

Set a default value to an attribute

One can edit the attribute properties of an entity and set default value 

Marking attributes as required on a JSF page


  • One approach could be by checking the mandatory field of the attribute at the entity level
  • The other one could be at the UI level i,e on the page by making the showRequired property to true


Thursday, November 15, 2012

Spin Control In ADF

If an attribute is of Number type in a VO, One should be able to see a spin component on a jsf page when used as form or table.
In Order to get the spin control explicitly we can use

<af:inputNumberSpinbox value="#{bindings.SortOrder.inputValue}"
                                 label="#{bindings.SortOrder.hints.label}"
</af:inputNumberSpinbox>

Example:

  </af:form>
  </af:inputNumberSpinbox label="Year:" 
                         value="2006" 
                         minimum="1900" 
                         maximum="2100"/>
</af:form>  

FYI:

An attribute is shown as a spin control if it is a Number type