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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

[External] Wizard UI Validator

pwilliams-3
11-Garnet

[External] Wizard UI Validator

What method did you implement in customization.sap.SAPMMNameValidator?

Patrick Williams | Engineering Systems | c: 616.947.2110
[cid:image001.jpg@01CE8D29.DD97ED20]
5 REPLIES 5
avillanueva
22-Sapphire II
(To:pwilliams-3)

public UIValidationResult validateFormSubmission(..)

Ok perfect. I am trying to do the same thing but for some unknown reason my callback isn't being called. Here is my site.xconf property as well as my .java file. What the heck am I missing? I don't see my println statement coming out in the MS log.

<service context="default" name="com.ptc.core.ui.validation.UIComponentValidator"&lt;br"/> targetFile="codebase/service.properties">
<option cardinality="duplicate" order="0" overridable="true"&lt;br"/> requestor="wt.change2.WTChangeActivity2"
selector="wizardEdit"
serviceClass="com.steelcase.enterprise.change2.validators.ChangeMgmtCreateWizardsValidator" />
</service>

package com.steelcase.enterprise.change2.validators;

import java.util.Locale;
import wt.util.WTException;
import com.ptc.core.ui.validation.*;

public class ChangeMgmtCreateWizardsValidator extends DefaultUIComponentValidator {

@Override
public UIValidationResult validateFormSubmission(UIValidationKey validationKey,
UIValidationCriteria validationCriteria,
Locale locale) throws WTException {

System.out.println("validateFormSubmission() called");
UIValidationResult result = UIValidationResult.newInstance(validationKey, UIValidationStatus.NOT_VALIDATED);
// perform your business logic here
// if you want to execute the action, do this:
result = UIValidationResult.newInstance(validationKey, UIValidationStatus.PERMITTED);
// if you want to abort the action, do this:
// result = UIValidationResult.newInstance(validationKey, UIValidationStatus.DENIED);
// if you want to prompt the user for confirmation, do this:
// result = UIValidationResult.newInstance(validationKey, UIValidationStatus.PROMPT_FOR_CONFIRMATION);
return result;
}
}

Patrick Williams | Engineering Systems | c: 616.947.2110
[cid:image002.jpg@01CE8D31.AB24E980]

Force output to not permitted or confirmation. If it still doesn't work you'll know.


Sent from my Verizon Wireless 4G LTE Smartphone
avillanueva
22-Sapphire II
(To:pwilliams-3)

It is possible you have the wrong action, selector.

I haven't tested it yet but here is what PTC said.

Hi Patrick,

I was able to get the validator called. I needed to add afterVK to the action definition for affectedAndResultingItemsStep (the proper technique for updating this entry is to copy to custom-actions.xml and perform the update there).

<action name="affectedAndResultingItemsStep" id="affectedAndResultingItems" preloadwizardpage="false" required="false" aftervk="steelcaseCAValidator">
<description>Affected and resulting objects wizard step</description>
<command class="com.ptc.windchill.enterprise.change2.forms.delegates.AffectedAndResultingItemsFormDelegate" windowtype="wizard_step"/">
</action>

I also made a change to the service entry as it is directly associated to the wizard step.

<service context="default" targetfile="codebase/service.properties" name="com.ptc.core.ui.validation.UIComponentValidator">
<option cardinality="duplicate" order="0" overridable="true"&lt;br"/> requestor="null"
selector=" steelcaseCAValidator "
serviceClass="com.steelcase.enterprise.change2.validators.ChangeMgmtCreateWizardsValidator"/>
</service>

Can you test this and let me know if will work for you?



Patrick Williams | Engineering Systems | c: 616.947.2110
[cid:image002.jpg@01CE8DEE.95942550]
Announcements

Top Tags