Code examples
Categories:
How to add ui code?
There is a tutorial video just down below.
You need a QuickStart project:
- Select
File > New > IIZI Module Project (Quickstart)
- Enter
project name
and unselectCreate text tables with automatic translation
- Press
Finish
- Select
Add
Text Field
- Name it:
text (on component and VSField)
- Name it:
Add
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
- On Button properties, go to
UIText text = event.getSource().getUIPanel().getFirstUIComponentNull(“text”, UIText.class);
text.requestFocus();
Place your
mouse cursor
onUIText
, 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
- Select
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 - Press the
Click
button and it sets theUI focus
to the Text Field
- You need to
How to add 10 rows?
There is a tutorial video just down below.
You need a QuickStart project:
- Select
File > New > IIZI Module Project (Quickstart)
- Enter
project name
and unselectCreate text tables with automatic translation
- Press
Finish
- Select
Select
table
in containers anddrag/drop it
to your panel.- Name it:
myTable
- Go to the
Properties
for the UI Table and adda VS Table to your panel VS Group
- Add
a (UI) table column
andlink it in the VS Table
- Name it:
Drag and drop Button
to the panel- Create
VS Action
for this button - Name it:
addContent
- Create
Go to
VirtualSpace
and in properties inConnectors > 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:
- Method name:
VSTable table = event.getTable("group/myTable");
Value[] rowValues = new Value[1];
for ( int item = 1; item <= 10; ++item ) {
rowValues[0] = new Value("Test - "+item);
table.addRow(rowValues);
}
Place your
mouse cursor
on errors you will see:VSTable and do:
Import "VSTable" (com.iizix.prop.vs)
Value[] and do:
Import "Value" (com.iizix)
Then do
File > Save All
orCTRL + SHIFT + S
- Right click on
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 > Add a Configuration Name > Run it
- Right click on
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 set a value in an entry field?
There is a tutorial video just down below.
You need a QuickStart project:
- Select
File > New > IIZI Module Project (Quickstart)
- Enter
project name
and unselectCreate text tables with automatic translation
- Press
Finish
- Select
Select
Text field
in components anddrag/drop
it to your panel.- Name it:
text
- Add
it to your VS Group
- Name it:
Add
Button
andadd this in properties
:- Text:
Edit text
- Click on
VS Action > Create VS Action… > Add it to your VS Group
- Set the action name:
editText
- Then click on
Finish
- Text:
Go to
VirtualSpace
and in properties inConnectors > 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:
- Method name:
@OnVSAction(name = "group/editText")
public void editText(VSActionEvent event) throws ValueConversionException {
event.getField((@VSRef String) "group/text").set_String("My Message");
}
Place your
mouse cursor
on errors you will see:- ValueConversionException and do an:
Import "ValueConversionException" (com.iizix.prop)
- @VSRef and do an:
Import "VSRef" (com.iizix.api.vs)
- ValueConversionException and do an:
Then do
File > Save All
orCTRL + SHIFT + S
- Right click on
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 > Set a Name > Run it
- Right click on
To test it:
- You need to
open your browser
and go here: http://localhost:8080/ - Click on the link:
here
- Then click on
Start
to launch the app in the browser. - You just click
on the button
and it will edittext field
.
- You need to
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.