Category Archives: JDeveloper

How to in Jdeveloper ADF – increase the inputcomboboxlistofvalues dialog width


Problem:

To increase the width of the af:inputcomboboxlistofvalues dialog box.

Solution:

Recently I have been challenged to increase the width of the af:inputcomboboxlistofvalues dialog box. using contentStyle or inlinestyle will increase the width of the component and the dialog box will remain the same. So i thought of playing with the CSS file and could possibly achieve the width with the following hack.


<af:resource type=”css”>
.adf_dialog_main{
   min-width: 500px;
}
</af:resource>

How To in Jdeveloper ADF – To call a VO from another VO or from AM method


Scenario:
How to set an Attribute value from one VO into another VO?

Solution: 

//in you Application module Impl file have the follwing code written inside the method which will set the value for another vo
//lets say UploadView is the View object that you would want to set the value
ViewObject vo = findViewObject("tUploadView");
//if its not in Application Module, you will have to get the VO instance either from iterator if you are using this code in the bean
//get the rowset of UploadView
RowSet rs = vo.getRowSet();
//iterate through
while(rs.hasNext()){
//get the row
Row r = rs.next();
//set the value
r.setAttribute("ValueItem", value); //ValueItem is the Attribute that you want to set
}
}

Jdeveloper 11.1.2.3 is out with ADF Essentials


Jdeveloper 11.1.2.3 is out with ADF Essentials – ADF Free to develop and Deploy.. 🙂

http://www.oracle.com/technetwork/developer-tools/jdev/documentation/index.html

How To in Jdeveloper ADF – To have hour and Time format restriction for inputText


Scenario:

How to have a Time format restriction for the adf inputText component?

Solution:

To have the time format restriction to restrict the time for upto 23:59 we will have a regex pattern for the af:inputText

<af:inputText label="" id="time" simple="true" value="" contentStyle="width:30px;" maximumLength="5">
<af:validateRegExp pattern"([01][0-9]|2[0-3]):[0-5][0-9]" messageDetailNoMatch="Time Format must match HH:MM" hint="Time Format: HH:MM"/>
</af:inputText>

How to in Jdeveloper ADF–Single row table selection


Scenario:

How to enable single row table selection?

Solution:

This seems an obvious question but newbie’s miss to understand this and will find difficulties in fixing this.

So what exactly we do to make the selection happen and confirm that it points to the current row of the af:table.

first, make sure that you have the following entries added to the af:table component of your page

selectedRowKeys="{bindings.Customers.collectionModel.selectedRow}"
selectionListener="#{bindings.Customers.collectionModel.makeCurrent}"
rowSelection="single"

Note: Customers is the tree binding for the table in the page definition file.

So what these entries do?

selectedRowKeys – the state of the selection is stored in this property. This property identifies the current selected row in the collectionModel of the table.

selectionListener – this is a listener that corresponds to the selection of the row. we bind it to the makeCurrent method of the table bindings collectionModel

rowSelection – we make it single row selection.

UCM connection to a file from Java


Here is the snippet to connect to UCM from java


// create the IDC Client Manager manager
IdcClientManager manager = new IdcClientManager();

// build a client that will communicate using the HTTP protocol
IdcClient idcClient;

try {
//context with ucm username and password
IdcContext user = new IdcContext ("webadmin", "passw0rd");
//ucm link
idcClient = manager.createClient("idc://ucmwebcenterqa01.group.com:4444");

// get the binder
DataBinder binder = idcClient.createBinder();

// populate the binder with the parameters
binder.putLocal ("IdcService", "GET_FILE");
binder.putLocal("dDocName", "UCM_CLUSTER1001204");
binder.putLocal("RevisionSelectionMethod", "Latest");

try {
ServiceResponse response = idcClient.sendRequest (user, binder);

// get the response as a string
String responseString = response.getResponseAsString ();
//dispaly the content of the file
System.out.println ("" + responseString);

} catch (IdcClientException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
} catch (IdcClientException e) {
e.printStackTrace();
}
}

How to in Jdeveloper ADF Tutorials- Add your own Tip


Have your own Tip in jdeveloper

if you want to add your own tip to Jdeveloper then follow

close Jdeveloper
1) go this location – ${MIDDLEWARE_HOME}\jdeveloper\jdev\doc\studio_doc\ohj\tip.jar


2) create a html file – tip_11_0460.html (just increase the number for eg : tip_11_0470.html)
3) create an image file in images folder if you want to refer this in your html tip – tip_11_0470.gif
4) have your html registered in – tip_map.smp

 <map>
 <mapID target="tip_11_0470_html" url="tip_11_0470.html"/>
 </map>

open Jdeveloper

Nic tool to keep multiple terminal sessions – Pedorosa


Recently I got to know this tool from my colleague to keep track of multiple terminal sessions under a single view.

For example, imagine you are working on multiple server session and you want to keep track of the session or the server running. search for the log files, tailing log outputs then we will open n number of putty terminals to connect to the server or telnet multiple windows. But how will this be organized under one single window?

That where the software Pedorasa come into picture.

The screenshot of the sample is

you can download this free tool from here

Started my New Video Blog


I am happy to say that I have started a new Video blog at

http://middlewareknight.blogspot.com/

Jdeveloper Design Time issue fix


In Jdeveloper 11.1.2 we often see that the designer is going off and looks clumsy without the ‘WYSIWYG’ feature during the design time. The jspx or jsff designer in Jdeveloper will show as

To fix this we directly go and delete this directory o.j2ee.jsplib in

C:\Documents and Settings\ USER_NAME\ApplicationData \JDeveloper\system11.1.2.0.38.60.17

Thanks to the blogger

For other version, if the file or folder does not exist then go to o.j2ee and delete or move – jsp-faces-tags-cache.xml and jsp-libraries.xml. Also delete .wlLib folder if it exists. If nothing works delete the system folder.

also make sure that the ‘Execute Tags in JSP Visual Editor’ is checked for adf components

updates from a collegue
If you have a class reference in your application folder that cannot be loaded this problem might occur

possible fixes

change

oracle.adf.view.rich.security.FRAME_BUSTING
<param-value>differentDomain</param-value>

To:

<param-name>org.apache.myfaces.trinidad.security.FRAME_BUSTING</param-name>
<param-value>differentOrigin</param-value>

or

change the class .adf/META-INF/services/oracle.adf.view.rich.context.ExceptionHandler
or rename this file oracle.adf.view.rich.context.ExceptionHandler