Code examples

Code examples

You are here:
[WORKING IN PROGRESS]

Some EXAMPLES:
How to add ui code
How to add row
How to edit text


  • How to add ui code
    Youtube tutorial video here: https://youtu.be/hULePvM4KSc
  • You need to create a QuickStart project before doing it.
    • Click on File > New > IIZI Module Project (Quickstart)
      • Put a project name and unselect Create text tables with automatic translation > Then press Finish
  • Add a Text Field
    • Name it: text (on component and VSField)
  • Add a Button
    • On Button properties, go to Events > OnUIAction > Create new method…
    • Choose Create > Then OK
    • Enter the texts in the entry fields:
    • Package: com.iizi.ui
    • Name: Code
    • Then click on Finish
    • Method name: onClick
      • Paste this code in the method:

        UIText text = event.getSource().getUIPanel().getFirstUIComponentNull(“text”, UIText.class);
        text.requestFocus();
  • Put your mouse cursor on UIText, underlined with red > Select Import ‘UIText’ (com.iizi.prop.ui)
    • Then do File > Save All or CTRL + SHIFT + S
    • Right click on the project name > Run As > Run on IIZI Development Server
    • If it says “No configured IIZI Development Server configuration is found”: choose yes.
    • Right click on IIZI Development Server > New Configuration > Put a Name > Run it
  • To test it:
    • You need to open your browser and go here: http://localhost:8080
      • Click on the link: here
      • Then “Start” to launch the app in the browser
      • Press the “Click” button and it sets the UI focus to the Text Field


  • How to add row
    Youtube tutorial video here: https://youtu.be/E1pqvh5y_NI
  • Select table in containers and drag drop it to your panel.
    • Name it: myTable
    • Go to the Properties for the UI Table and add a VS Table to your panel VS Group
    • Add a (UI) table column and link it in the VS Table
  • Drag and drop a Button to the panel
    • Create a VS Action for this button and call it: addContent
  • Go to VirtualSpace and in properties in Connectors > Java Class > Create new class…
    Enter the texts in the input fields:
    Package: com.iizi.vs
    Name: VirtualSpace
    Then click on Finish
  • Select addContent’s properties, Connectors > OnVSAction > Create new method…
    • Method name: addContent
    • Paste this code in the method:

      VSTable table = event.getTable((@VRef String) "group/myTable");
      String name = new String("Test");
      Value[] value = new Value[1];
      value[0] = new Value(name);
      table.addRow(value);

    • Put your mouse on errors you will see:
      • VSTable and do: Import ‘VSTable’ (com.iizix.prop.vs)
      • @VSRef and do: Import ‘VSRef’ (com.iizix.api.vs)
      • Value[] and do: Import ‘Value’ (com.iizix)
  • Then do File > Save All or CTRL + SHIFT + S
  • Right click on the project name > Run As > Run on IIZI Development Server
  • If it said “No configured IIZI Development Server configuration is found. Select one
  • Right click on IIZI Development Server > New Configuration > Add a Configuration Name > Run it
  • To test it:
    • You need to open your browser and go to: http://localhost:8080/
      • Click on the link: “here”
      • Then click on “Start” to launch the app in the browser.
      • You just click on the Add contents button and it will add a new row.

  • How to edit text
    Youtube tutorial video here: https://youtu.be/QYrt7HXf0z0
  • Select Text field in components and drag drop it to your panel.
    • Name it: text
    • Add it to your VS Group
  • Add a Button and add this in properties:
    • Text: Edit text
    • Click on VS Action > Create VS Action… > Add it to your VS Group
      Put the action name: editText
      Then click on Finish
  • Go to VirtualSpace and in properties in Connectors > Java Class > Create new class…
    Type in:
    Package: com.iizi.vs
    Name: VirtualSpace
    Then click on Finish
  • Select editText’s properties, Connectors > OnVSAction > Create new method…
    • Method name: editText
    • Replace your method with this code in your class:

      @OnVSAction(name = "group/editText")
      public void editText(VSActionEvent event) throws ValueConversionException {
      event.getField((@VSRef String) "group/text").set_String("My Message");
      }

    • Put your mouse on errors you will see:
      • ValueConversionException and do an: Import ‘ValueConversionException’ (com.iizix.prop)
      • @VSRef and do an: Import ‘VSRef’ (com.iizix.api.vs)
  • Then do File > Save All or CTRL + SHIFT + S
  • Right click on the project name > Run As > Run on IIZI Development Server
  • If it said “No configured IIZI Development Server configuration is found. Select one
  • Right click on IIZI Development Server > New Configuration > Put a Name > Run it
  • To test it:
    • You need to open your browser and go here: http://localhost:8080/
      • Click on the link: here
      • Then Start
      • You just click on the button and it will edit text field.

Comments are closed.
Social media & sharing icons powered by UltimatelySocial

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close