• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
FW: Problem with example ComponentCommunication
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FW: Problem with example ComponentCommunication


  • Subject: FW: Problem with example ComponentCommunication
  • From: "Ricardo T Saito" <email@hidden>
  • Date: Wed, 8 Oct 2003 20:10:06 -0300

Hi,

Perhaps you need to create a setUser function inside the Main.java file ?
:-)

----------------------------------------------------
Ricardo T Saito - email@hidden
Computer Engineer
Americanas.com - Sao Paulo - Brazil

-----Original Message-----
From: email@hidden
[mailto:email@hidden]On Behalf Of Luzi Grauer
Sent: Wednesday, October 08, 2003 7:45 PM
To: email@hidden
Subject: Problem with example ComponentCommunication


Hello experts

I am new in Java and WebObjects. Following the manual "Web application" I
got a problem with the project ComponentCommunication.

Build und Debug reports an error in the file UserEdit.java on line

        nextPage.setUser(user);

Error: cannot resolve symbol: method setUser (User)

Where is the bug???

Correctly working copies of the three java files

//  User.java
//  Main.java
//  UserEdit.java

would also help greatly to me (or a hint where to get them).

Thanks for any help

Luzi Grauer


My java files:

----------------------------------------------------------

//
//  User.java
//  UserEntry
//
//  Created by lg on Wed Oct 08 2003.
//  Copyright (c) 2003 __MyCompanyName__. All rights reserved.
//

import com.webobjects.foundation.*;
import com.webobjects.eocontrol.*;

public class User {
    protected String personName;
    protected String favoriteFood;

    public String personName()
    {
        return personName;
    }

    public void setPersonName(String newPersonName)
    {
        personName = newPersonName;
    }

    public String favoriteFood()
    {
        return favoriteFood;
    }

    public void setFavoriteFood(String newFavoriteFood)
    {
        favoriteFood = newFavoriteFood;
    }

     public boolean entryIncomplete()
    {
    boolean entryIncomplete;

     if (personName == null ||
        favoriteFood == null ||
        personName.equals("") ||
        favoriteFood.equals(""))
        {
        entryIncomplete = true;
        }
        else
        {
        entryIncomplete = false;
        }

        return entryIncomplete;
    }

}

----------------------------------------------------------

//
// Main.java: Class file for WO Component 'Main'
// Project ComponentCommunication
//
// Created by lg on Wed Oct 08 2003
//

import com.webobjects.foundation.*;
import com.webobjects.appserver.*;
import com.webobjects.eocontrol.*;
import com.webobjects.eoaccess.*;

public class Main extends WOComponent {
    public User user;

    public Main(WOContext context) {
        super(context);
        user = new User();
    }

    public boolean noDataEntered()
    {
    boolean noDataEntered;
    if (user == null || user.entryIncomplete())
        {
        noDataEntered = true;
        }
    else
        {
        noDataEntered = false;
        }
    return noDataEntered;
    }

}


----------------------------------------------------------


//
// UserEdit.java: Class file for WO Component 'UserEdit'
// Project ComponentCommunication
//
// Created by lg on Wed Oct 08 2003
//

import com.webobjects.foundation.*;
import com.webobjects.appserver.*;
import com.webobjects.eocontrol.*;
import com.webobjects.eoaccess.*;

public class UserEdit extends WOComponent {
    public User user;

    public UserEdit(WOContext context) {
        super(context);
    }

    public User user()
    {
        return user;
    }

    public Main submitChanges()
    {
        Main nextPage = (Main)pageWithName("Main");

        // Initialize your component here
        nextPage.setUser(user);
        return nextPage;
    }

}

----------------------------------------------------------
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Problem with example ComponentCommunication
  • Next by Date: java.lang.OutOfMemoryError with WODisplayGroup
  • Previous by thread: Problem with example ComponentCommunication
  • Next by thread: Re: webobjects-dev digest, Vol 1 #483 - 13 msgs
  • Index(es):
    • Date
    • Thread