Configure the QuickCode development environment for an existing project and create screens

Let’s take a look at how to configure the screen with the previously created ViewSet template, View template, Model, and Action.

Configuring Development Environment

Let’s take a look at how to configure the screen with the previously created ViewSet template, View template, Model, and Action. If you are using the created product, then skip the Start from New Project step and proceed from the Importing ViewSet Template File step.

Step

Description

Start from New Project

Model File

Add the model Type service and import the xmodel file.

ModelService.xmodel

[Project Path]\[Model Service PrefixID]

Action

Install the xmodule file.

SampleActions.xmodule

[Project Path]\_extlib_

Importing ViewSet Template File

ViewSet Template

Copy the ViewSet template file to the path specified in the directory structure.

sample.zip

  • sample

    • viewTemplateSample

      viewTemplateSample.xtemplate

C:\Users\[User]\Documents\TOBESOFT\Nexacro N\templates\user\formTemplate\viewset

Importing View Template File

View Template

Copy the View template file.

viewSampleForm.xviewgen

viewSampleGrid.xviewgen

C:\Users\[User]\Documents\TOBESOFT\Nexacro N\templates\user\viewtemplate

Starting by Importing the xpackage File to a New Project

If you use the xpackage, then you can process the following tasks at once.

The following steps must be configured.

1

Download the xpackage file from the link below.

You can download the xmodel file from the link below.

ImportSample.xpackage

Please refer to the link below for creating xpackage.

Export

2

Select the menu [File > Import] and run the Import Wizard.

3

Select and enter the downloaded xpackage file in Package File.

4

Select all the items that can be selected in the FileList and then click the [Import] button.

If the file is the same as the existing item, then it is displayed as overwriting. You can select the option above the Preview screen to change and add the to a different name.

5

Select the TypeDefinition > Objects item in Project Explorer and then add the nexacro.View component.

6

If the QuickCode panel is not displayed, then select the menu [QuickCode > View > QuickCode] and display the QuickCode panel.

INCLUDE_ERROR(ELEMENT_REMOVED)

7

Prepare the Action module installation file (SampleActions.xmodule).

You can download the xmodule file from the link below.

SampleActions.xmodule

Please refer to the link below for creating Action.

Creating Action

8

Select the menu [File > Install Module] and then run Install Module Wizard.

9

Check "Module Package" for Install Type and then select the xmodule file to import.

10

Check the Action information included in the module and then click the [Install] button.

Refresh the project when installing the module.

11

Select the Action tab in the QuickCode panel and then check if the installed Action module is registered.

INCLUDE_ERROR(ELEMENT_REMOVED)

12

Continue proceeding with the task of Creating New Form.

Start from New Project

1

Select the TypeDefinition > Objects item in Project Explorer and then add the nexacro.View component.

2

Select the TypeDefinition > Services item in Project Explorer and then add the Model service with the name "SvcModelSample".

3

If the QuickCode panel is not displayed, then select the menu [QuickCode > View > QuickCode] and display the QuickCode panel.

4

Select the Model tab in the QuickCode panel and then select the "Import" item from the context menu.

5

Prepare the Model file (ModelService.xmodel).

You can download the xmodel file from the link below.

ModelService.xmodel

Please refer to the link below for creating Model.

Creating Model

6

Select the xmodel file to import from the file explorer.

7

Check that Model has been added. You can check the information by double-clicking the Model item.

8

Prepare the Action module installation file (SampleActions.xmodule).

You can download the xmodule file from the link below.

SampleActions.xmodule

Please refer to the link below for creating Action.

Creating Action

9

Select the menu [File > Install Module] and then run Install Module Wizard.

10

Check "Module Package" for Install Type and then select the xmodule file to import.

11

Check the Action information included in the module and then click the [Install] button.

Refresh the project when installing the module.

12

Select the Action tab in the QuickCode panel and then check if the installed Action module is registered.

Importing ViewSet Template File

1

Prepare the ViewSet template file.

You can download the xtemplate file from the link below.

After extracting, copy the entire folder and then move it under the project Viewset path.

sample.zip

Please refer to the link below for creating the Viewset template.

Registering & Using ViewSet Template

2

Copy the ViewSet template file to the folder.

The default folder where the ViewSet template file is saved is in the viewset folder under the Form Template path in the menu [Tools > Options > QuickCode].

