Atitit. Improved development efficiency --- the revolution of the MDA software development mode (4) ---- editing form Modeling

Source: Internet
Author: User

Atitit. Improved development efficiency --- the revolution of the MDA software development mode (4) ---- editing form Modeling

 

1. Selection of modeling language Anno + HTML... Not UML 1

2. Specify the display template @ beaneditform (tmplt = "C:/edit.html") 1

3. The @ property (lable = "XXX") of the configuration property is displayed 2

4. Configure the display control mode of properties @ datatype (value = datatypeconstants. Select, datasource = "C:/cate.htm") 2

5. The configuration ID is not displayed @ nonvisual 2

6. Attribute sorting @ beaneditform (reorder = "AA, BB") 2

7. Client verification @ validate ("required") @ validate ("min = 18, max = 99, MSG = 'reinput '") 2

8. Data Conversion @ com. attilax. Anno. converter (timeconvertero7.class) 3

9. Data conversion component timeconvertero7 4

10. Refer to 4

 

1. Selection of modeling language Anno + HTML... Not UML

Because there are only 10 data models, Ma includes process modeling.

 

Author: old wow's paw attilax iron, email: [email protected]

Reprinted please indicate Source: http://blog.csdn.net/attilax

 

2. Specify the display template @ beaneditform (tmplt = "C:/edit.html ")

 

Public class gvmaterial

 

3. the @ property (lable = "XXX") of the configuration property is displayed 4. configure the display control of properties @ datatype (value = datatypeconstants. select, datasource = "C:/cate.htm ")

Datatypeconstants. Time

Datatypeconstants. datetime

Datatypeconstants. File

Datatypeconstants. Select

@ Datatype (value = datatypeconstants. Select, datasource = "C:/cate.htm ")

5. the configuration ID does not display @ nonvisual6. attribute sorting @ beaneditform (reorder = "AA, BB") 7. client verification @ validate ("required") @ validate ("min = 18, max = 99, MSG = 'reinput '")

 

 

Validator

Constraint type

Description

Example

Email

-

Ensures that the given input looks like a valid e-mail address

<T: textfield value = "email" Validate = "email"/>

Max

Long

Enforces a maximum integer value

<T: textfield value = "Age" Validate = "max = 120, min = 0"/>

Maxlength

Int

Makes sure that a string value has a maximum length

<T: textfield value = "Zip" Validate = "maxlength = 7"/>

Min

Long

Enforces a minimum integer value

<T: textfield value = "Age" Validate = "max = 120, min = 0"/>

Minlength

Int

Makes sure that a string value has a minimum length

<T: textfield value = "somefield" Validate = "minlength = 1"/>

None

-

Does nothing (used to override a @ validate annotation)

<T: textfield value = "somefield" Validate = "NONE"/>

Regexp

Pattern

Makes sure that a string value conforms to a given pattern

<T: textfield value = "letterfield" Validate = "Regexp = ^ [A-Za-Z] + $"/>

Required

-

Makes sure that a string value is not null and not the empty string

<T: textfield value = "name" Validate = "required"/>

 

8. Data Conversion @ com. attilax. Anno. converter (timeconvertero7.class)

 

9. Data conversion component timeconvertero7

Class timeconvertero7 implements org. Apache. commons. beanutils. Converter

Public object convert (class arg0, object arg1 ){

// Attilax old wow's paw 5:24:02 am Jul 19,201 4

 

Try {

Return dateutil. totimestamp (arg1, true );

} Catch (parseexception e ){

// Attilax old wow's paw 5:28:07 am Jul 19,201 4

Core. Log (E );

Return 0;

}

 

}

 

10. Reference

Forms and validation -- Apache tapestry.htm

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.