Re: WOPopUpButton returns null
Re: WOPopUpButton returns null
- Subject: Re: WOPopUpButton returns null
- From: Alexander Spohr <email@hidden>
- Date: Mon, 19 Jan 2004 20:35:23 +0100
Address.java contains a field "state"
what is that "state"?
it should not be a string value.
it has to be a relationship or pointer to StateCode (if you want to use
WOPopUpButton).
the popup just tries to put item (aStateCode) into selection
(newAddress.state).
it does not copy the contents of item into selection.
public StateCode state;
in Address.java should work.
atze
Am 19.01.2004 um 17:12 schrieb Drew Thoeni:
I hate to post such a basic question, but as a newbie I have not been
able to get a WOPopUpButton to work. I've spent several hours reading
and trying apparently every combination but the one that works. Help if
you can and thanks in advance.
The scene;
Address.java contains a field "state"
State.java is a class that contains fields: stateAbbreviation and
stateName. State.java is initialized at the application level (since it
does not change and may be accessed by all users). Here's the code:
public class Application extends WOApplication {
protected NSArray stateCodeList = new NSArray();
protected StateCode aStateCode = new StateCode();
<snip>
public static void main(String argv[]) {
WOApplication.main(argv, Application.class);
}
public Application() {
super();
setPageRefreshOnBacktrackEnabled(true);
// fetch State Code table
fetchSpec =
EOFetchSpecification.fetchSpecificationNamed("FetchIsLegalStateCodeList
"
, "StateCode");
stateCodeList =
sharedEc.objectsWithFetchSpecification(fetchSpec);
}
public WOResponse handleSessionRestorationErrorInContext(WOContext
context) {
SessionTimeOut errorPage = (SessionTimeOut)
pageWithName("SessionTimeOut", context);
return errorPage.generateResponse();
}
}
In WOBuilder I have these set:
displayString: application.aStateCode.stateName
item: application.aStateCode
list: application.stateCodeList
selection: newAddress.state
If I replace the WOPopUpButton with a WOTextField and type a value into
the WOTextField bound to newAddress.state (say "FL"), it works fine.
Using the WOPopUpButton, however, I get "The state property of Address
is not allowed to be null."
I'm sure I'm missing something obvious... just not to me.
Regards,
Drew
_______________________________________________
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.