Monthly Archives: July 2011

jdevloper not taking the latest changes – what to do?


Sometime when you do the changes and run the application the latest changes are not updated while running the application.

The culprit is the system folder.

{user_home}\system11.1.1.4.37.57.75\o.j2ee\drs\

has the exploded war file which will have the classes that is old. deleting the classes from the exploded directory would definitely fix the issue.

Advertisements

How to select entire row using checkbox


To select all the rows in a table design a page like

 

 

 

 

 

 

create a binding to the table, the valuechangelistener of the checkbox will have the following code


 

 

 

 

 

working example can be downloaded from

http://adfproject.googlecode.com/files/SelectAllRowsInATable.zip

af:selectonechoice not getting updated


Today i had an interesting problem at work. The issue is that the user selects the value from a selectonechoice and moves to the next page and when he returns back to the same old page the selectonechoice is not updated with the value that is selected previously.

the selectonechoice is not bounded to any of the bindings and we manually create the list using the managed bean. here is the base snippet which resembles the problem


selectOneChoice simple="true" value="#{Bean.list.itemNo}" id="soc1" unselectedLabel="Please Select">
 selectItems value="#{Bean.listItems}"/>
 </af:selectOneChoice>

while debugging the value the value is all available but somehow the value is not shown in the selectonechoice. The value is again moves to the “Please Select” option specified in the unselectedLabel when the user moves back to the original page.

couple of things i tried which failed
1)binding to the bean and getting the value

2) having the value as “#{Bean.list[‘itemNo’]}”

finally I got to see the following warning in the log saying

13-Jul-2011 20:27:54 oracle.adfinternal.view.faces.renderkit.core.xhtml.SimpleSelectOneRenderer _getSelectedIndex
WARNING: Could not find selected item matching value "1" in CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=soc1]

This warning gave me a hint to think the problem in a different way and leads to the solution

Actually the list that we are manipulating assigns the value on the fly like


....

List<SelectItem> items = new Arraylist();

...

//inside the method

items.add(new SelectItem(code.getItemlabel(), code.getItemValue()));

....
 

the above code has to rewritten as shown to solve the above mentioned issue


//inside the method

SelectItem item = new SelectIem();

item.setLabel(code.getItemlabel());

item.setValue(code.getItemValue()); //here the value should be an Integer value
//if the value is a String then this has to be like
//item.setValue(Integer.parseInt(code.getItemValue()));
items.add(item);

....
 

system folder not getting deleted… uffff


I am fed of this Jdeveloper.. Its behaving weird sometimes and will no listen to what I say..

quite many of us would feel the same way and there is only one way to fix this..

Deleting the system folder… 🙂

this post will tell the exact location where you can find the system folder in windows..

One issue that we face is that how much ever you try to delete sometime you will get

so what’s the reason:

This issue is because of the limitation in windows machine that the maximum length of the folder hierarchy is 255 to 260.. not sure about that but its less than 260 characters.. [path+filename]

and to identify in our system folder.. the following path violates the above max limits.

C:\Documents and Settings\{user_id}\Application Data\JDeveloper\system11.1.1.4.37.59.23\DefaultDomain\servers\DefaultServer\tmp\_WL_user\oracle.webcenter.framework.view

(all folders [3 mostly] that starts with oracle.webcenter.framework under _WL_user)

workaround:

move all the three folders that starts with oracle.webcenter.framework to much higher level .. say.. outside the actual system folder itelf.. [C:\Documents and Settings\{user_id}\Application Data\JDeveloper\].. and delete it..

now your system folder will get deleted easily.. 🙂