Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
I want to add a dropdown that I created to the toolbar, how can I do it?
Help describes how to add additional actions to a table
Try it.
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)
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
Can you explain in more detail where should I write this topic in codebase?
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.
PetrH
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
PetrH