[External] Wizard UI Validator
Jul 30, 2013
01:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Jul 30, 2013
01:36 PM
[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]
Patrick Williams | Engineering Systems | c: 616.947.2110
[cid:image001.jpg@01CE8D29.DD97ED20]
Labels:
- Labels:
-
Other
5 REPLIES 5
Jul 30, 2013
02:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Jul 30, 2013
02:28 PM
public UIValidationResult validateFormSubmission(..)
Jul 30, 2013
02:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Jul 30, 2013
02:32 PM
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"<br"/> targetFile="codebase/service.properties">
<option cardinality="duplicate" order="0" overridable="true"<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]
<service context="default" name="com.ptc.core.ui.validation.UIComponentValidator"<br"/> targetFile="codebase/service.properties">
<option cardinality="duplicate" order="0" overridable="true"<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]
Jul 30, 2013
03:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Jul 30, 2013
03:58 PM
Force output to not permitted or confirmation. If it still doesn't work you'll know.
Sent from my Verizon Wireless 4G LTE Smartphone
Sent from my Verizon Wireless 4G LTE Smartphone
Jul 31, 2013
11:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Jul 31, 2013
11:04 AM
It is possible you have the wrong action, selector.
Jul 31, 2013
01:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Jul 31, 2013
01:05 PM
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"<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]
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"<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]
