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

We are happy to announce the new Windchill Customization board! Learn more.

Can we set few table rows as pre-selected and few rows as Non-Selectable?

mbhadiyadra
1-Newbie

Can we set few table rows as pre-selected and few rows as Non-Selectable?

Hi , As shown in image, all rows are pre-selected through data utility

In Tree-Builder :

ColumnConfig localColumnConfig2 = localComponentConfigFactory.newColumnConfig("abc", false);

localTreeConfig.setPreSelectableColumn(localColumnConfig2);

In xconf :

<Option serviceClass="PreSelectRowDataUtility"selector="abc"cardinality="duplicate"requestor="java.lang.Object"/>

In Data Utility :

public class PreSelectRowDataUtility extends AbstractBooleanValueDataUtility

{

  public boolean getBooleanAttributeValue(String paramString, Object paramObject, ModelContext paramModelContext) throws WTException

  {

   return true;

  }

}

Capture.JPG

Now we want first row as Non Selectable. There should be no checkbox in first row.

for that there is ptc method

localTreeConfig.setNonSelectableColumn(localColumnConfig2);

and DataUtility AbstractNonSelectableRowDataUtility

But there is already one data utility registered in xconf regarding this column"abc" . how we can do implement both functionality togather ?

Requesting for Help. Thanks

1 REPLY 1
BhushanNehe
14-Alexandrite
(To:mbhadiyadra)

Hi Manthan,

Did you check the example provided in the carambola examples, try following link on your server, replace the host appropriately.

https:/<hostname>/app/#ptc1/comp/carambola.mvc.tree.async

Basically in the example, if the number contains "3" or "1" the rows are pre-selected and if the number contains "7" or "4" (irrespective of first condition)the rows are non-selectable.

This is how it is implemented in the code:


  ColumnConfig col2 = factory.newColumnConfig("treeNonSelectableColumn", false);

           col2.setDataStoreOnly(true);

           col2.setNeed(NUMBER);

           tree.addComponent(col2);

           tree.setNonSelectableColumn(col2);

  

           //Pre Selected column

           ColumnConfig col3 = factory.newColumnConfig("treePreSelectableColumn", false);

           col3.setDataStoreOnly(true);

           col3.setNeed(NUMBER);

           tree.addComponent(col3);

           tree.setPreSelectableColumn(col3);

  

           tree.addComponent(factory.newColumnConfig(NUMBER, true));

Same columns listed twice with different dataUtilities.

Regards,

Bhushan

Top Tags