(a colon is a parameter declaration, which represents a parameter) a single-table query
Select DataSet1 after the "Wizard" button, click the Where tab, select a field to move right over .... Value fill variable name such as ": employee_id" must have a colon, OK
(after the wizard is finished, under the Matchrule folder under DataSet1, you can see the set conditions, the same steps: Right-click the Matchrule folder-insert-basematchrule) Preview the JSP file, see no data output. The reason is to set the Ecacpaeenabled property of the Matchrule folder property to True. Ecacpaeenabled set to true means that escaping is allowed, that is, when the condition has no value, the corresponding SQL statement is not generated, which is equivalent to a dynamic query. Browse ok.5.3. Add a conditional dataset to add a formdatset rename to Datasetconditions. In the Datasetconditions child node field, add 3 fields, renamed employee_id, Salarymin, Salarymax.
The name of field in Datasetconditions is preferably named the same as value in the DataSet1 match condition. Not the same, but you need to add some manual code to do the conversion, which is not introduced here first.
5.4. Add a form for conditional input add a AutoForm to the controls, rename it to Formconditions, and set its DataSet property to Datasetconditions. 5.5. Add a query command to add a Querycommand, renamed to Commandquery.
Set the Querydataset for Commandquery to Dataset1,conditiondataset to Datasetconditions. 5.6. Add a Query button to add a button, set the Command property of Button1 to Buttonquery
Set the Command property to commandquery copy autoform,buttonquery into the JSP, ok.5.7. Improved
Output button1 to JSP, browse the page, enter "%an%" in the employ_id text box, enter 1000 and 5000 respectively in Salarymin and Salarymax, click Button1, get the work number contains "an", And salary is greater than or equal to 1000, and salary is less than or equal to 5000 records. To make an improvement, one is to add code to the Commandquery BeforeExecute method.
var employee_id = Datasetconditions.getvalue ("employee_id"); if (employee_id) { command.parameters (). SetValue ("employee_id", "%" + employee_id + "%");} Else { command.parameters (). SetValue ("employee_id", "");}
In this way, you can enter "an" in the employee_id, instead of adding 2 wildcard characters "%" before and after. To make another improvement, the DataType property of Salarymin and Salarymax in datasetconditions fields is set to double. In this way, Salarymin and Salarymax on the page only access the digital type of input. ======================================================
Datasetdropdwon
Show company in Datasetdept (branch as drop-down box) built two autosqldataset named: Datasetdept,datasetbranch
A DataTable
A Autofrom
A datasedropdwon that sets the properties:
DataSet Selection Datasetbranch
Lablefield
Valuefield
Mapvalue Select True under Datasetdept under the Field folder to check the Branchid field, and set the dropdown property, point View node, generate JSP. ok.========================
Customdropdown use 1. Build a view name: Viewemployee Autosqldataset Select Table Employee, all fields move right, The Point Add button setting is associated with the ID of the table Dept. Point Dept Object, Point branchname field to the right, click OK to close the window.
Building a DataTable
Jian Datapilot
Jian Pagepilot
Build a button
Build a commandupdate, build a datasetinfo under the command node and set the DataSet property
Build a Customdropdown, and set:
autodropdown=true//Get Focus Auto Eject
cachable=true//Cache downlevel Content
Path input dept-tree.jsp//This JSP is generated by another view. Select the Dept_name field folder under the DataSet node to set the Dropdown property to the Customdropdown created above, associate the field with the Customdropdown
2. Build a view named Depttree to build a datatree name treedept
Again under the Treedept build a simple treelaval name Levlebranch, also under the Levebranch built simple Treelaval named Leveldept built two autosqldataset named: Datasetdept,datasetbranch. Sets the branch_id association of the relationship with the table branch in Datasetdept.
Insert a basematchrule (match condition) under Datasetdept and set the properties:
Table=dept
Oprater selection =
Originfield input branch_id
Value input: branch_id (the colon is a parameter declaration, which represents a parameter) set Masterlink
(Below we will associate Datasetbranch with datasetdept to ensure that datasetdept: the branch_id parameter values are derived from datasetbranch.) This association is established in dorado through the Masterlink object of the dataset.
With the Datasetdept masterlink selected, the edit box for the Point property Masterdataset, a button appears, click the wizard button.
The "branch_id=branch_id" data row will appear in the Join Relations edit box.
This defines an association relationship between the two datasets through the configuration of Masterlink. Datasetdept automatically gets the value of branch_id from Datasetbranch through the configuration of the Masterlink object and acts as a datasetdept parameter: branch_id value. Select the treedept that you created, and select Levelbranch:
1. The LabelField property is set to Branch_name, which is used for the caption display of the tree node.
2. Set the DataSet property to Datasetbranch. Next, select Leveldept
1. The LabelField property is set to Dept_name, which is used for the caption display of the tree node.
2. Set the DataSet property to Datasetdept.
3. Haschild is set to False to indicate that there are no child nodes, that is, this layer is a leaf node.
Generates a JSP. Browse OK.
-----------------
Refine the tree function definition treedept node event onclick code: if (Tree.getcurrentnode (). Getlevel ()! = 1)
Dropdown.closeframe (Tree.getcurrentnode (). Getrecord ());
The above code means that when the hierarchy of the selection node is not the first layer, that is, when it is not a branch node, the attached record object of the selected node is returned, and the drop-down box is closed by Dropdown's closeframe function. Because in the design of treedept, we defined the first node to display the information of the branch office, by doing so, we can ensure that the drop-down box will not be closed until the user selects the departmental node.
Back in the View model Employeeoperate, select the Dropdowndept object and set the properties for ReadFields and Writerfields in Dept_id,dept_name. Two attributes remain consistent. such as: ReadFields = Dept_id,dept_name
Writerfields = Dept_id,dept_name
These two properties are used after the user selects a departmental node of the drop-down box, and Dropdowndept automatically obtains the Dept_id,dept_name information from the record returned in the drop-down box and sets it to the main interface. The perfect tree function just makes it possible to modify the employee's branch information.
----------------6.2.8. Step Seven: Excel data Export Add Export2excelcommand control in Viewemployee view
Select the created Export2excelcommand, set properties: ID property, modify to Commandexport
The DataSet property, which is bound to the dataset, is set to Datasetemployee;
The Templatetable property, which represents the DataTable to be exported, is set to Tableemployee;
ExportMode property, export mode, set to download, means download as Excel file;
Create a button object named Buttonexport and set the command property of Buttonexport to "Export as Excel file" for the Commandexport,value property
--------------------
Package the button in the Doradostudio interface in Project properties, the Project Properties dialog box appears, and the Build tab is selected. "Figure 64"
Enter the package path in Archive path.
Example: C:\hr.war
After Setup is complete, click OK.
This property is used to set whether Dorado Studio automatically packages the current project into a Hr.war file and stores it in the C packing directory when it executes the build compile.
Next we are going to package the output operation.
Click the Build button "Figure 65" in the toolbar to build the output. OK, generate the Hr.war file and copy it directly to Tomcat's WebApp directory.
Dorado Single-Table query