NSArray Or WOPopup Error
NSArray Or WOPopup Error
- Subject: NSArray Or WOPopup Error
- From: "Jonathan Fleming" <email@hidden>
- Date: Wed, 10 Mar 2004 17:34:57 +0000
I've had this type of problem before and managed to get out of it but I
don't know how, and now I've just configured a new popup I'm back there
again ... anyone know how to rectify this? From a directAction method I
am trying to set the popup with the selected value but what is happening
is that the whole array is being run through (so it seems) and the last
object is selected. I only found this out by trying to use a set method
with NSLog.out.appendln() rather than a takeValueForKey method. Anyhow in
both cases I get the same problem even if I hard code a value, say "30
results" for example would print out that value for every element of the
array but still end up setting the last object of the array. see example
below. Here's my directAction code with form values print out:
takeFormValuesForKeyArray(keys);// from constructor.............
public WOComponent selectedReferenceAction() {
JobAdvert nextPage = (JobAdvert)pageWithName( "JobAdvert" );
nextPage.setName2Find( (String)this.request().formValueForKey(
"name2Find" ) );
nextPage.setTbJobAdvertID(
(String)this.request().formValueForKey( "tbJobAdvertID" ) );
nextPage.viewDetails();
nextPage.setNumToFetch( Integer.parseInt(
Validation.numOfResultsFromPopup(numOfResultsString) ) );
//String numOfResultsString =
(String)this.request().formValueForKey( "numOfResultsString" ); //off
because not needed
//nextPage.takeValueForKey(numOfResultsString,
"numOfResultsString");
nextPage.setNumOfResultsString( numOfResultsString );
return nextPage;
} .................. the log ............. formValues =
{numOfResultsString = ("10 results"); name2Find = (""); wosid =
("KVZ4UyvNUHzWniyWC8tcrM", "KVZ4UyvNUHzWniyWC8tcrM"); }
===
resultNum is: 10
aDG numToFetch = 10
numOfResultsString selected is: 10 results// this is it being set, but
then
numOfResultsString selected is: 02 results
numOfResultsString selected is: 05 results
numOfResultsString selected is: 10 results
numOfResultsString selected is: 20 results
numOfResultsString selected is: 30 results
numOfResultsString selected is: 40 results
numOfResultsString selected is: 50 results
numOfResultsString selected is: 100 results // and this is where we
end up... why? if I hard code the value this is what I get:
numOfResultsString selected is: 30 results
numOfResultsString selected is: 30 results
numOfResultsString selected is: 30 results
numOfResultsString selected is: 30 results
numOfResultsString selected is: 30 results
numOfResultsString selected is: 30 results
numOfResultsString selected is: 30 results
numOfResultsString selected is: 30 results And here's my bindings PopUpButton_numOfResultsStringTopAdv:
WOPopUpButton {
list = numOfResultsList;
selection = numOfResultsString;
name = "numOfResultsString";
displayString = numOfResultsString;
item = numOfResultsString;
value = numOfResultsString;
} Kind regardsJonathan :^)
------------------------------------------------------------------------
Are you going travelling? Help us to find the 100 best internet cafes in
the world. Click here for more details and you could win #250 and a
digital camera!
_______________________________________________
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.