cancel
Showing results for 
Search instead for 
Did you mean: 

Want to modify an iview property through webdynpro java app

Former Member
0 Kudos

Hi All,

Can anybody please tell me how to modify an iview property through webdynpro java application?

I've already raised a thread for this earlier:

Please assist.

Regards,

Anurag

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Retrieving properties of iViews:

To get iview properties pass the full PCD path of the iview retrieving from the method : getPCDContents();

This code will help you to retrieve the properties of PCD contents.

public void getProperties(IPortalComponentRequest request , String id) throws Exception{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
env.put(Context.SECURITY_PRINCIPAL, request.getUser());
env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);
InitialContext iCtx = null;
try {
iCtx = new InitialContext(env);
IiView result = (IiView) iCtx.lookup(id);
result.getAttribute("com.sap.portal.pcd.gl.CreatedAt");
result.getAttribute("CodeLink");
result.getAttribute("com.sap.portal.pcd.gl.LastChangedBy");
result.getAttribute("com.sap.portal.pcd.gl.LastChangedAt"); result.getAttribute("com.sap.portal.pcm.Title",request.getLocale());
} catch (Exception e) {
throw new Exception (e);
}
}

try {
//setting few attributes of the iview
//Setting Forced Request Language to German
iView.putAttribute("ForcedRequestLanguage","de");
iView.save();
} catch (ValidationException e1) {
response.write(e1.getMessage());
} catch (IOException e1) {
response.write(e1.getMessage());
}

Edited by: Saurabh Agarwal on Jun 10, 2010 10:04 AM

0 Kudos

Hi All,

I have a similar requirement as Anurag. The difference is that based on certain conditions, I need to maximize or minimize the iView Tray programmatically.

I have 2 iViews - A and B. In iView "A", I have 2 buttons - Maximize and Minimize.

On clicking "Maximize" button in A iView, the iView tray in "B" iView should be expanded.

On clicking "Minimize" button in A iView, the iView tray in "B" iView should be collapsed.

I have written the following code:

<code>

//Set the property for iView tray

if (strTraySetting.equalsIgnoreCase("Max"))

{

myIView.putAttribute("com.sap.portal.iview.ExpansionMode", "Open");

myIView.save();

}

else if (strTraySetting.equalsIgnoreCase("Min"))

{

myIView.putAttribute("com.sap.portal.iview.ExpansionMode", "Close");

myIView.save();

}

</code>

However, the iView property is not being set and the B iView is not responding to dynamic iView tray setting. Can you please let me know what is the issue?

Thank you for the help in advance.

Regards,

Pavithra

Former Member
0 Kudos

Not required anymore.