Question
How to get the custom table data in the form processor
Version: Windchill 12.0
Use Case: we have build a custom wizard which contains the MVC table builder . Data for this table is provided via custom Bean object with getters and setters for each column . Now i want to get all the table data rendered in each rows in my formprocessor doOperation method .
Description:
we tried to get the table data using the below api , always i am getting null as return value .
commandBean.getInitialItemsByName("ext.plm.builders.PLMCustomTableBuilder")
Steps to reproduce this issue :
1.Create the custom wizard with table builder like below
public Object buildComponentData(ComponentConfig compConfig, ComponentParams compParams) throws Exception {
NmCommandBean nmCommandBean = ((JcaComponentParams) compParams).getHelperBean().getNmCommandBean();
return new PLMDemoTableBean(nmCommandBean);
}
@Override
public ComponentConfig buildComponentConfig(ComponentParams componentParams) throws WTException {
ColumnConfig numberColumnConfig = factory.newColumnConfig("partNumber", true);
numberColumnConfig.setSortable(true);
numberColumnConfig.setLabel("Number");
tableConfig.addComponent((ComponentConfig)numberColumnConfig);
ColumnConfig versionColumnConfig = factory.newColumnConfig("customAttr", true);
versionColumnConfig.setSortable(true);
versionColumnConfig.setLabel("Data1");
tableConfig.addComponent((ComponentConfig)versionColumnConfig);
return tableConfig;
}
2. I have defined the getters and setters for both partNumber and customAttr PLMDemoTableBean class.
3.Create a formprocessor for the custom wizard action and get the table data (ie PLMDemoTableBean object) in the doOperation method using the api
commandBean.getInitialItemsByName("ext.plm.builders.PLMCustomTableBuilder")
ComponentConfigFactory factory = this.getComponentConfigFactory();
TableConfig tableConfig = factory.newTableConfig();
tableConfig.setLabel("Demo Table");
tableConfig.setId("ext.plm.builders.PLMCustomTableBuilder");
tableConfig.setTypes(PLMDemoTableBean.class.getName());
ColumnConfig numberColumnConfig = factory.newColumnConfig("partNumber", true);
numberColumnConfig.setSortable(true);
numberColumnConfig.setLabel("Number");
tableConfig.addComponent((ComponentConfig)numberColumnConfig);
ColumnConfig versionColumnConfig = factory.newColumnConfig("customAttr", true);
versionColumnConfig.setSortable(true);
versionColumnConfig.setLabel("Data1");
tableConfig.addComponent((ComponentConfig)versionColumnConfig);
return tableConfig;
}
2. I have defined the getters and setters for both partNumber and customAttr PLMDemoTableBean class.
3.Create a formprocessor for the custom wizard action and get the table data (ie PLMDemoTableBean object) in the doOperation method using the api
commandBean.getInitialItemsByName("ext.plm.builders.PLMCustomTableBuilder")

