Friday, October 5, 2012

Oracle ADF - Using Region Navigation Listener in af:region

Greetings,

Its been long that i have posted something related to ADF. Thanks to my visitors who ask questions to keep me alive.

One reader shared a use case with me as follows

"We have a requirement to collapse a panel in Panel splitter for specific activity in a region"

The answer for that is use Region Listener in af:region component.

The Region Listener have a RegionNavigationEvent argument which can provide the current view in a af:region based on that you can conditionally collapse or expand panel

Example: Download complete example

In my bounded task flow i got 3 views, view 1-3 respectively as shown in the slide.





I have home page with Panel splitter and af:region in facet 2



My use case is to collapse left panel when user navigates to view 2 in a region.





I have a Region Listener as follows



I have panel splitter binding in the bean 



The Region Navigation Listener code is as follows


public class RegionNavigationListener {
    private RichPanelSplitter myPanel;

    public RegionNavigationListener() {
    }

    public void onRegionNavigated(RegionNavigationEvent region) {
        String viewId = region.getNewViewId();        
        
        if (viewId.equalsIgnoreCase("/region-flow-definition/view2")) {
            doCollapsePanel(myPanel);
        }
        else {
            doExpandPanel(myPanel);
        }
    }
    
    private void doCollapsePanel(RichPanelSplitter panel){    
        panel.setCollapsed(true);
        AdfFacesContext.getCurrentInstance().addPartialTarget(panel);  
    }
    
    private void doExpandPanel(RichPanelSplitter panel){    
        panel.setCollapsed(false);
        AdfFacesContext.getCurrentInstance().addPartialTarget(panel);  
    }
    

    public void setMyPanel(RichPanelSplitter myPanel) {
        this.myPanel = myPanel;
    }

    public RichPanelSplitter getMyPanel() {
        return myPanel;
    }
}


Hope you like it 

Follow me on twitter and happy Jdeveloping,
Zeeshan Baig 








Tuesday, August 28, 2012

I am Featured in Oracle Magazine September 2012 issue

Hi,

Its a great honor for me that my profile featured in Peer to Peer section of Oracle Magazine in September 2012 issue. I believe that issue will be main issue for Oracle Open World 2012 as well.

Check the following link Oracle Magazine Peer to Peer September 2012



I am thankful to all who supported through out my career so i can dream of this day and also to people who visited this blog and found it helpful.

P.S. Lot of people asking about the photo...Its Grand canyon Arizona i visited there after collaborate 2012 conference in Las Vegas.

Cheers,
Zeeshan Baig
Follow me Twitter @baigsorcl

Wednesday, July 18, 2012

Sharing Common Connections Between JDeveloper Machines

Hi,

In order to work in a team environment JDeveloper offers many small nuggets that can make our life easier and implement development standards.

In this post we will take a look how to export and import application servers, database connections from one  Jdeveloper machine to another. You can even store these connections in your source control system to share.

Resource Palette:

You will find common place for all connections in JDeveloper under Resource Palette. Click View menu and select Resource Palette




Exporting Connection:

Right click on your desired connection and choose Export, select which connections you want to export and provide the destination, click OK the resulting window will give you the status






Save the destination file to source control or network drive (optional):


For better teamwork i would recommend to store these connections in source control system as shown in the slide i have a folder in Visual SVN repository called Connections and under that the exported file from JDeveloper.






Importing a Connection into JDeveloper


Now developers can export the connections from source control system to their file system and import connections into JDeveloper.






There you go hope you find the post useful feel free to comment. More gold nuggets to follow.

Happy JDeveloping,
Zeeshan Baig






Friday, July 6, 2012

Solution to fix Exception java.lang.NoClassDefFoundError While running weblogic commands from console

Hi,

A quick one here. Most of us might experienced this when try to run weblogic.Deployer or any weblogic related command from console or shell prompt you see something like this

C:\>java weblogic.Deployer
Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/Deployer
Caused by: java.lang.ClassNotFoundException: weblogic.Deployer
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: weblogic.Deployer.  Program will exit.

The problem is NOT with your installation or configuration but actually java is not able to find classes related to weblogic

Solution:

The solution is to add the JAR file into the CLASSPATH variable.

C:\> set CLASSPATH=%CLASSPATH%;D:\Oracle\Middleware1035\wlserver_10.3\server\lib\weblogic.jar

Note:  Change above command as per your environment Linux or Windows also i saw some people add the location of the folder to Classpath which will not fix the issue you should provide the name of the JAR file as mentioned above.

You can see in the slide how the error gone by adding CLASSPATH to the environment.


Monday, July 2, 2012

My Presentation from Kscope 2012 Conference

Hi,

Kscope 2012 conference was a great event for me i am thankful to ODTUG management by providing me this opportunity also OTN who gave me opportunity to be on Fusion middleware panel during Lunch n Learn session.

You can view my presentation from Kscope from my slideshare account. I will post separate blog on the demo details.


Monday, June 4, 2012

My Interview featured in May 2012 OTN Harvest

Hi,

Its been a great honor for me to be featured in OTN Harvest Spotlight. I am thankful to Oracle to recognized my contribution and to all visitors of this blog by providing positive feedback which helps be keep going

You can find the digest online on Oracle’s website using following link http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#OtnHarvest


And download the issue http://www.oracle.com/technetwork/developer-tools/adf/learnmore/may2012-otn-harvest-1652358.pdf

Happy JDeveloping,
Zeeshan Baig