Re: Can WOPopupButton's selectedValue binding set a value in a component?
Re: Can WOPopupButton's selectedValue binding set a value in a component?
- Subject: Re: Can WOPopupButton's selectedValue binding set a value in a component?
- From: Samuel Pelletier <email@hidden>
- Date: Fri, 29 Mar 2019 14:42:38 -0400
Hi Hugi,
I think most WOComponents (and elements) only push selectedValue or selection
if the value change.
For your case, I think you should use javascript code with a AjaxProxy to
communicate with your component controller or use some form of serialization
using a hidden field.
I never used AjaxProxy but my understanding is this create a javascript proxy
object in the page that implements RPC to java object created by the component.
The JS code would read the actuel values from the proxy object or by
deserializing them from the field, render the checkbox, handle the changes in
the ui and send back the result.
Regards,
Samuel
> Le 29 mars 2019 à 11:58, Hugi Thordarson <email@hidden> a écrit :
>
> Hi all.
> For … reasons* … I need to use the "selectedValue"-binding of a
> WOPopupButton, rather than the "selection"-binding. However, it seems
> "selectedValue" is unidirectional, i.e. if I bind it to a variable in a
> component, the variable is read (to set the initially selected value when the
> pop-up renders) but it's not set in the component when the form is submitted.
>
> So… I guess the question is; shouldn't that binding be bidirectional, so I
> can intercept the new [selectedValue] on form submission? It seems surprising
> it doesn't just work, and it's tempting to think I'm simply just doing
> something wrong.
>
> If anyone can shed some light on this (or suggest a workaround) I'd be most
> grateful. It would be lovely to able to avoid stuff like updating a hidden
> field on the client when the pop-up changes (blech) or manually getting the
> formValue from the request (pfft).
>
> * For those interested in "reasons", it's that I have a few hundred select
> boxes on a single page, each one containing the same identical list of few
> hundred items. I'm populating these popups manually on the client using
> JavaScript so I don't have to download a few megabytes of HTML on each
> request. If anyone can suggest a different solution to *that* problem, then
> that makes this question obsolete :).
>
> Cheers,
> - hugi
> _______________________________________________
> 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