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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Translate the entire conversation x

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

11025060
11-Garnet

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

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?

6 REPLIES 6

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. 

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;
	}
}

 

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

Your observation is indeed correct. I replicated the data utility and found out similar behaviour. I tested also at CREATE page and the behviour remains same. The OOTB form processor is not persisting the value after create or checkin and the DU is only acting as data display on CREATE and EDIT pages. This was not the case in previous releases. Maybe you can open a ticket with PTC. In the mean time, I will also investigate from my side if anything has been changed from 12.0 or 12.1

HelesicPetr
22-Sapphire II
(To:11025060)

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

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

Announcements

Top Tags