Thursday, February 9, 2017
Showing The First Tab On PanelTabbed Component In WebCenter Portal ( Spaces )
This issue of showing First tab on panelTabbed component in webcenter portal ( Spaces ) has troubled me for long.
Page A has three tabs. When user select second or third tab and then navigate to another page. When user comes back to Page A, his last selected tab is displayed instead of first tab.
Google Search for showing first tab on panelTabbed component gives you lot many results...and mostly works for adf application. Found a very little for webcenter portal framework ...but none for webcenter portal ( spaces ),
I knew that it has something to do with MDS ...disclosed tab getting persisted. Also verified that using RedSamurai MDS Cleaner taskflow. There were MDS file getting created persisting disclosed tab information.
Found the solution ...
http://dba-adf.blogspot.com/2014/02/showing-first-tab-always-when-enabling.html
public void tabDisclosureListener(DisclosureEvent disclosureEvent) {
RichShowDetailItem tab = (RichShowDetailItem)disclosureEvent.getComponent();
FacesContext fc = FacesContext.getCurrentInstance();
ChangeManager cm = RequestContext.getCurrentInstance().getChangeManager();
ComponentChange cc = new AttributeComponentChange("disclosed", Boolean.FALSE);
cm.addComponentChange(fc, tab, cc);
........
}
This will reset the disclosed property when ever any of the tabs where clicked.
Enjoy !!!
Tuesday, November 8, 2016
ADF Skinning - Styling table column And Hiding checkbox in SelectManyChoice
Few ADF Skinning Tips
Recently I came across a OTN question and some requirements on ADF Skinning.
OTN question : How to allow user to select multiple values in selectManyChoice but not showing checkbox ?
Well first I checked whether it is possible to select multiple values using CTRL+CLICK without selecting checkbox ...and yes it is. So only thing left is to hide the checkbox. Well then all we need is correct adf skin selectors and some basic css. Here is the sample code :
Apply the smcCheckboxHide class on SelectManyChoice component
<af:selectManyChoice label="TestCheckbox" styleClass="smcCheckboxHide">
<f:selectItem itemValue="MALE" itemLabel="MALE" id="si11"/>
<f:selectItem itemValue="FEMALE" itemLabel="FEMALE" id="s1i2"/>
</af:selectManyChoice>
and hide the checkbox in css using below code :
af|selectManyChoice::content-input.smcCheckboxHide {
display:none
}
Refer to http://jdevadf.oracle.com/adf-richclient-demo/docs/skin-selectors.html
af|selectManyChoice::content-input - >Style on the native checkbox of the af:selectManyChoice component.
Another requirement that came up is to have right border on few columns in adf table. Again we need to lookup for the right adf skin selectors. Sample code :
Apply the style class on column { rightColHeaderBorder for header and for datacell }
<af:column sortable="false" headerText="Name" align="start" id="c2" headerClass="rightColHeaderBorder" styleClass="rightColBorder">
<af:outputText value="#{row.name}" id="ot2"/>
</af:column>
Skinning code :
af|table af|column::column-header-cell.rightColHeaderBorder,
af|table af|column::banded-data-cell.rightColBorder,
af|table af|column::data-cell.rightColBorder{
border-right-color: Blue;
border-right-width: thin;
}
Enjoy!!!!
Feel free to provide your inputs in comments..
Labels:
ADF Faces,
ADF Skin,
ADF Table,
SelectManyChoice
Tuesday, July 5, 2016
How to enable Webservices request and response dumping in WebLogic
Always thought to find some settings in weblogic to dump webservice request and response soap xml while calling webservice. Finally found the settings in blog post here. Thanks to Igor Kromin.
https://www.igorkromin.net/index.php/2015/05/11/how-to-enable-webservices-request-and-response-dumping-in-weblogic/
Below image from Igor Kromin post.
For reference I am posting them here :
JVM start parameters:
-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true
-Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dump=true
Enjoy...
https://www.igorkromin.net/index.php/2015/05/11/how-to-enable-webservices-request-and-response-dumping-in-weblogic/
Below image from Igor Kromin post.
For reference I am posting them here :
JVM start parameters:
-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true
-Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dump=true
Enjoy...
Thursday, April 16, 2015
Creating a Symbolic Link (Hard Link) in windows
Use this to create a hard link so that you can
compile files in source control without issues.
mklink /J C:\Oracle\JDeveloper11117 C:\Oracle\Middleware1117
mklink /J <New
Link Name> <Destination
folder lcoation>
Thursday, March 19, 2015
System Folder Delete And Recover Artifacts ( DataSource , Repository URLS)
This post talks about how to take backup of configured datasources and repository (SVN) connection.
Follow these steps :
STEP 1 :
STEP 1 :
Take a back up of below files
before you delete the old system folder
- SYSTEM_FOLDER\DefaultDomain\config\config.xml
- SYSTEM_FOLDER\DefaultDomain\config\jdbc
Folder
- SYSTEM_FOLDER\o.jdeveloper.subversion\repositories.xml
STEP 2 :
Now delete the systemFolder
STEP 3:
Restore configurations
Copy the jdbc-system-resource elements into config.xml from the backup config.xml
Copy the contents of jdbc from the back up into the new jdbc folder
Create a dummy repository connection and Copy the svn-repository elements from the back up repositories.xml
Note that these steps only restore the SVN repositories and data sources.
Now delete the systemFolder
STEP 3:
Restore configurations
Copy the jdbc-system-resource elements into config.xml from the backup config.xml
Copy the contents of jdbc from the back up into the new jdbc folder
Create a dummy repository connection and Copy the svn-repository elements from the back up repositories.xml
Note that these steps only restore the SVN repositories and data sources.
Unfortunately all the encrypted
passwords got corrupted.
So had to clear the password
save and reset the passwords.
Enjoy!!!
Labels:
Data Source,
SVN,
System Folder
Friday, March 13, 2015
Hierarchical Dropdown in ADF
This post talks about how to display hierarchical dropdown in selectOneChoice.
There is one method explained by Frank here. Well this method show two levels in hierarchical dropdown using two af:ForEach iteration.
What if we have multiple level, and don't know how many af:forEach would be required. Other approach is to achieve required spaces through query to show dropdown structure. Thanks to my friend Prahlad for sharing this.
In below query, emp_disp will have appropriate spaces based on the level of the employee in the employee hierarchy.
select LEVEL,FIRST_NAME,LAST_NAME,
LPAD(FIRST_NAME ||' '|| LAST_NAME,length(FIRST_NAME ||' '|| LAST_NAME)+(LEVEL-1)*4,unistr('\00A0\00A0\00A0\00A0')) emp_disp
from EMPLOYEES
start with MANAGER_ID is null
connect by prior EMPLOYEE_ID = MANAGER_ID;
All you need to do is create a VO with above sample query and use this for dropdown.
Sample is uploaded here..
Enjoy.
There is one method explained by Frank here. Well this method show two levels in hierarchical dropdown using two af:ForEach iteration.
What if we have multiple level, and don't know how many af:forEach would be required. Other approach is to achieve required spaces through query to show dropdown structure. Thanks to my friend Prahlad for sharing this.
In below query, emp_disp will have appropriate spaces based on the level of the employee in the employee hierarchy.
select LEVEL,FIRST_NAME,LAST_NAME,
LPAD(FIRST_NAME ||' '|| LAST_NAME,length(FIRST_NAME ||' '|| LAST_NAME)+(LEVEL-1)*4,unistr('\00A0\00A0\00A0\00A0')) emp_disp
from EMPLOYEES
start with MANAGER_ID is null
connect by prior EMPLOYEE_ID = MANAGER_ID;
All you need to do is create a VO with above sample query and use this for dropdown.
Sample is uploaded here..
Enjoy.
Labels:
ADF,
ADF Faces,
SelectOneChoice
Thursday, December 18, 2014
Recover Missing Firefox icon..
Multiple times ...firefox seems to loose it's icon... and it looks real bad. I did some google and found this link : http://www.heerengandhi.com/2009/07/29/firefox-icon-went-missing-in-windows-7-heres-a-fix/comment-page-1/
Just copy paste of the instructions for my reference..and anyone else reading.
Follow these directions:
Your icons should be as good as new!
Just copy paste of the instructions for my reference..and anyone else reading.
Follow these directions:
- Close all folder windows that are currently open.
- Launch Task Manager using the CTRL+SHIFT+ESC key sequence, or by running taskmgr.exe
- In the Process tab, right-click on the Explorer.exe process and select End Process
- Click the End process button when asked for confirmation.
- From the File menu of Task Manager, select New Task (Run…)
- Type CMD.EXE, and click OK
- In the Command Prompt window, type the commands one by one and press ENTER after each command:
CD /d %userprofile%\AppData\Local
DEL IconCache.db /a
EXIT - In Task Manager, click File, select New Task (Run…)
- Type EXPLORER.EXE, and click OK.
Your icons should be as good as new!
Labels:
Misc
Handling Ok Cancel action on Uncommited warning popup
Handling Ok Cancel action on Uncommited warning popup
There are couple of post which covers how to show uncommitted data warning popup. So I will not go in details for that, rather we will cover how to handle ok cancel action on uncommited data warning popup.
Few references for, how to show uncommitted data warning popup :
http://www.oracle.com/technetwork/testcontent/unsaveddatawarning-096556.html
http://www.awasthiashish.com/2012/10/uncommitedunsaved-data-warnig-on-page.html
Select af:document from page structure and go to property inspector, now set UncommitedDataWarning to on.
Before starting with implementation, I would like to refer the information found on OTN forum :
https://community.oracle.com/message/10982006#10982006
From looking at the design specs, uncommitted data warning is a combination of ADF view and ADFc functionality. Good news is that - at least by the specs - a dirty transaction in a region should be automatically detected. The class that handles the uncommitted data warning is AdfcDirtyPageHandler. This class is registered in a text file "oracle.adf.view.rich.context.DirtyPageHandler". So if this works as with how you change the ADFc exception handler, then its by a file with this name in the application META-INF/service folder (the latter doesn't exist by default). Note that "AdfcDirtyPageHandler" is in an internal package, which means its not supported to extend it. However, the default abstract class is DirtyPageHandler and this is in a public package.
From the Java docs:
META_INF/services-based application-scoped object for tracking whether navigation will result in data loss. Only a single implementation may be registered per application. Registering multiple implementations will result in an IllegalStateException at applciation initialization. If no implementation is registered, a default implementation will be used. That implementation will always return false from isDataDirty and will do nothing in response to a trackNavigation call.
Maybe worth filing an ER to get a public listener / hook into this instead of dealing with your own implementation. Will file one
Before starting with implementation, I would like to refer the information found on OTN forum :
https://community.oracle.com/message/10982006#10982006
From looking at the design specs, uncommitted data warning is a combination of ADF view and ADFc functionality. Good news is that - at least by the specs - a dirty transaction in a region should be automatically detected. The class that handles the uncommitted data warning is AdfcDirtyPageHandler. This class is registered in a text file "oracle.adf.view.rich.context.DirtyPageHandler". So if this works as with how you change the ADFc exception handler, then its by a file with this name in the application META-INF/service folder (the latter doesn't exist by default). Note that "AdfcDirtyPageHandler" is in an internal package, which means its not supported to extend it. However, the default abstract class is DirtyPageHandler and this is in a public package.
From the Java docs:
META_INF/services-based application-scoped object for tracking whether navigation will result in data loss. Only a single implementation may be registered per application. Registering multiple implementations will result in an IllegalStateException at applciation initialization. If no implementation is registered, a default implementation will be used. That implementation will always return false from isDataDirty and will do nothing in response to a trackNavigation call.
Maybe worth filing an ER to get a public listener / hook into this instead of dealing with your own implementation. Will file one
To handle ok cancel action on uncommitted data warning popup :
1. Create a text file with name "oracle.adf.view.rich.context.DirtyPageHandler" under folder structure :
TestApp/.adf/META-INF/services/
2. Create a java class CustomDirtyPageHandler which extends "AdfcDirtyPageHandler".
public class CustomDirtyPageHandler extends AdfcDirtyPageHandler
3. Update the file "oracle.adf.view.rich.context.DirtyPageHandler" created in step1 with the name of custom handler ( full package path ).
4. Now you are good to write your logic in CustomDirtyPageHandler java class. In sample code below, Rollback is executed on OK action. Make sure that Rollback binding is available in pageDef of jspx.
Enjoy!!!
Wednesday, December 17, 2014
Scroll to top on Commit or Rollback
Scroll to top on Commit or Rollback
This post is about scrolling to some component on user action. Mostly when user click save or cancel, a message is displayed on top of the page. At the same time, it is required to scroll the page to top and show message to the user... rather user scrolling up to see what happened.
Implementation is simple :
1. Need a javascript method to scroll.
2. Next step is just to invoke this javascript method at the end of your commit call.
Enjoy!!
Enjoy!!
Labels:
ADF,
ADF Faces,
JavaScript
Calling JavaScript from ManagedBean
Calling JavaScript from ManagedBean
Often there are requirements to call the invoke javascript from actionListener to set focus or scroll etc. Here goes the code to invoke javascript :
Enjoy !!!
Labels:
ADF,
ADF Faces,
JavaScript,
ManagedBean
Monday, November 24, 2014
Invoke Bindings from PageTemplate PageDef
Invoke Bindings from PageTemplate PageDef
There are scenarios when certain method binding in pageTemplate's pageDef needs to be invoked from some button Action in page. Here are the details :1. For page based on the pageTemplate, there will be reference of pageTemplate's PageDef created in page's pageDef.
2. Now in order to access bindings in pageTemplate's pageDef, refer below code. Enjoy!!!
Labels:
ADF,
ADF Faces,
Bindings,
PageTemplate
Thursday, November 20, 2014
Show exceptions caught in Managed Beans
There are couple of scenarios when some exception is caught while executing some logic in managed bean. The post is about how to show those exceptions to user and when it is required to do it explicitly.
For most of the scenarios, ADFm Error Handlers shows the message. But in case when some exception occurs in managedBean, it can be caught and reported to ADFm Error Handler using below code.
Note : Using the ADF model error handling for displaying exceptions thrown in managed beans require the current ADF Faces page to have an associated PageDef file (which is the case if the page or view contains ADF bound components).
Sample App is uploaded here. Following scenarios are covered :
Enjoy !!!
For most of the scenarios, ADFm Error Handlers shows the message. But in case when some exception occurs in managedBean, it can be caught and reported to ADFm Error Handler using below code.
BindingContext bctx = BindingContext.getCurrent(); ((DCBindingContainer)bctx.getCurrentBindingsEntry()).reportException(ex);
Note : Using the ADF model error handling for displaying exceptions thrown in managed beans require the current ADF Faces page to have an associated PageDef file (which is the case if the page or view contains ADF bound components).
Sample App is uploaded here. Following scenarios are covered :
| Scenario Description | Button Text in Sample App | Requires Explicit Handling to show messaage to User | |
| 1 | Drag and Drop AM Method on Page as command Button | throwJboExceptionFromAM | No |
| 2 | Call AM method in Bean method through bindings | Call throwJboExceptionFromAM in Bean through Bindings | No. By default, all exception are handled by ADFm Error Handler when calling AMMethod through bindings. When you check for exception in operationBinding and report it expliclity .. It is basically duplicating the message |
| 3 | throw an exception in ActionListener | ThrowingExceptionInActionListener | Yes. See the button in section Handled and it's actionListener. How the exception is reported . |
Enjoy !!!
Friday, November 14, 2014
Setting Button Action from ActionListener
Control the button Action based on the logic inside ActionListener
This post talks about how to control the button Action based on the logic inside ActionListener. Lets say there is a commandButton "Go to View2" on pageFragment "View1" . On Click of this button conditionally a navigation is required. Here goes the code :That's all ..enjoy.
Labels:
Action,
ActionListener,
ADF,
ADF Faces,
CommandButton
Tuesday, November 11, 2014
SelectBooleanCheckbox with [Y, N] values using a custom converter
How to show selectBooleanCheckbox with [Y,N} values using a custom converter.
So first we need a converter which converts [Y,N] to [true, false] and viceversa. Here goes the converter code :-
Next goes the code snippet showing usage of our converter in selectBooleanCheckbox.
So first we need a converter which converts [Y,N] to [true, false] and viceversa. Here goes the converter code :-
Converter needs to be declared in faces-config.xml ..
Next goes the code snippet showing usage of our converter in selectBooleanCheckbox.
Enjoy!!
Wednesday, October 15, 2014
Retain current row after Rollback or refresh
It is very common requirement to retain the current row on rollback or after executing VO. To retain the current Row, first get the current Row key and then call rollback. Now you have the rowKey to set the currentRow again.
Tuesday, September 30, 2014
Show Faces Message using JavaScript in ADF Faces
How to show faces Message using javaScript in ADF Faces
I have read this on Ashish Awasthi's blog. So if you want to read full detail sample refer to his blog.
For reference purpose, I am putting two lines of code here :
// Clear all validation message
AdfPage.PAGE.clearAllMessages();
//Invoke FacesMessage AdfPage.PAGE.addMessage('it1', new AdfFacesMessage(AdfFacesMessage.TYPE_ERROR, "Invalid Value", "Enter Characters Only"));
Other valid types are : TYPE_ERROR, TYPE_INFO, TYPE_WARNING, TYPE_FATAL .
Enjoy !!
Labels:
ADF,
ADF Faces,
Faces Message
Friday, September 26, 2014
WebProxy - Log Request and Response xml to console
How to view the request and response xml for a webservice call made using webProxy.
To see the soap request and response we can set a JAX-WS parameter.
"-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true" ,this will dump the data in your console output.
Edit the Run/Debug Profile for the project and then run it . See the screenshot for more details :
You can also write a SOAP logging handler ....will be covered in future posts.
Enjoy...
Labels:
ADF,
Logging,
WebProxy,
WebService
Tuesday, September 9, 2014
Groovy : Posted Attribute Value using groovy
How to get the posted attributeValue using Groovy .
To expose old value of entity objects, follow steps below :
1. Create transient attribute "OLD_SALARY" in Entity Object.
2. Make sure that "Persistent" and "Derived From SQL Expression" properties are turned off.
3. Set the "Value Type" to Expression and enter the following Groovy expression into the Value field:
adf.object.getPostedAttribute(adf.object.getAttributeIndexOf(model.EmployeesImpl.SALARY))
That's it... Now old salary attribute holds the value of salary retrieved from database. If required same attribute can be used in viewObject ...
Enjoy.
adf.object.getPostedAttribute(adf.object.getAttributeIndexOf(model.EmployeesImpl.SALARY))
That's it... Now old salary attribute holds the value of salary retrieved from database. If required same attribute can be used in viewObject ...
Enjoy.
Tuesday, August 5, 2014
Uploading Large Files to UCM - af:inputFile Component
This post covers uploading large files to UCM using inputFile Component.
JDeveloper Version : Studio Edition Version 11.1.1.7.0
Recently I was working with af:inputFile Component trying to upload files to UCM. I hit an issue when trying to upload files larger than 2MB. I am going to share my findings :
1. InputFile component gets stuck if trying to upload large file... and it doesn't even allow to select other small file once it is stuck. I searched google and found this :
Andrejusb Blog - Oracle UCM 11g uploading large files
Set this parameter "org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE" = 20971520 in web.xml for upload up to 20 MB.{ maximum file upload size to 20971520 bytes, or divided by 1024 and one more time by 1024 - 20 MB }
2. Now again question is - what happens after that 20MB file ... inputFile Component gets stuck. Further digging found that it is component bug and patch is available.
Dowload and apply Patch : 15931140
Enjoy !!
JDeveloper Version : Studio Edition Version 11.1.1.7.0
Recently I was working with af:inputFile Component trying to upload files to UCM. I hit an issue when trying to upload files larger than 2MB. I am going to share my findings :
1. InputFile component gets stuck if trying to upload large file... and it doesn't even allow to select other small file once it is stuck. I searched google and found this :
Andrejusb Blog - Oracle UCM 11g uploading large files
Set this parameter "org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE" = 20971520 in web.xml for upload up to 20 MB.{ maximum file upload size to 20971520 bytes, or divided by 1024 and one more time by 1024 - 20 MB }
2. Now again question is - what happens after that 20MB file ... inputFile Component gets stuck. Further digging found that it is component bug and patch is available.
Dowload and apply Patch : 15931140
Enjoy !!
Wednesday, May 28, 2014
Error Message html formatting
How to apply HTML formatting to error message
In my earlier post, I explained how to show error messages programmatically. This post covers how to apply HTML formatting to error messages. Credits to Ashish Awasthi's blog for this one.
Enjoy...
Subscribe to:
Posts (Atom)

