• 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
Re: control input - if blank not acceptable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >control input - if blank not acceptable (From: Wes James <email@hidden>)

  • Prev by Date: Re: control input - if blank not acceptable
  • Next by Date: Cannot build on Windows XP
  • Previous by thread: Re: control input - if blank not acceptable
  • Next by thread: Cannot build on Windows XP
  • Index(es):
    • Date
    • Thread