Skip to main content
7-Bedrock
May 20, 2024
Question

Custom View in Structure Browser question

  • May 20, 2024
  • 3 replies
  • 1142 views

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?

3 replies

1-Visitor
May 21, 2024

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.

HelesicPetr
22-Sapphire II
22-Sapphire II
May 21, 2024

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

18-Opal
May 30, 2024

Hello SE_4597606,

Was the information provided helpful somehow ?

KR,

Charles.

7-Bedrock
May 30, 2024

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.