• 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: NSArray Or WOPopup Error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArray Or WOPopup Error


  • Subject: Re: NSArray Or WOPopup Error
  • From: Dirk Bajohr <email@hidden>
  • Date: Wed, 10 Mar 2004 19:10:06 +0100

Hi Jonathan,
Set the item binding to something else e.g. currentResult. If currentResult
is a String you can leave displayString empty.


How it works:
The "list" is an array that will be looped through. It sets the "item"
on each iteration to the current object when the page is generated.

The "selection" binding contains the value(s) that are selected from
the list.

list = numOfResultsList
item = currentResult
displayString = -empty- or currentResult
selection = numOfResultsString

Hope that helps.

Cheers,
Dirk

Am 10.03.2004 um 18:34 schrieb Jonathan Fleming:

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.



--
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.


References: 
 >NSArray Or WOPopup Error (From: "Jonathan Fleming" <email@hidden>)

  • Prev by Date: Re: Inserting/Deleting Records From Within EOGenericRecord
  • Next by Date: Class 'Main' exists but is not a subclass of WOComponent
  • Previous by thread: NSArray Or WOPopup Error
  • Next by thread: NSArray Or WOPopup Error
  • Index(es):
    • Date
    • Thread