Skip to main content
10-Marble
April 10, 2025
Question

How to get the custom table data in the form processor

  • April 10, 2025
  • 1 reply
  • 1062 views

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 {
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")

 
 





1 reply

HelesicPetr
22-Sapphire II
22-Sapphire II
April 15, 2025

Hi @MS_9630520 

Usually you have to use the right method to build a table in a wizard with internal ID then you could try to use List<NmOid> tableInfo = (ArrayList) nmCommandBean.getItemsToRender("tableID"); to get information from the table.

 

aslo all information from the wizard is stored in several array lists

HashMap textArea = nmCommandBean.getTextArea();
HashMap checked = nmCommandBean.getChecked();
HashMap unChecked = nmCommandBean.getUnChecked();
HashMap radio = nmCommandBean.getRadio();
HashMap text = nmCommandBean.getText();
HashMap comboBox = nmCommandBean.getComboBox();

each element in the list contains ID of the specific row from the table and name of the parameter.

 

PetrH

10-Marble
April 28, 2025

Hi @HelesicPetr ,

I tried your suggestion  of using this  List<NmOid> tableInfo = (ArrayList) nmCommandBean.getItemsToRender("tableID") API in preprocess method   unfortunately the i am gettling empty list from this API.
Problem i am facing only for fetching the table data . for other attribute  panel builder field i am able to get the values directly using other APIs shared above . 

Can you please advice do i need to enabled any  wizard or table configuration to fetch my table data in code