Skip to Content
0
Former Member
Jun 12, 2009 at 04:18 AM

How to programmatically set the Visibility of an Iview INVISIBLE ?

47 Views

Hi ..... I need to programmatically set the visibility of an IView for a user Invisible - In order to achieve that , I am trying the below code....But getting errors-

Code -

-


Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sapportals.portal.pcd.gl.PcdInitialContextFactory");

env.put("com.sap.portal.jndi.requested_aspect","com.sap.portal.pcd.gl.PersistencyAspect");

env.put("java.naming.factory.object", "__IPcdContext__");

InitialContext iCtx = null;

String iViewID = "pcd:portal_content/ABC/1Portal/mywork/iviews/XYA_iViews/adf.ivw_ess_jspdynpage";

iCtx = new InitialContext(env);

IiView result =(IiView)iCtx.lookup(iViewID);

IiViews iViewSrv = (IiViews)PortalRuntime.getRuntimeResources().getService(IiViews.KEY);

INewObjectDescriptor IVtoCreate =(INewObjectDescriptor) iViewSrv.instantiateDescriptor(CreateMethod.NEW,"par:/applications/com.sap.km.cm/components/navigation",request.getUser());

IVtoCreate.putAttribute("com.sap.portal.navigation.invisible", true);

the above method putAttribute is not apllicablt for (String,Boolean)\

Please suggest as to how can I programmatically set an Iview Visible/Invisible .