Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
I am using Windchill PDMLink Release 12.0 and Datecode with CPS 12.0.2.10
I have a custom view in the structure browser, and have a data utility connected to one column. The request is to only show a value in this column for the first row (leave blank for all children). In the data utility, the object passed in is always a WTPart (even for all children). There is a method in the ModelContext called getCurrentRow, which does return 0 for the first row, but also returns 0 for some of the children. Is there any way to look at the ModelContext and/or object passed into the data utility and determine that it is the first row of the table?
Hello Kynect@SE_4597606 ,
To achieve the desired behavior in Windchill PDMLink's structure browser where a custom view only shows a value in the first row of a column and leaves it blank for all children, you can implement a more refined logic in your data utility. Since the getCurrentRow method isn't consistently differentiating the first row from its children, you might need to use additional properties or methods to identify the first row accurately.
Hi @SE_4597606
I believe that the getCurrectRow does not work correctly in the structure gwt table.
I would say the first row is the WTPart where the detail page is opened isn't it?
Then get the actual row object and compare it with the primary object from the ModelContext
//getDataValue(String component_id, Object obj, ModelContext modelContext)
NmOid primaryOid = modelContext.getNmCommandBean().getPrimaryOid();
WTPart primaryWTP = (WTPart) primaryOid.getRefObject();
if (obj.equals(primaryWTP))
{
// yes first row
}
PetrH
Hello SE_4597606,
Was the information provided helpful somehow ?
KR,
Charles.
I tried the suggestion above, and getNmCommandBean does return an NmCommandBean, but all of the methods of the bean return null (including getPrimaryOid()). I also tried to run initializeServerRequestData on the bean first before calling getPrimaryOid, but it still returned null. It would be nice to have this data in the view, but not worth the effort. Instead we are going to give the user a link to an external system where we can show the data.