CN114356334B - TableView-based mobile terminal dynamic form generation method and device - Google Patents

TableView-based mobile terminal dynamic form generation method and device Download PDF

Info

Publication number
CN114356334B
CN114356334B CN202210066601.7A CN202210066601A CN114356334B CN 114356334 B CN114356334 B CN 114356334B CN 202210066601 A CN202210066601 A CN 202210066601A CN 114356334 B CN114356334 B CN 114356334B
Authority
CN
China
Prior art keywords
row
section
attribute
tableview
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210066601.7A
Other languages
Chinese (zh)
Other versions
CN114356334A (en
Inventor
安士才
王涛
丁未汀
冷政君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Jerei Digital Technology Co Ltd
Original Assignee
Shandong Jerei Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Jerei Digital Technology Co Ltd filed Critical Shandong Jerei Digital Technology Co Ltd
Priority to CN202210066601.7A priority Critical patent/CN114356334B/en
Publication of CN114356334A publication Critical patent/CN114356334A/en
Application granted granted Critical
Publication of CN114356334B publication Critical patent/CN114356334B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The invention relates to a mobile terminal dynamic form generation method based on TableView, which comprises the following steps: adding TableView at a mobile terminal and configuring basic attributes of the TableView; acquiring enterprise target service information, and determining characteristic relations between form entity objects and object attributes thereof; dividing Form entity objects into Form objects Form, Section and Row; creating a Form; creating a Section and adding the Section to a property list Section of Form; creating Row and adding the Row to an attribute list RowList of the Section; refreshing TableView by taking Form as a data source; realizing type attribute corresponding interaction of Row in a Row click event of TableView; the form value is stored into the value attribute of Row; and traversing each level of attribute list in the Form and assembling Form data. The invention automatically captures and encapsulates the form value into an object, thereby realizing the automatic generation, display and interaction of the dynamic form.

Description

TableView-based mobile terminal dynamic form generation method and device
Technical Field
The invention relates to a method and a device for generating a mobile terminal dynamic form based on TableView, belonging to the technical field of form data processing and representation.
Background
Currently, in the field of software, enterprise applications including but not limited to OA, CRM, ERP, etc. all provide support for mobile phone terminals. The business form of the enterprise application is usually designed based on the operation of the PC side, and because of the business requirement, the form is often complicated and large, and is not suitable for the operation of the mobile side. The form corresponding to the mobile terminal usually needs to be preset with a form configuration file in advance, and the form is inflexible and brings certain inconvenience to enterprise application.
The TableView, that is, the UITableView class, is called a Table view (list control), a row of the TableView is a content unit Cell, and many cells may form part of sections, each Section is divided into a Header and a Footer, and many sections form the whole Table, although the Table also has a Header and a Footer. Most interfaces of apps on the market today are tiled by tableView.
Disclosure of Invention
In order to solve the problems, the invention provides a method and a device for generating a mobile terminal dynamic form based on TableView, which can automatically capture and encapsulate the form into an object through a form value, and realize automatic generation, display and interaction of the dynamic form.
The technical scheme adopted for solving the technical problems is as follows:
in a first aspect, a method for generating a mobile terminal dynamic form based on TableView provided in an embodiment of the present invention includes the following steps:
adding TableView at the mobile terminal and configuring basic attributes of TableView;
acquiring enterprise target service information, and determining characteristic relations between form entity objects and object attributes thereof;
dividing the Form entity object into a Form object Form, a Form object selection and a Form object Row;
creating a Form object Form;
creating a Form object Section and adding the Section into a property list Section of a Form object Form;
creating a form object Row and adding the Row to an attribute list RowList of a form object selection;
refreshing TableView by using the Form object Form as a data source and using a native agent method;
realizing type attribute corresponding interaction of Row in a Row click event of TableView;
storing the form value into the value attribute of the form object Row;
and traversing SectionList and RowList in Form, and assembling Form data.
As a possible implementation manner of this embodiment, the creating a Form object Form includes:
defining a Form Section attribute of a sub-object in a Form object Form to add one or more Form object sections;
defining a form RowList attribute of the sub-object in the form object Section to add one or more form objects Row;
adding sub-objects of the Form object Form and the Form object selection to a sub-object List of the Form object Form and the Form object selection respectively by adopting an addcore method, wherein transfer parameters are corresponding sub-object entities and sequence numbers;
and setting tag attributes of the form object Section and the form object Row, wherein the types of the tag attributes are character strings.
As a possible implementation manner of this embodiment, the creating a Form object Section and adding the Form object Section to a property list Section list of a Form object Form includes:
traversing the List object Form to obtain a List set of child objects, and inquiring a Section object corresponding to a specific tag as a return value;
deleting the searched Section object from the Section list attribute, and transmitting the Section object searched by the parameters;
and adding a title attribute to the searched Section object to represent the title name of the form unit.
As a possible implementation manner of this embodiment, the creating a form object Row and adding the form object Row to an attribute list RowList of a form object Section includes:
recursively traversing the Section list and the RowList corresponding to each Form object Section, and inquiring the Form object Row corresponding to the specific tag as a return value;
deleting the inquired form object Row from the form RowList attribute of the child object of the Section of the parent form object corresponding to the form object Row, and transmitting the form object Row inquired by the parameters;
defining a table single-row enumeration type;
adding a type attribute to the form object Row to distinguish the form line type during rendering;
adding a value attribute to the form object Row to store a form field value given during form operation;
a title attribute is added to the form object Row to indicate a field display name of the form.
As a possible implementation manner of this embodiment, the refreshing TableView by using the Form object Form as a data source and using a native agent method includes:
the Form object Form, the Form object Section and the Form object Row three-layer structure correspond to the three-layer tree structure of Table, Sections and Rows in the native TableView, and the Form object Form is used as a data source to render the Form style;
analyzing the form style of the list, and displaying the field display name of the form according to the title attribute of the form object Row; and displaying the value of the corresponding field of the form according to the value attribute of the form object Row.
As a possible implementation manner of this embodiment, traversing the sectionallist and RowList in the Form, and assembling the Form data includes:
creating a set object of a key value pair type;
all Form objects Row nested in the Form of the recursion traversal table take tag attribute as key value of key value pair, and value attribute as value of key value pair to be added into the set object.
In a second aspect, a method for generating a mobile terminal dynamic form based on TableView provided in an embodiment of the present invention includes the following steps:
adding TableView at the mobile terminal and configuring basic attributes of TableView;
acquiring enterprise target service information, and determining characteristic relations between form entity objects and object attributes thereof;
defining a form entity object and constructing a data structure;
displaying and rendering the form based on TableView;
and capturing form data to generate a mobile terminal dynamic table.
As a possible implementation manner of this embodiment, the defining a form entity object and constructing a data structure includes:
dividing the Form entity object into three layers of a Form object Form, a Form object Section and a Form object Row according to the characteristic relationship among the object attributes in the Form entity object;
defining a Form Section attribute of a sub-object in a Form object Form to add one or more Form object sections;
defining a form RowList attribute of the sub-object in the form object Section to add one or more form objects Row;
adding sub-objects of the Form object Form and the Form object selection to a sub-object List of the Form object Form and the Form object selection respectively by adopting an addcore method, wherein transfer parameters are corresponding sub-object entities and sequence numbers;
setting tag attributes of the form object Section and the form object Row, wherein the types of the tag attributes are character strings;
traversing and inquiring the Form object Section for the Form object Form, transmitting a parameter tag character string, and adding a title attribute to the inquired Form object Section;
and traversing the Form object Form to query the Form object Row, transmitting a parameter tag character string, and adding a type attribute, a value attribute and a title attribute to the queried Form object selection.
As a possible implementation manner of this embodiment, the performing display rendering on the form based on TableView includes:
the Form object Form, the Form object Section and the Form object Row three-layer structure correspond to the three-layer tree structure of Table, Sections and Rows in the native TableView, and the Form object Form is used as a data source to render the Form style;
analyzing the form style of the list, and displaying the field display name of the form according to the title attribute of the form object Row; displaying the value of the corresponding field of the form according to the value attribute of the Row of the form object;
triggering a single-Row click event, and realizing corresponding click interaction according to the type attribute of the Row corresponding to the form object.
In a third aspect, an apparatus for generating a mobile terminal dynamic form based on TableView provided by an embodiment of the present invention includes a processor, a memory and a bus, where the memory stores machine-readable instructions executable by the processor, and when the apparatus is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform any of the above steps of the method for generating a mobile terminal dynamic form based on TableView.
The technical scheme of the embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a method for generating a mobile terminal dynamic form based on TableView, which comprises the steps of firstly adding TableView at a mobile terminal and configuring basic attributes of the TableView; acquiring enterprise target service information, and determining characteristic relations between form entity objects and object attributes thereof; dividing the Form entity object into three layers of a Form object Form, a Form object selection and a Form object Row, and sequentially creating three parent-child objects; then refreshing TableView by using the Form object Form as a data source and using a native agent method; realizing type attribute corresponding interaction of Row in a Row click event of TableView; and finally traversing the SectionList and the RowList in the Form, and assembling the Form data to generate a mobile-end dynamic Form.
The embodiment of the invention provides a mobile terminal dynamic form generation method based on TableView, which comprises the following steps: adding TableView at the mobile terminal and configuring basic attributes of TableView; acquiring enterprise target service information, and determining characteristic relations between form entity objects and object attributes thereof; defining a form entity object and constructing a data structure; displaying and rendering the form based on TableView; and capturing form data to generate a mobile terminal dynamic table. The invention automatically captures and encapsulates the form value into an object, thereby realizing the automatic generation, display and interaction of the dynamic form.
According to the method, the form configuration file does not need to be preset in advance, and the form can be automatically generated through a built-in data source during development of the mobile terminal or a data source transmitted from a server background; the form can be dynamically refreshed by changing the form data source and the reloading method of TableView, and form items are increased or decreased, so that dynamic form and field cascading is realized; one-key grabbing and object packaging of form data are realized.
The method generates the mobile terminal dynamic table based on the native protocol of the mobile platform, is light in weight and simple in process, and supports secondary extension development and modification of table single-character segment types, interaction and display styles; and the dynamic increase and decrease of the form can be realized, richer functions are realized, the workload of form development is reduced, and the development cost is reduced.
Description of the drawings:
FIG. 1 is a flow diagram illustrating a TableView-based mobile-side dynamic form generation method in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating another TableView-based mobile-side dynamic form generation method in accordance with an illustrative embodiment;
FIG. 3 is a schematic structural diagram illustrating an apparatus for generating a mobile-side dynamic form based on TableView according to an exemplary embodiment;
FIG. 4 is a diagram illustrating a mobile dynamic form (when a title is set to "client name") in accordance with an illustrative embodiment;
FIG. 5 is a diagram illustrating a mobile-side dynamic form (when a title is set to "Create time") in accordance with an illustrative embodiment;
fig. 6 is a diagram illustrating a mobile dynamic form (when a title is set to "valid or not") according to an example embodiment.
Detailed Description
The invention is further illustrated by the following examples in conjunction with the accompanying drawings:
in order to clearly explain the technical features of the present invention, the following detailed description of the present invention is provided with reference to the accompanying drawings. The following disclosure provides many different embodiments, or examples, for implementing different features of the invention. To simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. It should be noted that the components illustrated in the figures are not necessarily drawn to scale. Descriptions of well-known components and processing techniques and procedures are omitted so as to not unnecessarily limit the invention.
FIG. 1 is a flowchart illustrating a TableView-based mobile side dynamic form generation method according to an exemplary embodiment. As shown in fig. 1, a method for generating a mobile side dynamic form based on TableView according to an embodiment of the present invention includes the following steps:
adding TableView at the mobile terminal and configuring basic attributes of TableView;
acquiring enterprise target service information, and determining characteristic relations between form entity objects and object attributes thereof;
dividing the Form entity object into a Form object Form, a Form object selection and a Form object Row;
creating a Form object Form;
creating a Form object Section and adding the Section into a property list Section of a Form object Form;
creating a form object Row and adding the Row into an attribute list RowList of the form object Section;
refreshing TableView by using the Form object Form as a data source and using a native agent method;
realizing type attribute corresponding interaction of Row in a Row click event of TableView;
storing the form value into the value attribute of the form object Row;
and traversing the SectionList and the RowList in the Form, and assembling the Form data.
As a possible implementation manner of this embodiment, the creating a Form object Form includes:
defining a Form Section attribute of a sub-object in a Form object Form to add one or more Form object sections;
defining a form RowList attribute of the sub-object in the form object Section to add one or more form objects Row;
adding sub-objects of the Form object Form and the Form object selection to a sub-object List of the Form object Form and the Form object selection respectively by adopting an addcore method, wherein transfer parameters are corresponding sub-object entities and sequence numbers;
and setting tag attributes of the form object Section and the form object Row, wherein the types of the tag attributes are character strings.
As a possible implementation manner of this embodiment, the creating a Form object Section and adding the Form object Section to a property list Section list of a Form object Form includes:
traversing the List object Form to obtain a List set of child objects, and inquiring a Section object corresponding to a specific tag as a return value;
deleting the searched Section object from the Section list attribute, and transmitting the Section object searched by the parameters;
and adding a title attribute to the searched Section object to represent the title name of the form unit.
As a possible implementation manner of this embodiment, the creating a form object Row and adding the form object Row to an attribute list RowList of a form object Section includes:
recursively traversing the Section list and the RowList corresponding to each Form object Section, and inquiring the Form object Row corresponding to the specific tag as a return value;
deleting the inquired form object Row from the form RowList attribute of the child object of the Section of the parent form object corresponding to the form object Row, and transmitting the form object Row inquired by the parameters;
defining a table single-row enumeration type;
adding a type attribute to the form object Row to distinguish the form line type during rendering;
adding a value attribute to the form object Row to store a form field value given during form operation;
a title attribute is added to the form object Row to indicate the field display name of the form.
As a possible implementation manner of this embodiment, the refreshing TableView by using the Form object Form as a data source and using a native agent method includes:
the Form object Form, the Form object selection and the Form object Row three-layer structure correspond to the three-layer tree structure of Table, Sections and Rows in the native TableView, and the Form object Form is used as a data source to render the Form style;
analyzing the form style of the list, and displaying the field display name of the form according to the title attribute of the form object Row; and displaying the value of the corresponding field of the form according to the value attribute of the form object Row.
As a possible implementation manner of this embodiment, the implementing type attribute corresponding interaction of Row in a Row click event of TableView includes:
triggering a single-Row click event, and realizing corresponding click interaction according to the type attribute of the Row corresponding to the form object.
As a possible implementation manner of this embodiment, traversing the sectionallist and RowList in the Form, and assembling the Form data includes:
creating a set object of a key value pair type;
all Form objects Row nested in the recursive traversal Form object Form take the tag attribute as the key value of the key-value pair, and the value attribute as the value of the key-value pair to be added into the set object.
In this embodiment, at first, a TableView is added to a mobile terminal and basic attributes of the TableView are configured; acquiring enterprise target service information, determining a characteristic relation between a Form entity object and object attributes thereof, dividing the Form entity object into three layers of a Form object Form, a Form object selection and a Form object Row, and sequentially creating three parent-child objects; then refreshing TableView by using the Form object Form as a data source and using a native agent method; realizing type attribute corresponding interaction of Row in a Row click event of TableView; and finally traversing the SectionList and the RowList in the Form, and assembling the Form data to generate a mobile-end dynamic Form.
The embodiment generates the mobile terminal dynamic table based on the native protocol of the mobile platform, so that the table is light-weight in package, the flow is simple, and secondary extension development and modification of table single-segment types, interaction and display styles are supported; and the dynamic increase and decrease of the form can be realized, richer functions are realized, the workload of form development is reduced, and the development cost is reduced.
As shown in fig. 2, another method for generating a mobile terminal dynamic form based on TableView according to an embodiment of the present invention includes the following steps:
adding TableView at the mobile terminal and configuring basic attributes of TableView;
acquiring enterprise target service information, and determining characteristic relations between form entity objects and object attributes thereof;
defining a form entity object and constructing a data structure;
displaying and rendering the form based on TableView;
and capturing form data to generate a mobile terminal dynamic table.
As a possible implementation manner of this embodiment, the defining a form entity object and constructing a data structure includes:
dividing the Form entity object into three layers of a Form object Form, a Form object Section and a Form object Row according to the characteristic relationship among the object attributes in the Form entity object;
defining a Form Section attribute of a sub-object in a Form object Form to add one or more Form object sections;
defining a form RowList attribute of the sub-object in the form object Section to add one or more form objects Row;
adding sub-objects of the Form object Form and the Form object selection to a sub-object List of the Form object Form and the Form object selection respectively by adopting an addcore method, wherein transfer parameters are corresponding sub-object entities and sequence numbers;
setting tag attributes of the form object Section and the form object Row, wherein the types of the tag attributes are character strings;
traversing and inquiring the Form object Section for the Form object Form, transmitting a parameter tag character string, and adding a title attribute to the inquired Form object Section;
and traversing the Form object Form to query the Form object Row, transmitting a parameter tag character string, and adding a type attribute, a value attribute and a title attribute to the queried Form object Section.
As a possible implementation manner of this embodiment, the traversing a Form object Form to query a Form object Section, transferring a parameter tag character string, and adding a title attribute to the queried Form object Section includes:
traversing the List object Form to obtain a List set of child objects, and inquiring a Section object corresponding to a specific tag as a return value;
deleting the searched Section object from the Section list attribute, and transmitting the Section object searched by the parameters;
and adding a title attribute to the queried Section object to represent the title name of the form unit.
As a possible implementation manner of this embodiment, the traversing a Form object Form to query a Form object Row, transferring a parameter tag character string, and adding a type attribute, a value attribute, and a title attribute to a query Form object Section includes:
recursively traversing the Section list and the RowList corresponding to each Form object Section, and inquiring the Form object Row corresponding to the specific tag as a return value;
deleting the inquired form object Row from the form RowList attribute of the child object of the Section of the parent form object corresponding to the form object Row, and transmitting the form object Row inquired by the parameters;
defining a table single-row enumeration type;
adding a type attribute to the form object Row to distinguish the form line type during rendering;
adding a value attribute to the form object Row to store a form field value given during form operation;
a title attribute is added to the form object Row to indicate the field display name of the form.
As a possible implementation manner of this embodiment, the performing display rendering on the form based on TableView includes:
the Form object Form, the Form object Section and the Form object Row three-layer structure correspond to the three-layer tree structure of Table, Sections and Rows in the native TableView, and the Form object Form is used as a data source to render the Form style;
analyzing the list form style, and displaying the field display name of the form according to the title attribute of the form object Row; displaying the value of the corresponding field of the form according to the value attribute of the Row of the form object;
triggering a single-Row click event, and realizing corresponding click interaction according to the type attribute of the Row corresponding to the form object.
As a possible implementation manner of this embodiment, the capturing form data and generating a mobile-end dynamic table include:
creating a set object of a key value pair type;
all Form objects Row nested in the recursive traversal Form object Form take the tag attribute as the key value of the key-value pair, and the value attribute as the value of the key-value pair to be added into the set object.
The method for generating a mobile terminal dynamic form based on TableView mainly relates to the following three aspects.
1. And (4) defining a form entity object and constructing a data structure.
(1) The Form object is divided into three layers (hereinafter referred to as Form, Section, and Row) of a Form object Form, a Form object Section, and a Form object Row. The Form Section attribute is defined in the Form object for adding one or more Section objects (i.e., children of the Form object), and the Section object definition Form RowList attribute is defined for adding one or more Row objects (i.e., children of the Section object). All the line object values in the form can be traversed in a recursive traversal mode through the data structure.
(2) The Form object and the Form Section object respectively realize an addcathedren method for adding respective child objects to a child object List, transfer parameters are corresponding child object entities and sequence numbers, the method is internally realized by calling a native List set adding method, and the subscript of the List set is the sequence number transferred by the parameters.
(3) And the tag attribute is set by the form Section object and the form Row object, and the attribute type is a character string. And assigning values when the objects are instantiated, and using the values as the field names when the forms are captured, wherein the values are used for traversing, searching and acquiring corresponding object entities. It is required that all tags in one Form are not allowed to repeat.
(4) The Form object realizes traversing query of a Section object method formSectionWithtag and refers to tag character strings, the method realizes query of a Section object corresponding to a specific tag as a return value through traversing a sub-object List set, and null is returned when query is not available.
(5) The Form object realization removeFormSection method is used for deleting a corresponding Section object from a Section List attribute, the transfer parameter is the Section object inquired in the step (4), the method is internally realized by calling a native List set removal method, and refreshing display is carried out through a Form display rendering step.
(6) And the Section object adding title attribute represents the title name of the form unit.
(7) The Form object realizes traversing query of a Row object method formRowWithtag and parameter transmitting tag character strings, the method realizes query of a Row object corresponding to a specific tag as a return value through recursion traversal of a Section List and a RowList corresponding to each Section, and null is returned when query is not successful.
(8) The method for realizing removeFormRow by the Form object is used for deleting the Row child object in the Form, the transfer parameter is the Row object inquired in the step (7), the method is internally realized by recursively traversing SectionList and RowList corresponding to each Section to search the parent-level Sectionobject corresponding to the Row object, and the Section object is used for calling the native List set to remove the Row object to delete the Row object. And refreshing the display through a form display rendering step.
(9) Define table single line type enumerations containing common text inputs, selectors, dates, switch switches, etc.
(10) Adding a type attribute to the Row object, and taking the value of the enumeration type specified in the step (9). Value is assigned when an object is instantiated. To distinguish the table line types from each other in rendering.
(11) And adding a value attribute to the Row object to store the field value of the form given during the operation of the form.
(12) And the Row object adds a title attribute to indicate the field display name of the form.
2. And rendering the form display.
(1) And by using a three-layer tree structure of Table, Sections and Rows in the Form object Form, the Form object Section and the Form object Row corresponding to the native TableView, using the Form object (in which the sub-object attributes are nested step by step) as a data source, calling a TableView native agent method to render a Form pattern, and refreshing list Form display by using the TableView native reload method.
(2) And analyzing the list form style through a TableView native proxy method, and displaying the field display name of the form according to the title attribute of the Row object. And displaying the value of the corresponding field of the form according to the value attribute of the Row object. The style can be customized according to actual requirements.
(3) Triggering a single-line click event by the native agent method of TableView, and realizing corresponding click interaction according to the type attribute of the corresponding Row object, such as: and the selector and the date pop up corresponding picker components, the text input type pops up keyboard input, and the switch type switches the switch state. The form value is assigned to the value attribute of the corresponding Row object. And refreshing the list form display by a TableView native load method.
3. And (5) capturing form data.
(1) A collection object of a key-value pair type, hereinafter referred to as entity, is created.
(2) And the Form object realizes a Form data capture method, and the method name is for example Form values.
(3) The method comprises the following steps: all Row objects nested in the Form objects are recursively traversed, tag attributes are used as key values of key value pairs, value attributes are used as value values of the key value pairs and added into the entry objects, and entry objects are returned.
The method for generating the mobile terminal dynamic form based on TableView in the embodiment comprises the following steps: acquiring target service information according to enterprise service requirements, and determining a form entity object; defining a form entity object and constructing a data structure; displaying and rendering the form based on TableView; and capturing form data to generate a mobile terminal dynamic table. The invention realizes the automatic capture and encapsulation of the form value into the object through the automatic generation, display and interaction of the dynamic form.
The embodiment generates the mobile terminal dynamic table based on the native protocol of the mobile platform, so that the table is light-weight in package, the flow is simple, and secondary extension development and modification of table single-segment types, interaction and display styles are supported; and the dynamic increase and decrease of the form can be realized, richer functions are realized, the workload of form development is reduced, and the development cost is reduced.
As shown in fig. 3, an apparatus for generating a TableView-based mobile terminal dynamic form according to an embodiment of the present invention includes a processor, a memory and a bus, where the memory stores machine-readable instructions executable by the processor, and when the apparatus is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform any of the above steps of the method for generating a TableView-based mobile terminal dynamic form.
Specifically, the memory and the processor can be general-purpose memory and processor, which are not limited specifically, and when the processor runs a computer program stored in the memory, the TableView-based mobile terminal dynamic form generation method can be executed.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 3 is not intended to be limiting of the apparatus, and may include more or fewer components than those shown, or some components may be combined, some components may be separated, or a different arrangement of components.
In some embodiments, the apparatus may further include a touch screen operable to display a graphical user interface (e.g., a launch interface for an application) and to receive user operations with respect to the graphical user interface (e.g., launch operations with respect to the application). A particular touch screen may include a display panel and a touch panel. The Display panel may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), and the like. The touch panel may collect contact or non-contact operations on or near the touch panel by a user and generate preset operation instructions, for example, operations of the user on or near the touch panel using any suitable object or accessory such as a finger, a stylus, etc. In addition, the touch panel may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction and gesture of a user, detects signals brought by touch operation and transmits the signals to the touch controller; the touch controller receives touch information from the touch detection device, converts the touch information into information capable of being processed by the processor, sends the information to the processor, and receives and executes commands sent by the processor. In addition, the touch panel may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, a surface acoustic wave, and the like, and may also be implemented by any technology developed in the future. Further, the touch panel may overlay the display panel, a user may operate on or near the touch panel overlaid on the display panel according to a graphical user interface displayed by the display panel, the touch panel detects an operation thereon or nearby and transmits the operation to the processor to determine a user input, and the processor then provides a corresponding visual output on the display panel in response to the user input. In addition, the touch panel and the display panel can be realized as two independent components or can be integrated.
The following describes an example of automatically generating a customer information form, and a process of generating a dynamic form by using the method or apparatus of the present invention is described.
Step 1, instantiating a concrete object Form of the Form class.
Step 2, instantiating the concrete object Section of the Section class and setting tag as 'Section'.
And 3, setting the title of the section as client information.
And 4, adding section into the section List of the form through the addcathedren method of the form.
Step 5, instantiating a concrete object custNameRow of the Row class, and setting tag as custName.
And 6, setting the title of the custNameRow as the client name, as shown in FIG. 4.
And 7, setting the type of the custNameRow as FormRowTypeText.
And 8, adding custNameRow into a child object rowList of the section by an addcathedren method of the section.
Step 9, instantiating concrete object createdatemow of Row class, and setting tag as 'createDate'.
Step 10-set the title of createDateRow to "creation time", as shown in fig. 5.
And 11, setting the type of createDateRow as FormRowTypeDatePicker.
Step 12, adding createDateRow into the child object rowList of the section through the addChildren method of the section.
Step 13, instantiating a concrete object isuseRow of the Row class, and setting tag as 'isUse'.
Step 14, set the title of isuseRow to "valid" as shown in FIG. 6.
Step 15, setting the type of the isuseRow as FormRowTypeBoolean switch.
Step 16, add isuseRow into the child object rowList of the section by the addDeldren method of the section.
And step 17, realizing the proxy method of TableView, and returning the selection number and Row number required by the proxy method.
And 18, realizing the proxy method of TableView and returning a title value corresponding to the Section.
And 19, realizing the proxy method of TableView, returning a title value and a value corresponding to Row, and realizing the style by using a native self-contained style or self-defining.
And 20, calling a reload method of TableView to refresh the form.
According to the method, a form configuration file does not need to be preset in advance, and the form can be automatically generated through a built-in data source during development of a mobile terminal or a data source transmitted from a server background; the form can be dynamically refreshed by changing the form data source and the reload method of TableView, and the form items are increased or decreased, so that the cascade connection of the dynamic form and the field is realized; one-key grabbing and object packaging of form data are realized.
The method generates the mobile terminal dynamic table based on the native protocol of the mobile platform, is light in weight and simple in process, and supports secondary extension development and modification of table single-character segment types, interaction and display styles; and the dynamic increase and decrease of the form can be realized, richer functions are realized, the workload of form development is reduced, and the development cost is reduced.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting the same, and although the present invention is described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications and equivalents may be made to the embodiments of the invention without departing from the spirit and scope of the invention, which is to be covered by the claims.

