Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Click on the Main WO component and then double-click the related Main.java file.
  2. # Add the following public variables to the Main class:
    Code Block
    public double firstUserInput;
    public double secondUserInput;
    
  3. Add the following public method to the Main class:
    Code Block
    public double addResult(double firstUserInput, double senduserInput) {
    
    double result = firstUserInput + secondUserInput;
    
    return result
    
     
    }
    
  4. Your resultant Main.java should look like this:
    Code Block
    
    // Generated by the WOLips Templateengine Plug-in at Mar 19, 2008 11:00:05 AM
    package your.app.components;
    
    import com.webobjects.appserver.WOComponent;
    import com.webobjects.appserver.WOContext;
    
    public class Main extends WOComponent {
    	private static final long serialVersionUID = 1L;
    	public double firstUserInput;
    	public double secondUserInput;
    
    	public Main(WOContext context) {
    		super(context);
    	}
    
    	public double addResult(double firstUserInput, double senduserInput) {
    
    		double result = firstUserInput + secondUserInput;
    		return result;
    		}
    
    }
    
  5. Delete "Hello World" within the <body> tags.
  6. Click on the "Insert WOForm Component" in the menu bar.

...