Re: control input - if blank not acceptable
Re: control input - if blank not acceptable
- Subject: Re: control input - if blank not acceptable
- From: Art Isbell <email@hidden>
- Date: Wed, 11 Aug 2004 12:07:22 -1000
On Aug 11, 2004, at 9:52 AM, Wes James wrote:
public Main submitChanges() {
if (!user.entryIncomplete()) {
Main nextPage = (Main)pageWithName("Main");
System.out.println("Submit button pressed.");
// Initialize your component here.
return nextPage;
}
else {
return null;
}
}
The user object does have this method:
public boolean entryIncomplete() {
boolean entryIncomplete;
if (personName() == null || favoriteFood() == null ||
personName().equals("") || favoriteFood().equals("")) {
System.out.println("The entry is incomplete.");
entryIncomplete = true;
}
else {
System.out.println("The entry is complete.");
entryIncomplete = false;
}
return entryIncomplete;
}
You might want to read "Data Validation with WebObjects 5"
(http://www.stepwise.com/Articles/Technical/2001-06-13.01.html) to
better understand WO data validation. This describes how to
reimplement entryIncomplete() using built-in WO data validation
methods.
Aloha,
Art
_______________________________________________
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.