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

The PTC Community will be on read only status starting March 23rd in preparation for moving our platform to a new provider. Read more here

Translate the entire conversation x

On Create Page, not able to grey out an attribute value using API

Kanchana
6-Contributor

On Create Page, not able to grey out an attribute value using API

Version: Windchill 13.0

 

Use Case: Unable to grey out an attribute using API


Description:

Wrote a Validator for the Color classification attribute to make the value Read only.  

KanchanaDutta_1-1769617718278.png

However, I want to make the Color Classification Attribute similar to Name Extension attribute.

KanchanaDutta_0-1769617591681.png

I did &jcaDebug on the attribute. DefaultDataUtility is showing. Checked for create page wizard jsp page. Also checked for GUIComponent.

Any suggestion on this?

ACCEPTED SOLUTION

Accepted Solutions
TDT
16-Pearl
16-Pearl
(To:Kanchana)

Read Only i.e Unassignable can be controlled using the Visibility feature in Type and Attribute Management.

If you want the attribute to be grayed out, it can be implemented through a data utility.

Use the following API to make the attribute non-editable

AttributeInputComponent attributeInputComponent =
    ((AttributeInputCompositeComponent) object).getValueInputComponent();
attributeInputComponent.setEditable(false);

 

View solution in original post

4 REPLIES 4
TDT
16-Pearl
16-Pearl
(To:Kanchana)

Hi @Kanchana,

Is there any specific reason for making the attribute read-only using a validator, when this can be achieved through configuration itself?

Do you want the attribute to be greyed out rather than unassignable?

Kanchana
6-Contributor
(To:TDT)

Through Configuration, I checked it under Cascading rules. Was not able to do.

Yes, I want it greyed out rather than Unassignable 

TDT
16-Pearl
16-Pearl
(To:Kanchana)

Read Only i.e Unassignable can be controlled using the Visibility feature in Type and Attribute Management.

If you want the attribute to be grayed out, it can be implemented through a data utility.

Use the following API to make the attribute non-editable

AttributeInputComponent attributeInputComponent =
    ((AttributeInputCompositeComponent) object).getValueInputComponent();
attributeInputComponent.setEditable(false);

 

Kanchana
6-Contributor
(To:TDT)

Thanks! Let me give a try.

Announcements


Top Tags