Re: More than one WOPopupButton in the same form - SOLVED
Re: More than one WOPopupButton in the same form - SOLVED
- Subject: Re: More than one WOPopupButton in the same form - SOLVED
- From: Dumitru Husleag <email@hidden>
- Date: Wed, 9 Mar 2005 11:23:55 +0100
Analysing the request in debug mode i saw that the value sent for
the popup is the index of the selected item or none if there is no
selection.
Il give you my solution. Maybe you'll give me a better (proper) one :)
<code>
String popupName = popupBtnNameForItem(item);
WORequest req = context().request();
Object objValue = req.formValueForKey(popupName);
if(objValue != null){
String strValue = objValue.toString();
int selectedIndex = Integer.parseInt(strValue.toString());
MyItemClass selectedItem =
(MyItemClass)getListMyItems().objectAtIndex(selectedIndex);
// do the job here
}
</code>
where popupBtnNameForItem makes a unique name from the Item object.
On Fri, 4 Mar 2005 15:21:37 +0100, Dumitru Husleag
<email@hidden> wrote:
> Hello everybody,
>
> I have a form, inside there is a table and each table row has a
> submit button and a WOPopupButton.
> When I click the Submit button on a row i need to get the selected
> item in the list but instead i get the selected item in the last row.
> So how should I deal with this ?
>
_______________________________________________
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