java dynamic form design analysis

In the form designer extension of Leihei.com, java implements background analysis (the content and fields of the plug-in have some changes from the original version). Tribute to Leipi Network.http://formdesign.leipi.org/ 

 

All code addresses are at  https://gitee.com/jjxliu306/deform

 

The parsing is all handled by java, the time is tight, and the code implementation does not consider too many efficiency issues. The original controls have been blocked. If you are interested, you can contact me to add them together. In addition, if you need to add new controls, you can also contact me ( [email protected] ).

 

Two data sheets:

 

drop table if exists form;
-- custom work order
create table form(
form_id	int auto_increment primary key ,
form_name varchar(255),
template text, -- the edited original html of the page
html text , -- the html code of the reverse parsed page (the display code should be parsed from the design to the defined select lictrl and other controls)
data text, -- jsonarray format storage of custom control fields
parse text ,
fields integer,
crtime timestamp,
modify_time timestamp
);

 

drop table if exists entry;
-- Save the records filled in for each work order
create table entry(
id	int auto_increment primary key ,
form_id int , -- Filled in dynamic work order ID
value text, -- is actually in json format, storing the dynamic form data filled in this time
crtime timestamp ,
modify_time	timestamp
);

 After the dynamic form is drawn, it is parsed by the background and stored in the database, and each subsequent work order is drawn on the page through the html in the form. After the work order is filled out, the form content jsonobject is sent to the background for verification and saving through the page.

 

 

 

 

Below are some screenshots of the current project.

1. New dynamic form



 
2. Dynamic form pre-browse



 
3. Fill in the work order with the dynamic form set up



 

4. View work order (readonly)



 

 

 

 

Function realization:

Most of the original fields in the dynamic form of Thunderbolt have been modified, such as not null, distinguishing name and title, adding select, radios, and checkbox data from the filled url through ajax, etc. Details are as follows:

1.  Add the notnull non-null option for text, textarea, select, checkboxs, listctrl, datepicker (self-incrementing controls). After checking this option, subsequent data input will be verified on the back end (for int, email in text) and other types will also be formatted).

2.  listctrl blocks units, totals, and default values, but adds non-null validation options for each column field (the int type of the field will also be validated).

3.  Distinguish name and title in all controls. Name is mainly used as a key in subsequent form storage results, and title is used for prompt use in subsequent form validation.

 

4.  The option data in the select, radios, and checkbox controls are displayed from the background by configuring the url.

 

 

The editing diagram of each control is as follows:

text:

 

textarea:

 

 

radio: 

 

checkboxs: 



 
select: 



 
datepicker:  

 

 listctrl:

 

 

Finally, here are some full pictures of the sample project:

 



 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326037017&siteId=291194637