Problem with example ComponentCommunication
Problem with example ComponentCommunication
- Subject: Problem with example ComponentCommunication
- From: Luzi Grauer <email@hidden>
- Date: Thu, 09 Oct 2003 00:45:00 +0200
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.