Posts Tagged ‘To Document  ADF’

JDev & ADF Goodies

Since JDeveloper 12.1.3 the invoke action used in earlier version has been deprecated. Users still using the old invoke action to load data on page load should migrate their code to using the default activity in a bounded task flow instead. This article describes how to use the executeWithParams method as a default activity in a bounded task flow (btf) to load data to be shown in a region. For this we implement a common

Use Case:
in a text field the user enters a string which should be used to look-up data in the DB and show the data as a table in a region.
For this we use the HR schema and build a look-up for locations after the name of the city of the location. In a page the user can insert the name or part of a cities name into a text field. This input is…

View original post 634 more words

Shay Shmeltzer's Oracle JDeveloper and ADF Blog

The map component provided by the ADF Faces DVT set of components is one that we are always ending up using in key demos – simply because it is so nice looking, but also because it is quite simple to use.

So in case you need to show some geographical data, or if you just want to impress your manager, here is a little video that shows you how to create two types of maps.

The first one is a color themed map – where you show different states with different colors based on the value of some data point there. The other is a point theme – basically showing specific locations on the map. For both cases I’m using the Oracle provided mapviewer instance at http://elocation.oracle.com/mapviewer.

You can find more information about using the map component in the Web User Interface Developer’s Guide here and in the tag doc…

View original post 39 more words

Matt Cooper’s Weblog

If you are noticing client-side performance issues in your ADF Faces application and must support legacy browsers like Internet Explorer 7 and Internet Explorer 8, there are many techniques available to help optimize your application for these browsers:

  1. If you use af:region and the jsff page fragment files have more than 1 root component, optimize it by arranging these components with a single root component. For example, if you want your region contents to stretch, you might have one visible content component and a series of popup components, put the visible content component inside of a “center” facet of an af:panelStretchLayout and put all of those popups in the “bottom” facet but also make sure to assign bottomHeight=”0px”. If you don’t want the contents to stretch, simply wrap these components with an af:panelGroupLayout layout=”vertical”.
  2. Avoid using a af:panelStretchLayout where topHeight, bottomHeight, startWidth, or endWidth is set to “auto”.
  3. Minimize uses…

View original post 141 more words

JDev & ADF Goodies

Over the last couple of days I took some time to check out some of the new features and changes in the UI of the new JDeveloper version 12.1.2.0.0 (aka JDev12c). My other post on this issue already mentioned some features.
This new post adds some more:

UI & Handling
In my post Creating Variables and Attribute Bindings to Store Values Temporarily in the PageDef I showed how to setup page variables using the ‘variables’ iterator of the pageDef. There have been some change to the UI so that you can’t insert new variables via the pageDef editor (as it was in 11g). Variables are now added via the structure window only. I’m not sure if this is a bug or feature.

Completion Insight
This is the feature you use to get help in the editor window when you hit ‘ctrl-space’ on Java code or a jsf tag. It shows…

View original post 645 more words

JDev & ADF Goodies

Over the last couple of days I took some time to check out some of the new features and changes in the UI of the new JDeveloper version 12.1.2.0.0 (aka JDev12c). My other post on this issue already mentioned some features.
This new post adds some more:

UI & Handling
In my post Creating Variables and Attribute Bindings to Store Values Temporarily in the PageDef I showed how to setup page variables using the ‘variables’ iterator of the pageDef. There have been some change to the UI so that you can’t insert new variables via the pageDef editor (as it was in 11g). Variables are now added via the structure window only. I’m not sure if this is a bug or feature.

Completion Insight
This is the feature you use to get help in the editor window when you hit ‘ctrl-space’ on Java code or a jsf tag. It shows…

View original post 645 more words

It is possible to disable each component one by one but the easiest method is getting the list of all the components within the af:panelGroupLayout on page load and setting the properties to the desired status for each one. The same solution can be performed also for other surrounding element.

First bind your component (af:panelGroupLayout in this case) in your managed bean:


RichPanelGroupLayout yourPanelGroupBind;
public void setYourPanelGroupBind(RichPanelGroupLayout yourPanelGroupBind) {
this.yourPanelGroupBind = yourPanelGroupBind;
}
public RichPanelGroupLayout getYourPanelGroupBind() {
return yourPanelGroupBind;
}

Then within a method do this:


