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
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
hats off to u....
ReplyDeleteI am glad you like it.
DeleteZB
Nice info Zeeshan
ReplyDeleteITS really gr8 sir..
ReplyDeleteI have an issue, where the popup does not load its contents for the first time, i.e its not able to navigate to the region for the first time, but from second time, it navigates and popup shows up with its contents. I am using regionNavigationListener to navigate to another region inside the popup. Do u have any idea about it
ReplyDeleteHi,
DeleteBest is to use debugger and log files, check if you find anything there. Also set the immediate property to true on action button it might skip any validation issues in the background.
Zeeshan