Skip to main content
1-Visitor
February 21, 2011
Question

GUI validation on an IBA attribute value.

  • February 21, 2011
  • 4 replies
  • 7391 views
  1. I have defined an IBA attribute of type string.
  2. Added this to a "package" object in PDMLink/ProjectLInk 9.1
  3. When i create a package , i can see this attribute in GUI and can enter a string value.
  4. My requirement is to validate the string value entered using some validation logic through some java code and if the validation is passed then only submit the package for creation otherwise return back saying the error message.

Any idea how can i do this validation on an IBA attribute.

-EK

4 replies

1-Visitor
March 4, 2011

there is one mothod that you can add a listener when the package object is created, so then you validate it

1-Visitor
March 4, 2011

Also you can write you own validator and insert them to wizard config, or you can use AJAX and add custom code into wizard jsp page. I think listener is bad way because you must show reason of problem in wizard dialog.

1-Visitor
March 4, 2011

Thanks Ivan, any pointers(documents) regarding wizard config. In the eventlistner option, if there is an error from event listener, the error is popped up in the wizard widow and further processing is restricted. But if i can pass a proper message from the listner, insted of the error message to the popup, that will solve the issue.

1-Visitor
December 4, 2014

Hello,

I have a similar requirement to validate IBA attribute on edit page. Did you have any resolution? If so please guide me with some sample codes.

Thanks in advance.

Tem

1-Visitor
December 4, 2014

Want to insure you are aware their are specific type of constraints you can setup for an IBA and these constraints are automatically checked on input of the IBA. These IBA constraints are managed from within Type Manager. I've used these type of constraints to perform data validation for IBA data creation. But these type of constaints are limited.

1-Visitor
December 8, 2014

I think you have a couple of options here.

a) If your wizard has a form processor, you can validate your IBA there. If the validation fails, return a feedback message to your wizard, otherwise simply invoke doOperation API of the parent form processor class.

b) You can write a validator and configure it in the action definition as shown below. The value of "afterVK" attribute is a validator. I hope this validator gets invoked when user navigates to next step and also when the wizard is submitted.

<action name="userInputStep" id="userInputStep" preloadWizardPage="false" hidden="true" afterVK="targetsAndAttributesValidation">

<description>User input step for Send to Distribution Target Wizard</description>

<command windowType="wizard_step" />

</action>

This is how the validator is configured in the one of the xconf files:

<Service context="default" name="com.ptc.core.ui.validation.UIComponentValidator">

<Option requestor="null" serviceClass="com.ptc.windchill.esi.validators.TargetsAndAttributesValidator" selector="targetsAndAttributesValidation"/>

</Service>

This is how the validator class looks

public class TargetsAndAttributesValidator extends DefaultUIComponentValidator {

public UIValidationResult validateFormSubmission(

UIValidationKey paramUIValidationKey,

UIValidationCriteria paramUIValidationCriteria, Locale paramLocale)

throws WTException {

Hope this helps!

-Ismail

1-Visitor
December 8, 2014

Ismail,

I thank you very much for your response. I’ll explore this scenario and let you know the progress.

Thanks

Tem

23-Emerald II
December 13, 2014

Tem,

Did you have any luck with Ismail's suggestion?