Re: WOPopUp For Newbie
Re: WOPopUp For Newbie
- Subject: Re: WOPopUp For Newbie
- From: John Bruce <email@hidden>
- Date: Fri, 8 Apr 2005 12:57:35 +1200
To use a WOPopup list you need to have your list options as elements
of a NSArray. You then have instance variables for the current
iteration value and the eventual selected value eg:
public String searchCriteria;
public String selectedSearchCriteria;
public final NSArray criterias = new NSArray(new Object[] {"Username",
"Last Name", "Email Address"});
Then you bind the NSArray to the "list" binding of WOPopup,
serachCriteria to "item" and selectedSearchCriteria to "selectedValue"
(i think it's selectedValue but it may be selection - I can never
remember which one)
Then in you action method that you have bound to the seach forms
submit button, selectedSearchCriteria will be set to the selection the
user made and you can use it to qualify your search.
In WebObjects you don't need to worry about naming the elements of the
form as it will do it for you - of course if you want to you can,
especially if you are using a direct action.
Cheers,
John
On Apr 8, 2005 12:39 PM, Jonathan Miller <email@hidden> wrote:
> Hi-
>
> I need the webobjects equivalent of this HTML
> <select name="searchCriteria">
> <option value="principalid">Username</option>
> <option value="last_name">Last Name</option>
> <option value="email_address">Email Address</option>
> </select>
>
> The pop up button is to be used as part of a search form where we say
> search for x (WOTextField) in y (WOPopUP)
>
> The Pop Up button represents a column in a table in the DB.
>
> Thanks for your help
>
> Jon Miller
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden