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

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

Got multiple objects but only display one on the windchill table.How to display all of them?

guide_me
8-Gravel

Got multiple objects but only display one on the windchill table.How to display all of them?

@ComponentBuilder({"erp.MaterialModelBuilder"})
public class MaterialModelBuilder extends AbstractComponentBuilder {

@Override
public ComponentConfig buildComponentConfig(ComponentParams componentParams) throws WTException {
ComponentConfigFactory factory = getComponentConfigFactory();
TableConfig tableConfig = factory.newTableConfig();
tableConfig.setId("erp.MaterialModelBuilder");
tableConfig.setLabel("物料数据");
tableConfig.setSelectable(true);
tableConfig.setActionModel("exportlisttofile_submenu");

ColumnConfig o_id = factory.newColumnConfig("o_id", "o_id", true);
o_id.setWidth(100);
tableConfig.addComponent(o_id);
return tableConfig;
}

@Override
public Object buildComponentData(ComponentConfig componentConfig, ComponentParams params) throws Exception {
String number = (String) params.getParameter("part_number");
String erpState = (String) params.getParameter("erp_state");
String fromDate = (String) params.getParameter("fromDate");
String toDate = (String) params.getParameter("toDate");

return getMaterielModel(number, erpState, fromDate, toDate); // getMaterielModel() return a 3 size List
}

Debug:

_10375061_0-1670329121019.png

_10375061_3-1670328712016.png

here is the jsp file

_10375061_1-1670328503511.png

_10375061_2-1670328538641.png

 

 

 

ACCEPTED SOLUTION

Accepted Solutions
HelesicPetr
22-Sapphire I
(To:guide_me)

Hi @guide_me 

Is the MaterialModel OOTB type of object or is it yours custom type of object?

I had same issue with WTPart. Only the last one has been shown in the table. 

I use my own type in my table and I had trouble to show more usage with same WTPart object

I needed to change the oid from WTpart to UsageLink oid and then it worked

 

do you have getOid method with Override?

@Override
public NmOid getOid()
{
return this.nmOid;
}

PetrH

View solution in original post

7 REPLIES 7

Do they have all a different oid? Each row needs to have a separate id, otherwise it's the same object.

Their oid is different.

_10375061_0-1670378106718.png

 

And I just find out only the last element of the returning list will display.

HelesicPetr
22-Sapphire I
(To:guide_me)

Hi @guide_me 

Is the MaterialModel OOTB type of object or is it yours custom type of object?

I had same issue with WTPart. Only the last one has been shown in the table. 

I use my own type in my table and I had trouble to show more usage with same WTPart object

I needed to change the oid from WTpart to UsageLink oid and then it worked

 

do you have getOid method with Override?

@Override
public NmOid getOid()
{
return this.nmOid;
}

PetrH

Finally, it works. THX!

I would suggest, that you use not any special oid column. I always use:

 

  @Getter
  private              NmOid oid;

 

this.oid = new NmSimpleOid("12345");

 

please name the oid column "oid". This will save you some problems.

it works. THX!

Announcements

Top Tags