Re: control input - if blank not acceptable
Re: control input - if blank not acceptable
- Subject: Re: control input - if blank not acceptable
- From: Dirk Bajohr <email@hidden>
- Date: Wed, 11 Aug 2004 23:54:26 +0200
Simply change your method signature to
public WOComponent submitChanges() {
...
}
and everything should work.
Cheers,
Dirk
Am 11.08.2004 um 21:52 schrieb Wes James:
In working with a project the main.wo has an add user link, this then
calls a userEntry.wo where the information is entered. There is a
submit button here which then brings the user back to the main.wo with
the input information. What If I want to require that data exist in
the input fields before it is returned to the main.wo. In other words
if the fields are blank, the new object should not be created in the
nsarray in the main.wo, but should indicate a message or something
saying that blank fields are not allowed. Right now, once the submit
is hit, it goes back to the main.wo arena and I can't seem to see how
to check the userEntry fields at this point since it is now back in
the main.wo arena and not in the userEntry arena (userEntry.wo). A
user object is being sent back and forth, but how do talk to it to
check for empty fields?
When the submit button is clicked, I guesss this code runs:
public Main submitChanges() {
Main nextPage = (Main)pageWithName("Main");
System.out.println("Submit button pressed.");
// Initialize your component here.
return nextPage;
}
So I'm taken back to the main page, but I want to stay on the
userEntry page or have some other page show if the user object fields
are empty.
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;
}
I have tried to us an if statment in the Min submitChanges that
returns the userEntry page, but it says this is a bad type....
Well.... what are some ideas for this?
thanks,
wj
_______________________________________________
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.
--
Dirk Bajohr
iSOLUTION - Individuelle Software fuer moderne Kommunikation
Hauptstr. 50
53757 Sankt Augustin
T +49 2241 921567-0
F +49 2241 921567-89
http://www.isolution.de
_______________________________________________
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.