U bent hier: Home > Blog > template

Make use of custom ‘Number’ converter in ADF application with Jheadstart 11g


Johan Tuitel, 20 januari 2012

When we need to convert ‘Number’ values in the front-end, we have the standard:

<af:convertNumber />

But we want a custom converter for the number values in the application.

To do this for the whole application, we need to adjust the jag-config.xml.

1. Go to ViewController > Resources > config and open jag-config.xml.

2. Search for property name=”libraries” under this property you will find

<value>default/common/common_items.vm</value>

3. Replace this one with a custom reference e.g.

<value>UrgencyRequest/common/demo_items.vm</value>

4. Next is to make this new demo_items.vm template and copy the content from the original common_items.vm template to the new template.

5. Search for #macro (NUMBER_CONVERTER) and insert a custom converter:

<f:converter binding=”#{DemoNumberConverter}” />

Example:

  #macro (NUMBER_CONVERTER)
#if(${JHS.current.item.numberItem})
<f:converter binding=”#{DemoNumberConverter}” />
#end
#end

JSP page template not found


Johan Tuitel, 10 januari 2012

When I was looking in a jsff-file I saw that the pageTemplate component showed an error.

the error: JSP page template not found

This will not cause any problems to run you’re application, but it is correct to solve problems.

1. Then you have to add the url to the custom template in the

pagetemplate-metadata.xml

2. go to ViewController > Application Sources > META-INF > pagetemplate-metadata.xml

3. Add a line which define the template of the page:

<pagetemplate-jsp-ui-def>/common/pageTemplates/ExamplePageTemplate.jspx</pagetemplate-jsp-ui-def>

Generate taskflow and controlflow with jHeadstart 11g


Johan Tuitel, 2 januari 2012

When you made custom navigation in you’re application, but you want to keep te navigation you need to create custom templates otherwise the navigation is lost if you generate the application.

For this problem you need to create a custom taskflow with custom control-flow-case, you need to set the template TASK_FLOW_VIEW_ACTIVITIES for task-flow-control and set the template TASK_FLOW_CONTROL_FLOW_RULES. (meer…)

Generate Managed beans in Faces-Config with jHeadstart 11g


Johan Tuitel,

When you make use of a managed beans and in particularly a bean which you want to use in the entire application, you can add a managed bean in Faces-config.xml.

This can be done manually, but we need to do this with jHeadstart.

1. Open JDeveloper -> select ViewController -> right mouse button -> click Edit JHeadstart Application Definition.

2. Select the service.

3. Select the template tab and scroll to the group Faces Config, under this group you find the template:

FACES_CONFIG

4. Create new template and add manually a managed bean in this FACES_CONFIG template.

example

<managed-bean>
<managed-bean-name>DemoClass</managed-bean-name>
<managed-bean-class>nl.transfer.beans.DemoClass</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>

The benefit of doing this, is that you still can generate with jHeadstart without losing an inserted managed bean in the Faces-config.xml file.