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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Translate the entire conversation x

Call DataUtility uder Text box that is rendered by Table builder

AA_9841156
11-Garnet

Call DataUtility uder Text box that is rendered by Table builder

Version: Windchill 13.0

 

Use Case: Call DataUtility uder Text box that is rendered by Table builder


Description:

Call DataUtility uder Text box that is rendered by Table builder.

public Object buildComponentData(ComponentConfig config, ComponentParams params) throws Exception {
 
Map<String, GuiComponent> data = new HashMap<String, GuiComponent>();
GuiComponent comp = new TextBox();
((TextBox) comp).setName("editABC");
((TextBox) comp).setId("editABC");
((TextBox) comp).setRequired(true);
((TextBox) comp).setWidth(30);
data.put("editABC", comp);
LOGGER.trace("***  editABCTableBuilder  buildComponentData OUT");
return data;
}
 
@Override
public ComponentConfig buildComponentConfig(ComponentParams params) throws WTException {
 
ComponentConfigFactory factory = getComponentConfigFactory();
AttributePanelConfig attributePanelConfig = factory.newAttributePanelConfig();
GroupConfig groupConfig1 = factory.newGroupConfig("editABC","Edit ABC", Integer.valueOf(1));
AttributeConfig editABC = factory.newAttributeConfig();
editABC.setId("editABC");
editABC.setLabel("AfterMarket ABC");
editABC.setRequired(true);
groupConfig1.addComponent(editABC);
attributePanelConfig.addComponent(groupConfig1);
LOGGER.trace("*** editABCTableBuilder  buildComponentConfig OUT");
 
return attributePanelConfig;
}
18 REPLIES 18
TDT
16-Pearl
16-Pearl
(To:AA_9841156)

Hi @AA_9841156,

I understand that you want to build the Attribute Panel.

Do you want to call a Data Utility on one of the attribute present within the Attribute Panel group?

You can use the following API

editABC.setDataUtilityId("x");

where x represents the selector value used to register the Data Utility.

AA_9841156
11-Garnet
(To:TDT)

Hi @TDT .

Actually I am trying to create Attribute Panel in which two thing only .one is label and second i want Textbox in front of that and i want call datautility there.

I tried already editABC.setDataUtilityId("x") but its not hitting dataUtility

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

Have you registered the datautility?

AA_9841156
11-Garnet
(To:TDT)

Yes I registered

 

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

ok, What is the reason you need text box?

AA_9841156
11-Garnet
(To:TDT)

In Text box need to show suggested values.

 

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

Ok. Is there any specific reason for building it from the Attribute Panel?

Where exactly is this Attribute Panel being invoked from?

AA_9841156
11-Garnet
(To:TDT)

AA_9841156_1-1769770808695.png

 

 once click on action this wizard will open and after lable 

AA_9841156_2-1769770909114.png

 want to populate like this means suggested value through data utility .in part Create layout datauitility is working fine

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

Are the Create and Edit layouts coming from OOTB functionality, or have they been customized using the Attribute Panel?

 

 

AA_9841156
11-Garnet
(To:TDT)

its OOTB functionality

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

In that case, you can directly register the Data Utility on the attribute.

There is no need to build a separate Attribute Panel.

AA_9841156
11-Garnet
(To:TDT)

Hi @TDT ,

 

Actually in create Layout datautility is working same behavior want on wizard once action click on.

 

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

When you mention the Create layout, I assume it is OOTB, as you already confirmed.

Regarding the wizard that opens when clicking the action, Is that an OOTB wizard, or a custom one built using the JSP and Attribute Panel?

 

AA_9841156
11-Garnet
(To:TDT)

Its custom one built using the JSP and Attribute Panel

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

You will need to make a few changes to your existing logic.

I have tested the following logic, and it is working as expected.

No need to create TextBox.

@Override
	public ComponentConfig buildComponentConfig(ComponentParams componentParams) throws WTException {

		ComponentConfigFactory factory = getComponentConfigFactory();
		AttributePanelConfig attributePanelConfig = factory.newAttributePanelConfig();
		GroupConfig groupConfig1 = factory.newGroupConfig("editABC","Edit ABC", Integer.valueOf(1));
		AttributeConfig editABC = factory.newAttributeConfig();
		editABC.setId("editABC");
		editABC.setLabel("AfterMarket ABC");
		editABC.setRequired(true);
		groupConfig1.addComponent(editABC);
		AttributeConfig comp = factory.newAttributeConfig();
		comp.setId("editXYZ");
		comp.setLabel("AfterMarket XYZ");
		comp.setRequired(true);
		comp.setDataUtilityId("suggestionDataUtility");
		groupConfig1.addComponent(comp);
		attributePanelConfig.addComponent(groupConfig1);
		return attributePanelConfig;
	}



 

AA_9841156
11-Garnet
(To:TDT)

Could you please share your dataUtility

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

I did not implement the logic for the suggestions.

I only tested whether the Data Utility is being triggered.

Announcements
Top Tags