cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Background Color

Former Member
0 Kudos

I need to display the following news item in a grey background

BoardMeeting to be held in Nov <More>

More is a link, clicking on which opens the news in detail.

The following is the code i have written to do this. However i am not able to set the background to grey.

Also the group has a gridlayout with colcount 2. So the More link is not displayed immediately after the news. It is displayed in the second column.

Can someone tell me how to do this?

IWDTransparentContainer rootContainer = (IWDTransparentContainer)view.getElement("RootUIElementContainer");
IWDGroup group = (IWDGroup)view.getElement("link_group");	

IWDTextView textView = (IWDTextView)			 view.createElement(IWDTextView.class, null);
textView.setText(abstractValue.getValueAsString());
textView.setWrapping(true);					
IWDLinkToURL linkToURL1 = (IWDLinkToURL)view.createElement(IWDLinkToURL.class,null);
linkToURL1.setText("More");
linkToURL1.setReference(tempRes.getAccessURI().toString());	
						
group.addChild(textView);
group.addChild(linkToURL1);

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can change the background color of a group using the "design"-property.

To get the link directly after the text, put both UI elements in a container with flow layout. Generally, prefer the MatrixLayout over GridLayout.

Armin

Former Member
0 Kudos

Armin,

If i set it to flow layout, all the news items are displayed continuously.

I want one news item below the other

<newsitem1><more>

<newsitem2><more>

Thanks

Former Member
0 Kudos

OK, then put them into a container with RowLayout, assign to each news item a "RowHeadData" such that they start a new row.

Armin

Former Member
0 Kudos

Armin,

I have created a gorup with rowlayout.

How do I assign each news item a rowheaddata programatically?

Former Member
0 Kudos

Thanks Armin, it solved my problem and u get points too:-)

Answers (5)

Answers (5)

Former Member
0 Kudos

hi sameer,

you can change the background color by making using of themes in portal.

regards

rahul

Former Member
0 Kudos

How to associate a custom theme with a webdynpro application?

Former Member
0 Kudos

Hi,

Refer to Lishas weblog on applying application specific themes in webdynpro

/people/lisha.peter/blog/2005/07/07/make-your-webdynpro-application-theme-specific

Also refer to bharaths article

https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/colour... webdynpro applications.pdf

Regards

Rohit

Message was edited by: Rohit Radhakrishnan

Former Member
0 Kudos

Hi Sameer,

Look at the following link:

There are two ways to achieve this.

This will set theme for all webdynpro application.

If you want to set for perticular one application then

append one parameter for theme to the url of your application.

Regards,

Bhavik

Former Member
0 Kudos

Hi Sameer,

Webdynpro provides only limited options for changing the color.In the following code change the primarycolor to secondary or some other suitable color

create the attribute .Select the type from dictionary simple type .Expand com.sap.ide....uielementdefinitions and chose group color

Write the following code to change color

IWDAttributeInfo info = wdContext.getNodeInfo().getAttribute("test");

group.bindDesign(info);

wdContext.currentContextElement().setTest(WDGroupDesign.PRIMARYCOLOR);

Hope this helps you.Kindly reward points if this is found usefull

Regards

Rohit

Former Member
0 Kudos

Hi Sameer,

I feel wedon't have much choice in selecting the background. You need to choose the one from available like PRIMARY,SAP,SECONDARY,SECONDARYBOX etc.

Regards, Anilkumar

Former Member
0 Kudos

Hi,

You can bind the design to a context attribute

IWDGroup group =

(IWDGroup) view.getElement("Group1");

group.bindDesign()

Hope this helps u

Regards

Rohit

Former Member
0 Kudos

Rohit,

Where do we specify the color as grey?

thanks

Former Member
0 Kudos

try using

Group.setDesign() method.

Regards, Anilkumar

Former Member
0 Kudos

Anilkumar,

Do you have a sample code which does this?

group.getDesign takes WDGroupDesign as parameter.

Anyidea how to set grey as the color in this?

Thanks