cancel
Showing results for 
Search instead for 
Did you mean: 

Custom LayoutSet with multiple Menus

Former Member
0 Kudos

Hello All -

I am trying to implement a custom layout set that will contain the basic tree\list layout but have 3 menu's

1. Standard Menu Bar Control

2. A Button Menu

3. A Link Menu

I have been playing with my layout set and see you can get the menu bar from your layout set configuration using the lines..

ControlFactory cf = ControlFactory.getInstance();

Control c = null;

com.sapportals.wcm.repository.IResourceContext context = getProxy().getResourceContext();

c = cf.getControl("MenuBarControl", context)

I am unsure where the String MenuBarControl comes from however and what it would be to get the Link or Button Control...

Thanks in advance for your help on this one.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Brandon

The MenuBarCotrol is a constant defining that a Menu Bar control is part of the Layoutset

,what userinterface elements can be part of the layoutset is defined by the Control Factory.

In your case you would see two other RenderingWrapperContol(s). This means your layout set

can have one menu bar control and two other collection renderers.

Now your question if you can get other controls on the Menu Bar?

I have tried creating a new Menu Bar by replacing the AdminMenu in the Layout set with my own custom menu. The custom menu can contain other commands and command groups depending on what you what to show.

Regards

Pran

Former Member
0 Kudos

Greetings again Pran,

I understand your comments, however I think we've missed from the asynchronous communication inherent to a forum.

I would like to have all 3 menus in one single layout. I know it sounds a bit strange, but by creating this layout it would give me some flexibility in the future to change items on the fly.

Essentially I want one row with the ability to have link commands, followed by a row with button commands followed finally by the menu bar commands then the breadcrumb and tree list layout.

Therefore the bottom half is standard, I need to only insert the top two controls.

I would prefer to be able to add two more collection renderers for my layout set (total of 5) 3 for menus (menu bar, link, and button) and two for the tree list.

Is there a similiar constant to define Link Menu Controls and Button Menu Controls?

Former Member
0 Kudos

Hi Brandon

To render the extra two Menu bars you need not define additional Collection renders , because the layout set can identify Menu Bars separately from Collection renders. To have more more Menu Bars you will have to modify the layout set code to something like this ...


  private void createControls() {
	this.controls = new Control[5]; 
	ControlFactory cf = ControlFactory.getInstance();
	Control c = null;
	IResourceContext context = this.getProxy().getResourceContext();

	c = cf.getControl(cf.MENU_BAR_CONTROL, context);
	this.controls[0] = c;
	if (c instanceof IMenu) {
	  ((IMenu) c).setProxy(this.getProxy());
	  ((IMenu) c).setPushStack(true);
	  ((IMenu) c).setGroup(IParameterName.UI_GROUP_MASS_KEY);
	}


	c = cf.getControl(cf.MENU_BAR_CONTROL, context);
	this.controls[1] = c;
	if (c instanceof IMenu) {
	  ((IMenu) c).setProxy(this.getProxy());
	  ((IMenu) c).setPushStack(true);
	  ((IMenu) c).setGroup(IParameterName.UI_GROUP_MASS_KEY);
	}
 //repeat again for third menu bar

However I have not tried getting a button into a menu bar. Links are possible as you are aware

Regards

Pran

Former Member
0 Kudos

Pran,

Thanks again. I tried what you have above and it did add additional menus however the menu is identical to the first.... using the Basic Collection Renderer definition I supplied in the Layout Set Settings

If I try to add another Basic Collection Renderer with different settings (Actions Style for Multiple Resources = button or link vs menu) none of the menus display.

Any ideas?

Thanks again for the help.

Former Member
0 Kudos

Hi Brandon

Your Layouset definition should look like this

Layout Controller AdminNavigationLayoutController

Collection Renderer

AdminBreadcrumb

AdminCollectionListRenderer

AdminCollectionTreeRenderer

AdminMenu (standard)

Menu2 (your own menu with links)

Menu3 (your own menu with button)

Resource Renderer AdminResourceRenderer

Regards

Pran

Former Member
0 Kudos

This is exactly what I have tried.

I based my custom layout controller on the MenuTreeListLayoutController (although they both implement the same rendering class... MenuTreeListLayoutController)

When additional menus are added in the collection renderer section (with the link and button config in them) it breaks the layout.

A simplier excercise it to simply change the Mass Actions Style from menu to something else... link, button etc in the AdminMenu Collection renderer and preview the layout set. If you do this, it does not display the menu at all.

I think the Menu_Bar_Control is coupled to this Actions Style... hence my origional question as to how to add additional menus (I don't think I can use the MenuBarControl)

Have you actually got it to work?

Thanks again.

Brandon

Former Member
0 Kudos

Hi Brandon

I did something similar to get button controls at the bottom of the screen. But I wrote a collection rendere while u are using a menu bar.

try changing this

  ((IMenu) c).setGroup(IParameterName.UI_GROUP_MASS_KEY);

to

  ((IMenu) c).setGroup(IParameterName.ACTIONSTYLE_BUTTON);

Regards

Pran

Former Member
0 Kudos

Again, no luck.

I think this is rooted in the use of the menu bar control.

Are there any example screens or areas (out of the box) of something using the link or button menus?

You mention you have done something similiar using a custom collection renderer. Perhaps I should try this way? Can you provide a little more details?

Thanks again.

Brandon