Claims (8)

1. A mobile terminal dynamic form generation method based on TableView is characterized by comprising the following steps:
adding TableView at a mobile terminal and configuring basic attributes of the TableView;
acquiring enterprise target service information, and determining characteristic relations between form entity objects and object attributes thereof;
dividing the Form entity object into a Form object Form, a Form object selection and a Form object Row;
creating a Form object Form;
creating a Form object Section and adding the Section into a property list Section of a Form object Form;
creating a form object Row and adding the Row into an attribute list RowList of the form object Section;
refreshing TableView by using the Form object Form as a data source and using a native agent method;
realizing type attribute corresponding interaction of Row in a Row click event of TableView;
storing the form value into the value attribute of the form object Row;
traversing SectionList and RowList in Form, and assembling Form data;
the creating of the form object Row and the adding to the attribute list RowList of the form object Section include:
recursively traversing the Section list and the RowList corresponding to each Form object Section, and inquiring the Form object Row corresponding to the specific tag as a return value;
deleting the inquired form object Row from the form RowList attribute of the child object of the Section of the parent form object corresponding to the form object Row, and transmitting the form object Row inquired by the parameters;
defining a table single-row enumeration type;
adding a type attribute to the form object Row to distinguish the form line type during rendering;
adding a value attribute to the form object Row to store a form field value given during form operation;
a title attribute is added to the form object Row to indicate the field display name of the form.
2. The tablevew-based mobile terminal dynamic Form generation method as claimed in claim 1, wherein the creating of the Form object Form comprises:
defining a Form Section attribute of a sub-object in a Form object Form to add one or more Form object sections;
defining a form RowList attribute of the sub-object in the form object Section to add one or more form objects Row;
adding sub-objects of the Form object Form and the Form object selection to a sub-object List of the Form object Form and the Form object selection respectively by adopting an addcore method, wherein transfer parameters are corresponding sub-object entities and sequence numbers;
and setting tag attributes of the form object Section and the form object Row, wherein the types of the tag attributes are character strings.
3. The TableView-based mobile-side dynamic Form generation method as claimed in claim 2, wherein the creating and adding the Form object Section to the attribute list Section list of the Form object Form comprises:
traversing the List object Form to obtain a List set of child objects, and inquiring a Section object corresponding to a specific tag as a return value;
deleting the searched Section object from the Section list attribute, and transmitting the Section object searched by the parameters;
and adding a title attribute to the searched Section object to represent the title name of the form unit.
4. The method as claimed in claim 1, wherein the method for generating TableView-based mobile terminal dynamic Form refreshes TableView by native agent method with Form object Form as data source, comprising:
the Form object Form, the Form object Section and the Form object Row three-layer structure correspond to the three-layer tree structure of Table, Sections and Rows in the native TableView, and the Form object Form is used as a data source to render the Form style;
analyzing the form style of the list, and displaying the field display name of the form according to the title attribute of the form object Row; and displaying the value of the corresponding field of the form according to the value attribute of the form object Row.
5. The method as claimed in claim 1, wherein traversing a sectionallist and a RowList in the Form to assemble Form data includes:
creating a set object of a key value pair type;
all Form objects Row nested in the recursive traversal Form object Form take the tag attribute as the key value of the key-value pair, and the value attribute as the value of the key-value pair to be added into the set object.
6. A mobile terminal dynamic form generation method based on TableView is characterized by comprising the following steps:
adding TableView at the mobile terminal and configuring basic attributes of TableView;
acquiring enterprise target service information, and determining characteristic relations between form entity objects and object attributes thereof;
defining a form entity object and constructing a data structure;
displaying and rendering the form based on TableView;
capturing form data to generate a mobile terminal dynamic table;
the displaying and rendering of the form based on the TableView comprises the following steps:
the Form object Form, the Form object Section and the Form object Row three-layer structure correspond to the three-layer tree structure of Table, Sections and Rows in the native TableView, and the Form object Form is used as a data source to render the Form style;
analyzing the form style of the list, and displaying the field display name of the form according to the title attribute of the form object Row; displaying the value of the corresponding field of the form according to the value attribute of the Row of the form object;
triggering a single-Row click event, and realizing corresponding click interaction according to the type attribute of the Row corresponding to the form object.
7. The tablevew-based mobile terminal dynamic form generation method of claim 6, wherein the defining form entity objects and constructing data structures comprises:
dividing the Form entity object into three layers of a Form object Form, a Form object Section and a Form object Row according to the characteristic relationship among the object attributes in the Form entity object;
defining a Form Section attribute of a sub-object in a Form object Form to add one or more Form object sections;
defining a form RowList attribute of the sub-object in the form object Section to add one or more form objects Row;
adding sub-objects of the Form object Form and the Form object selection to a sub-object List of the Form object Form and the Form object selection respectively by adopting an addcore method, wherein transfer parameters are corresponding sub-object entities and sequence numbers;
setting tag attributes of the form object Section and the form object Row, wherein the types of the tag attributes are character strings;
traversing and inquiring Form object Section for the Form object Form, transmitting a parameter tag character string, and adding a title attribute to the inquired Form object Section;
and traversing the Form object Form to query the Form object Row, transmitting a parameter tag character string, and adding a type attribute, a value attribute and a title attribute to the queried Form object Section.
8. A TableView-based mobile terminal dynamic form generation apparatus, comprising a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, when the apparatus is operating, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of the TableView-based mobile terminal dynamic form generation method according to any one of claims 1 to 7.
CN202210066601.7A 2022-01-20 2022-01-20 TableView-based mobile terminal dynamic form generation method and device Active CN114356334B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210066601.7A CN114356334B (en) 2022-01-20 2022-01-20 TableView-based mobile terminal dynamic form generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210066601.7A CN114356334B (en) 2022-01-20 2022-01-20 TableView-based mobile terminal dynamic form generation method and device

