Child pages
  • Your First Project - Hello World

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Info

If the Wonder project types don't appear in the File->New menu, you are probably in a Java perspective instead of WOLips.
Go to the Window->Open Perspective->Other... menu and select WOLips.

The project wizard will ask for the project name. Enter HelloWorld. Click Finish.

...

Info

Don't put spaces in the project name, Eclipse have has a hard time with projects that have spaces in the file system path.

...

So let's run the project. Expand the Sources folder, expand the your.app package, right-click on Application.java and select Run As -> WOApplication. This action will start the project and it will create a run configuration for Eclipse. Image Added

After a couple of seconds, the project will be started and a page will open in your favorite browser. You just run ran your first Project Wonder application, congratulations!

...

In the project, open the Sources folder, open the your.app.components package and open Main.java. Main.java is the Java part of a Project Wonder component. If you check the content of the Related tab, you will see that Main.java is related to other files like Main.wo and Main.api, it's a good way to find out if a Java class is part of a component.

Image Added

In the Main.java editor tab, you will need to put one variable + one setter + one getter. Complete code:

...

So now we have a variable to display the content of a string. The next step is to open the HTML part of the component to actually display the string. In the Related view, double-click on the Main.wo file. This action will open the component in the Component Editor.

Image Added

Remove the Hello World text from the HTML and replace it with:

...

And save your modifications. You are now ready to run the application again. The first time you ran the application, it created a run configuration inside Eclipse, so to run the application again, click on the green circle with a white arrow in the toolbar, and select HelloWorld.

Image Added

The application is now displaying the string for the Java variable! You can terminate the application.

...

Code Block
languagejava
themeEclipse
	public WOActionResults updateString() {
		return null;
	}

Run the project again, and update the string in the text field. It's now 100% dynamic! Since we added a setter for the variable a couple of steps before, you don't need to set the string in the updateString method, that's the power of bindings.

You can move on to the next tutorial.