You need to create a category folder (sample) and the ViewSet template folder (viewTemplateSample) under the viewset folder and copy the xtemplate file.

The _preview.xfdl.js file is the preview file that is automatically created when you select the ViewSet template file for creating a new Form. It is okay to import them together when copying the ViewSet template file.

Importing View Template File

1

Prepare the View template file.

You can download the xviewgen file from the link below.

viewSampleForm.xviewgen

viewSampleGrid.xviewgen

Please refer to the link below for creating the View template.

Creating View Template

2

Open the View Template tab in the QuickCode panel, and then click the top menu button and select the [Open Containing Folder] item to open the folder.

As with the ViewSet template file, the saved default folder can be found in the menu [Tools > Options > QuickCode > View Template]. If you click the Setting button above the Location link in the View Template tab, then it will direct you to the corresponding option.

3

Copy the View template file to the folder.

4

After copying the file, click the top menu button in the View Template tab and then select the [Refresh All] item to display the copied View template list.

Creating New Form

1

Select the menu [File > New > Form] and run Form Wizard.

2

Select the Viewset Templates item from the Template list on the left and then select the ViewSet template added earlier.

In the example, the design of the View component is not included. If properties such as border or background are set on the View component according to the screen design, then they can be added to the theme and reflected.

3

Enter the Form name and then click the [Finish] button.

Creating Screen UI with Model & View Template

After selecting Model and dragging it onto the View component, select the View template and additional properties. The screen UI is created according to the selected item.

Creating Search UI

1

Select Model from the QuickCode panel and then drag and drop it on the first View component.

If you drag the Model with the mouse and move it over the View component, then the area of the View component is displayed in black.

2

Select the field to use.

Use only the name field. Uncheck the company field.

3

Click the [Next] button and select viewSampleForm from the View Template List.

If you select View Template, you can check the UI image to be created in the Preview area on the right.

4

Click the [Next] button and check the field data.

You can modify fieldtype and datatype values, or set User Attribute provided by fn_GetFieldUserAttributeList in View Template.

5

Click the [Next] button and select true for the use_triggerbutton item.

6

Click the [Finish] button to create the screen.

7

Check the created View component information in the QuickCode Design Mode.

QuickCode Design Mode is activated by selecting [QuickCode > Design > QuickCode Design Mode] from the menu or selecting QuickCode Design Mode from the toolbar. The View Information panel is displayed on the right side of the Form screen and displays information about each View object.

Creating Grid UI

1

Select Model from the QuickCode panel and then drag and drop it on the second View component.

2

Select the field to use.

Keep both fields checked.

3

Click the [Next] button and select viewSampleGrid from the View Template List.

4

Click the [Next] button and check the field data.

5

Click the [Finish] button to create the screen.

Creating Detailed Information UI

1

Select Model from the QuickCode panel and then drag and drop it on the third View component.

2

Select the field to use.

Keep both fields checked.

3

Click the [Next] button and select viewSampleForm from the View Template List.

4

Click the [Next] button and check the field data.

5

Click the [Next] button and select the value false for the use_triggerbutton item.

6

Click the [Finish] button to create the screen.

7

Select the View component and then set the sourceview property value to the second View component (View01) in the property window.

When the sourceview property value is changed, it is changed to the state bound to the same Dataset as the Grid component, and the value selected in the Grid component is displayed in the third View component.

Adding Data Search Function Using Action

Add a function so that Action operates when the Button component is clicked. In order to implement the data search function without the server connection, create the XML file to search data.

Connecting Action

1

Select the Action tab in the QuickCode panel and select the TestQueryAction item.

2

Drag and drop the selected TestQueryAction item onto the 'Search' Button component placed in the first View component.

3

When the context menu appears, select the 'Click' item.

4

Check the trigger type and target and click the [OK] button.

Clicking the Button component with the btn_Trigger id placed in View00 causes a trigger event to occur.

5

Enter action information and other related information to be processed when a trigger event occurs in the Controller Wizard.

Property

value

Description

targetview

View01

View component with Grid component placed on it

samplefilename

sample

XML file name to query information

alerttype

false

Properties to be passed to the action to be processed after data retrieval

Please refer to the link below for the description of the items that can be selected for the Trigger type.

Item Information Available for the Trigger Type

Please refer to the link below for the description of the items that can be added as the Trigger condition.