Publications (2)

Publication Number Publication Date
CN114356334A CN114356334A (en) 2022-04-15
CN114356334B true CN114356334B (en) 2022-08-05

Family

ID=81090772

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210066601.7A Active CN114356334B (en) 2022-01-20 2022-01-20 TableView-based mobile terminal dynamic form generation method and device

Country Status (1)

Country Link
CN (1) CN114356334B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650712A (en) * 2009-08-18 2010-02-17 深圳市科陆电子科技股份有限公司 Generating management method and system of self-defined report
CN105630502A (en) * 2015-12-28 2016-06-01 武汉传神信息技术有限公司 Method and system for generating dynamic form
CN105955777A (en) * 2016-05-03 2016-09-21 网易(杭州)网络有限公司 User interface refreshing method and device
CN109977164A (en) * 2019-04-01 2019-07-05 时代数媒科技股份有限公司 A kind of mobile terminal list development approach based on data-driven
CN113778401A (en) * 2021-01-05 2021-12-10 北京沃东天骏信息技术有限公司 Page generation method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9244697B2 (en) * 2010-07-30 2016-01-26 Sap Se Stable anchors in user interface to support life cycle extensions
CN105808244A (en) * 2016-03-01 2016-07-27 杭州师范大学 Dynamic data visualized analysis tool based on workflows
CN108984172B (en) * 2018-05-31 2022-04-26 北京奇艺世纪科技有限公司 Interface file generation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650712A (en) * 2009-08-18 2010-02-17 深圳市科陆电子科技股份有限公司 Generating management method and system of self-defined report
CN105630502A (en) * 2015-12-28 2016-06-01 武汉传神信息技术有限公司 Method and system for generating dynamic form
CN105955777A (en) * 2016-05-03 2016-09-21 网易(杭州)网络有限公司 User interface refreshing method and device
CN109977164A (en) * 2019-04-01 2019-07-05 时代数媒科技股份有限公司 A kind of mobile terminal list development approach based on data-driven
CN113778401A (en) * 2021-01-05 2021-12-10 北京沃东天骏信息技术有限公司 Page generation method and device

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
iOS TableView 编程指导(三)-创建和配置;陵无山;《https://www.jianshu.com/p/266d6abe2de5》;20181019;1-9 *
JavaFX中列表视图的应用与研究;郭强;《数字技术与应用》;20180105(第01期);1-3 *
基于iOS平台的播报哥手机APP的设计与实现;韩丽君;《自动化技术与应用》;20180725(第07期);1-5 *
面向CRM业务的移动应用的设计与实现;董晨希;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;20180415;I138-707 *

