[Teamcenter 2007 Development Series] Web non-null authentication

Source: Internet
Author: User

Preface

TC 2007 web-side, the page concise is simple.

For non-null verification, add a red arrow + "Required value is not specified."

This verification appears to be managed in the same definition as the CF-side form.

This validation is done with attributes defined as require.

So what is the mechanism for implementing the web-side? Is it possible to do this verification directly on the web side without binding to the CF side?


Implementation Mechanism

To create an object, for example, the key action-component is



Modelentity--This is the object that the Web side uses to display

Outvalidationexception-A set of objects containing exception information.

With these concepts, it is easy to look at the Enterprisevalidationactioncomponent.java code to conclude:

Use Attributevalidationexception to get the results you want, and that's true.

Paste a code snippet:

attributevalidationexception[] attr_exceptions = new Attributevalidationexception[1]; Attributevalidationexception attr_exception = new Attributevalidationexception ("Description", "Required value is not" specified. "); Attr_exceptions[0] = attr_exception; Validationexception ve = new Validationexception (dialogmodelentity,attr_exceptions); Arguments.setobject (" Outvalidatedmodelentity ", dialogmodelentity);                Arguments.setobject ("Outvalidationexception", ve);                OptionSet options = Action_context.getoptionset ();                Option LocalOption2 = options.getoption ("Validation-error");


Application Status

If you need to use your own defined non-Create, Update dialog is validated,

or update depending on the status of the updated fields and required validation is different, you can consider this way.

(Of course, in addition to this side of the processing, but also need to combine other parts to complete the function)



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.