List outer = yourPanelGroupBind.getChildren();
for (UIComponent outerComponent : outer) {
if (outerComponent instanceof RichPanelFormLayout) {
List uiComponentList = outerComponent.getChildren();
for (UIComponent uiComponent : uiComponentList) {
if (uiComponent instanceof RichPanelLabelAndMessage) {
List uiComponentList2 = uiComponent.getChildren();
for (UIComponent uiComponent2 : uiComponentList2) {
if (uiComponent2 instanceof RichInputText) {
((RichInputText)uiComponent2).setDisabled(true);
} else if (uiComponent2 instanceof RichSelectBooleanCheckbox) {
((RichSelectBooleanCheckbox)uiComponent2).setDisabled(true);
} else if (uiComponent2 instanceof RichInputDate) {
((RichInputDate)uiComponent2).setDisabled(true);
} else if (uiComponent2 instanceof RichSelectOneChoice) {
((RichSelectOneChoice)uiComponent2).setDisabled(true);
} else if (uiComponent2 instanceof RichPanelGroupLayout) {
List uiComponentList3 = uiComponent2.getChildren();
for (UIComponent uiComponent3 : uiComponentList3) {
if (uiComponent3 instanceof RichInputText) {
((RichInputText)uiComponent3).setDisabled(true);
} else if (uiComponent3 instanceof RichSelectBooleanCheckbox) {
((RichSelectBooleanCheckbox)uiComponent3).setDisabled(true);
} else if (uiComponent3 instanceof RichInputDate) {
((RichInputDate)uiComponent3).setDisabled(true);
} else if (uiComponent3 instanceof RichSelectOneChoice) {
((RichSelectOneChoice)uiComponent3).setDisabled(true);
}}}}}}}

The code above checks for a wide variety of components that might be located within the af:panelGroupLayout.

You should create a folder within your Web Content. Then copy your file manually there (go to c:/Oracle/MiddleWare/Jdeveloper/Jdev/myWork/YourApp/ViewController…). Back in JDeveloper refresh your application and you should see the new file inside your new folder. Then you refer to it simply as “/MyFolder/myfile.txt” or anything else.

In managed bean you can get this file as:

public ServletContext getContext() {
return (ServletContext)getFacesContext().getExternalContext().getContext();
}
ServletContext context = getContext();
InputStream fs = context.getResourceAsStream(“/Folder/file”);

In ADF showing a popup comes easy using the Show Popup Behavior operation from ADF Faces. However sometimes it is handy to control the popup behavior through managed bean method. To achieve this:

1- Bind your popup to a managed bean property, lets say myPopup

2- In your managed bean method, apart from your application logic add these rows:

RichPopup.PopupHints hints = new RichPopup.PopupHints();
getMyPopup().show(hints);

3- To hide or close your popup:

RichPopup popup = getMyPopup();
popup.hide();

This post is about some tricks to the  <af:calendar> component. For a detailed guide and tutorial to <af:calendar> you may follow these links:

Working with ADF Faces Calendar Component – An Oracle JDeveloper How To Document 

ADF Calendar Summary – oracle.adf.view.rich.component.rich.data.RichCalendar

To change the colors of the events in <af:calendar> we should override the activityStyles. In your managed bean create a HashMap variable and override its get() method as shown below:

private HashMap activityStyles = new HashMap<Set<String>, InstanceStyles>();

public HashMap getActivityStyles() {
try {
HashSet event1 = new HashSet<String>();
HashSet event2= new HashSet<String>();
HashSet event3= new HashSet<String>();

event1.add(“Milestone”);
event2.add(“Obligation”);
event3.add(“Task”);

activityStyles.put(event1, CalendarActivityRamp.getActivityRamp( CalendarActivityRamp.RampKey.PLUM ));
activityStyles.put(event2, CalendarActivityRamp.getActivityRamp( CalendarActivityRamp.RampKey.ORANGE ));
activityStyles.put(event3, CalendarActivityRamp.getActivityRamp( CalendarActivityRamp.RampKey.MIDNIGHTBLUE ));

} catch (Exception e) {
e.printStackTrace();
}
return activityStyles;
}

In calendar property:

activityStyles

 

In calendar activity attributes you have to select in Tags the property of your view object, based on which the colors are meant to change.

tags

 

The other calendar activities in the above photo are not relevant, you may have other names for your attributes.