Also Published As

Publication number Publication date
CN114356334A (en) 2022-04-15

Similar Documents

Publication Publication Date Title
US9026583B2 (en) Method and apparatus for polymorphic serialization
US9696972B2 (en) Method and apparatus for updating a web-based user interface
KR101038896B1 (en) Service program generation technology
US6292186B1 (en) Universal information appliance with parser
CN109902220B (en) Webpage information acquisition method, device and computer readable storage medium
EP3822828A2 (en) Method, apparatus, device and storage medium for determining page theme and computer program product
WO2019072201A1 (en) Webpage content extraction method and terminal device
US20090077091A1 (en) System for development and hosting of network applications
CN108319489A (en) Startup method, apparatus, storage medium and the electronic equipment of five application page
US9275165B2 (en) Method and apparatus for defining an application to allow polymorphic serialization
CN111125269B (en) Data management method, blood relationship display method and related device
CN110417988A (en) A kind of interface display method, device and equipment
US20120079009A1 (en) Method and apparatus for choosing resources based on context and inheritance
US11847145B2 (en) Aliased data retrieval for key-value stores
JP2021111403A (en) Landing page processing method, apparatus, device and medium
CN110457621A (en) A kind of page display method, device and the medium of mixing application
US20240095298A1 (en) Systems and methods for rendering interactive web pages
CN114356334B (en) TableView-based mobile terminal dynamic form generation method and device
CN103761020A (en) Shortcut navigating method and device
US20220114177A1 (en) Intelligent memory allocation and deallocation of data
BG111129A (en) Method for visualization, grouping, sorting and management of data objects through the realization of a movement graphically representing their level of relevance to defined criteria on a device display
US10845953B1 (en) Identifying actionable content for navigation
CN114020309B (en) Method, device and storage medium for constructing multi-page application through webpack
CN108563712A (en) Web page picture inspection method, device and storage device
US11874890B2 (en) Multi-entry point navigation for user interfaces

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant