cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

How to add new actions dropdown in toolbar?

OnurNalbantoglu
13-Aquamarine

How to add new actions dropdown in toolbar?

onur_0-1664369760408.pngI want to add a dropdown that I created to the toolbar, how can I do it?

5 REPLIES 5

Hi @OnurNalbantoglu 

Help describes how to add additional actions to a table

Try it.

Help Link

 

important think is to add the actions to a table {table.setMenubarName (“folders table menubar”);} you don't use a setActionModel

 

public ComponentConfig buildComponentConfig (ComponentParams params) {
    ComponentConfigFactory factory = getComponentConfigFactory ();
    JcaTableConfig table = (JcaTableConfig) factory.newTableConfig ();
    // add the menu bar action model to the table
    table.setMenubarName (“folders table menubar”);
    ....
    return table;
} 

 

 

Example how it looks like (i didn't define the name of submenu so it is without names :D)

HelesicPetr_0-1664438905240.png

I extended the FolderTableBuilder and added the submenu definition

@Override
public ComponentConfig buildComponentConfig(ComponentParams componentParams) throws WTException
{
ComponentConfig compConfif = super.buildComponentConfig(componentParams);
ComponentConfigFactory factory = this.getComponentConfigFactory();
((JcaTableConfig)compConfif).setMenubarName("folders table menubar");
return compConfif;
}

 

PetrH

A label is shown with own resourceBundle definition

HelesicPetr_0-1664449534615.png

PetrH

 

Can you explain in more detail where should I write this topic in codebase?

 

@OnurNalbantoglu 

You need to create own new class that Override the original one. 

The class can be in any your own package.

package cz.aveng.FolderTables;

import com.ptc.mvc.components.*;
import com.ptc.windchill.enterprise.folder.mvc.builders.FolderTableBuilder;
import wt.util.WTException;

@OverrideComponentBuilder
public class AVFolderTableBuilder extends FolderTableBuilder
{
	/**
	 * folderbrowser_table

	 * configuration in mvc congif file codebase\conf\mvc\custom.xml
	 * IMPORTANT OverrideComponentBuilder for overriding ootb builder
	 *     <bean class="cz.aveng.FolderTables.AVFolderTableBuilder"/>
	 * @param componentParams
	 * @return
	 * @throws WTException
	 */
	@Override
	public ComponentConfig buildComponentConfig(ComponentParams componentParams) throws WTException
	{
		ComponentConfig compConfif = super.buildComponentConfig(componentParams);
		ComponentConfigFactory factory = this.getComponentConfigFactory();
		((JcaTableConfig)compConfif).setMenubarName("folders table menubar"); //new menu in table,name of submenu in customActionModel,xml "folders table menubar" contains action submenus
		return compConfif;
	}
}

 

Then set mvc config in codebase\conf\mvc\custom.xml

<!-- Define the builders -->
    <bean class="cz.aveng.FolderTables.AVFolderTableBuilder"/>

 

the customActionModel definition has to be done. 

 

Check the help link I provided. There is description how to do so in other sections. 

HelesicPetr_0-1664950001288.png

 

 

PetrH

 

 

Hi @OnurNalbantoglu 

May be I miss the topic 😄

If you talk about labels then you need to write own class to specify the labels.

 

Class example

 

package cz.aveng.AVCustomMenu;

import wt.util.resource.RBEntry;
import wt.util.resource.RBUUID;
import wt.util.resource.WTListResourceBundle;

@RBUUID("cz.aveng.AVCustomMenu.folderCustomActionsRB")
public final class folderCustomActionsRB extends WTListResourceBundle {
     @RBEntry("Folder")
    public static final String Folder_DESCRIPTION = "object.folder file menu.description";

    @RBEntry("Folder")
    public static final String Folder_TITLE = "object.folder file menu.title";

    @RBEntry("Folder")
    public static final String Folder_TOOLTIP = "object.folder file menu.tooltip";

    @RBEntry("Edit")
    public static final String folder_edit_DESCRIPTION = "object.folder edit menu.description";

    @RBEntry("Edit")
    public static final String folder_edit_TITLE = "object.folder edit menu.title";

    @RBEntry("Edit")
    public static final String folder_edit_TOOLTIP = "object.folder edit menu.tooltip";

} // end class

 

 

customActionModels definition with resourceBundle class

HelesicPetr_1-1664958630011.png

 

PetrH

 

Top Tags