Comments on: Programmatic Navigation in WebCenter Portal application – do processAction from Java http://technology.amis.nl/2011/12/01/programmatic-navigation-in-webcenter-portal-application-do-processaction-from-java/ Friends of Oracle and Java Fri, 19 Sep 2014 07:10:40 +0000 hourly 1 http://wordpress.org/?v=4.0 By: Navaneet http://technology.amis.nl/2011/12/01/programmatic-navigation-in-webcenter-portal-application-do-processaction-from-java/#comment-7448 Thu, 24 Oct 2013 10:37:48 +0000 http://technology.amis.nl/blog/?p=14316#comment-7448 Hi, Can you share a sample application for this?

]]>
By: Ivo Leitão http://technology.amis.nl/2011/12/01/programmatic-navigation-in-webcenter-portal-application-do-processaction-from-java/#comment-7156 Mon, 16 Apr 2012 07:24:19 +0000 http://technology.amis.nl/blog/?p=14316#comment-7156 Hi ! I’ve made the exact same thing (tnks a lot for your code) but nothing happens, it stays in the same page. In my case i’m reacting to a js286 event published by one of my portlets. The page that hosts the portlet catches that event (that is working fine) but when i use your code I’m not able to jump to other page. There is some kind of precondition to execute this code that i’m not aware of ?
What I’m in doing a datacontrol is this:


package vdf.myvdf.ui.portal.wc;

import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;

import javax.faces.application.Application;
import javax.faces.component.html.HtmlCommandButton;
import javax.faces.context.FacesContext;

import javax.faces.event.ActionEvent;

import oracle.adf.model.binding.DCBindingContainerValueChangeEvent;
import oracle.adf.view.rich.context.AdfFacesContext;

import oracle.webcenter.navigationframework.NavigationContext;
import oracle.webcenter.portalframework.sitestructure.SiteStructureContext;
import oracle.webcenter.portalframework.sitestructure.SiteStructureResource;

public class EventHandler {
public EventHandler() {
super();
}

public void handleEventObjectPayload(DCBindingContainerValueChangeEvent customPayLoad) {
String changedDepartmentName =
(String)customPayLoad.getNewValue();
handleEventStringPayload(changedDepartmentName);
}

public void handleEventStringPayload(String customPayLoad) {
FacesContext facesCtx = FacesContext.getCurrentInstance();
Application application = facesCtx.getApplication();
ELContext elCtx = facesCtx.getELContext();
ExpressionFactory expFactory = application.getExpressionFactory();

ValueExpression ve = expFactory.createValueExpression(
elCtx,
"#{navigationContext.navigationModel['modelPath=/oracle/webcenter/portalapp/navigations/default-navigation-model'].node['home']}",
Object.class);
SiteStructureResource node = (SiteStructureResource)ve.getValue(elCtx);
HtmlCommandButton submitButton = (HtmlCommandButton)application.createComponent(
HtmlCommandButton.COMPONENT_TYPE);

ActionEvent actionEvent = new ActionEvent(submitButton);
actionEvent.getComponent().getAttributes().put("node", node);
NavigationContext navContext = SiteStructureContext.getInstance();
navContext.processAction(actionEvent);
}
}

]]>
By: Zafar Siddiqi http://technology.amis.nl/2011/12/01/programmatic-navigation-in-webcenter-portal-application-do-processaction-from-java/#comment-7138 Wed, 04 Apr 2012 18:05:37 +0000 http://technology.amis.nl/blog/?p=14316#comment-7138 Hi Lucas,

Great article and a wonderful tip. However, the code snippet is missing some bits like the definition of NOMINATION_DETAILS_PAGE_EL.

Would it be possible to put together a small sample around it and make available?

Thanks
Z.

]]>