Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
@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:
here is the jsp file
Solved! Go to Solution.
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
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.
And I just find out only the last element of the returning list will display.
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!