Skip to main content
12-Amethyst
April 2, 2025
Question

How to persist values entered in EDIT mode on custom TextBox/TextArea DataUtility ?

  • April 2, 2025
  • 2 replies
  • 923 views

Version: Windchill 12.1

 

Use Case: I have a custom String attribute on WTPart, and need a data utility where users can edit the attribute value and check-in the part. How to persist the value entered by User in EDIT UI and save it?


Description:

I have a custom String attribute on WTPart, and need a data utility where users can edit the attribute value and check-in the part. How to persist the value entered by User in EDIT UI and save it?

2 replies

12-Amethyst
April 4, 2025

Just by the descriotion it is not very clear what you are exactly looking for as you didnt shared the details of Data Utility. What type of different input you need for the users in edit window using data utility ? Persistance will come later once you have defined the DU. 

1102506012-AmethystAuthor
12-Amethyst
April 4, 2025

11025060_0-1743776279815.png

 

This is the custom Data Utility I have which is registered correctly to the Material Attribute2, and the value entered there is not being saved. I'm using OOTB edit form processor.

public class MyCustomDataUtility extends DefaultDataUtility
	{
	private static Logger logger;
	static {
		try {
			logger = LogR.getLogger("MyCustomDataUtility");
		} catch (Throwable throwable) {
			throw new ExceptionInInitializerError(throwable);
		}
	}

	@Override
	public Object getDataValue(String component_id, Object datum, ModelContext mc) throws WTException 
	{
		Object result=super.getDataValue(component_id,datum,mc);
		if(ComponentMode.VIEW.equals(mc.getComponentMode(mc.getDescriptor())))
		{
			 return super.getDataValue(component_id, datum, mc);
		}
		else if(ComponentMode.EDIT.equals(mc.getComponentMode(mc.getDescriptor())))
		{
			logger.debug("EDIT Mode");
			TextBox tb = new TextBox();
			tb.setId(component_id);
			tb.setName(component_id);
			tb.setWidth(40);
//			tb.setValue("this has to be value what user enters in the EDIT UI");
			return tb;
		}
		return result;
	}
}

 

1102506012-AmethystAuthor
12-Amethyst
April 4, 2025

I'm using OOTB form processor with a custom string attribute on the WTPart. 

HelesicPetr
22-Sapphire II
22-Sapphire II
April 4, 2025

Hi @11025060 

If you use own data utility to show the edit column and you define the datautility information correctly,

then the wizard save the information to the database without any additional customization.

 

If you do not use ootb edit wizard, then you have to write own code to save the value to the database. 

All methods how to achieve it is described in the Windchill catalog 

https://serverAdress/Windchill/app/#netmarkets/jsp/componentCatalog/wizardComponent.jsp

 

PetrH

1102506012-AmethystAuthor
12-Amethyst
April 10, 2025

I'm using OOTB form processor with a custom string attribute on the WTPart