Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
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
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
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
Hi @HelesicPetr
I am able to get the user editable column via the APIs you have listed below ,but in my case i have some columns which is view only and data rendered from the custom business logic (using some engineering design formula ). unfortunately i can;'t use any of the api listed below to fetch this calculated data rendered in the column .
Any suggestion to fetch the non data utility table column data ??
HashMap textArea = nmCommandBean.getTextArea(); HashMap checked = nmCommandBean.getChecked(); HashMap unChecked = nmCommandBean.getUnChecked(); HashMap radio = nmCommandBean.getRadio(); HashMap text = nmCommandBean.getText(); HashMap comboBox = nmCommandBean.getComboBox();
Could you please help me why the PTC documented APIs List<NmOid> tableInfo = (ArrayList) nmCommandBean.getItemsToRender("tableID") ;
commandBean.getInitialItemsByName("tableID") ;
commandBean.getAddedItemsByName("tableID") ;
are not usable to get the data of each object in cutom wizards . i have used this in the OOTB change task resulting table builder where it works fine .
Hi @MS_9630520
So you have to use the calculated data logic that can be used in the processor.
Otherwise you are in a trap.
I always use an input from own datautility or windchill logic definition so the api works.
I do not know any other method.
I can just imagine that you have to use some java script that write the page information in the request or http address that you can read it anywhere.
I usually use an extraData in the http request and I save information there and I can pickup it anywhere but it has some limitation that one user can do an operation in one browser where the information has been saved. If he use another place it can be rewrite.
PetrH
Hi @HelesicPetr
Thanks for your suggestion .
I just created a datastore hidden editable column in my table builder and render the data with datautility . with that approach i am able to get the required data in form processor with below method .
nmCommandBean.getText();
Just one final question in your suggestion to use the Httprequest to store the column data . whether the data stored in the httprequest will be passed from the one wizard step to another wizard step and to formprocessor ?