Trigger Condition Reserved Words & Samples

6

Click the [Next] button and check the field information to be passed when a trigger event occurs.

7

Click the [Next] button and add User defined (extra) arguments.

In the example, the transmitted value is only displayed with the trace method.

8

Click the [Finish] button.

You can see that the Action has been added to the Invisible Object area.

If you select the button of the first View component in QuickCode Design mode, you can check the controller information added to the Controller Preview panel.

Creating sample XML File

Place the XML file for simple testing in the local environment.

1

Select the TypeDefinition > Services item in Project Explorer and then add the File service with the name "Sample".

2

Select the menu [File > New > XML] and then enter the file name as "sample".

3

Write the XML code with the following contents in the folder.

<?xml version="1.0" encoding="utf-8"?>
<Root xmlns="http://www.nexacroplatform.com/platform/dataset" ver="5000" >
     <Parameters>
          <Parameter id="ErrorCode" type="int">0</Parameter>
          <Parameter id="ErrorMsg" type="string">SUCC</Parameter>
     </Parameters>
     <Dataset id="ds_viewdataset">
          <ColumnInfo>
               <Column id="name" type="STRING" size="80"/>
               <Column id="company" type="STRING" size="80"/>
          </ColumnInfo>
          <Rows>
               <Row>
                    <Col id="name">john</Col>
                    <Col id="company">1dollar</Col>
               </Row>
               <Row>
                    <Col id="name">donald</Col>
                    <Col id="company">EBOT</Col>
               </Row>
          </Rows>
     </Dataset>
</Root>

Executing Screen

1

Click the Quick View button and then execute the screen in the browser.

2

Enter any value in the Name field and click the [Search] button.

When changing the Row selected in the Grid component, check whether the information displayed in the third View component also changes.

Adding Action Processed when Data Search Action is Successful

You can specify the Action that should be connected and processed when the required function in the specific Action succeeds or fails. When data search is successful in the previous step, Add Action that displays the Alert message.

Connecting Action

1

Select the Action tab in the QuickCode panel and then select the TestAlertAction item.

2

Drag the selected TestAlertAction item onto the TestQueryAction00 item in the Invisible Object.

3

When the context menu appears, select the 'Action Success' item.

4

Check the trigger type and target, enter condition property values, and click the [OK] button.

The condition property is the condition under which the action operates. In the data search action, the condition is set to operate only when the alerttype property value is true.

triggerobj.alerttype == 'true'

5

Enter the message value in Controller Wizard.

The message is the parameter value to be transmitted when the alert is executed.

Please refer to the link below for the description of the items that can be selected for Trigger type.

Item Information Available for the Trigger Type

Please refer to the link below for the description of the items that can be added as the Trigger condition.

Trigger Condition Reserved Words & Samples

6

Field information passed when an event occurs is not used. After clicking the [Next] button, without moving to the next step, click the [Finish] button to add an Action.

You can see that Action has been added to the Invisible Object area.

Changing Data Search Action Property Value

1

Double-click the TestQueryAction00 item in the Invisible Object area.

2

Change the alerttype property value to true.

Executing Screen

1

Click the Quick View button and execute the screen in the browser.

2

Enter any value in the Name field and then click the [Search] button.

Check that the data is searched and the Alert dialog box is displayed.

Adding Only Trigger to Action

Previously, we added the function to search data when the button is clicked. Add the function to search data when Form is loaded as well as when the button is clicked.

Connecting Action

1

Select [QuickCode > Design > Controller Chain Editor] from the menu.

2

Click the "Add Controller" button among the function buttons on the right side of the Controller Chain Editor.

3

Among the sub-items, select the "New Controller" item.

The "Add Next Controller" item becomes active when a controller is selected in the Controller Chain Editor.

4

Select Form from Trigger View, Trigger Object list.

5

With the controller selected, launch the context menu and select the "Add Next Controller" item.

6

Select "Form Init" for Trigger Type and "TestQueryAction00" for Target Action, and click the [OK] button.

Confirm that a new Controller has been added.

7

Click the "Show Perview" button among the function buttons on the right side of the Controller Chain Editor.

You can check the operation of all registered controllers in advance.

Executing Screen

1

Click the Quick View button and execute the screen in the browser.

When the Form onload event occurs, the trigger operates and data is searched. You can see that the data is searched without clicking the button.