The subject of setValue is not a list of acceptable values but the
single item in the model data
Use a ValueListBox, and in presenter call setAcceptableValues to fill
list box before calling driver.edit

On Jul 15, 7:48 am, vinayak kulkarni <[email protected]> wrote:
> Hi,
> Problem: How to use dynamic listbox with editor framework
> I have the simple use case to display a List<String> in the listbox.
> Then, the selected item in the listbox needs to be flushed from the
> UI.
> The values of the listbox are not static, they come from the DB during
> runtime.
>
> I wanted to implement it with editor mechanism.
> But, the problem is, the input is - List<String>  to show all the
> values in the listbox
>                               the output is just String -  to be
> flushed by the editor framework.
>
> Previously, i used LeafValueEditor<String> with getValue() and
> setValue().
> getValue() --> flushes the selected value to the editor driver
> setValue() --> unimplemented since it cannot accept the String
> I implemented one more method setAllValues() to show the dropdown
> values.
>
> How, to handle this situation? when the getValue() and setValue() are
> not of the same type?
>
> I could think of ValueListBox with setAcceptablevalues(). But, how
> does editor make a call to it?
>
> Here is the flow:
>   Model
>      -- List<String> listValues
>      .. other objects
>
> ModelView implements Editor<Model>
>    .. Model attributes with direct mapping
>       MyListBox listValues
>
> MyListBox implements LeafValueEditor<String>
> getValue()
> setValue()
>
> Presenter
>   -- Get model
>   -- editor driver.edit(model object)
>   set to view
>  => The view is updated with model object
>
> Let me know if there is any other way to make MyListBox widget to be
> editor compliant and accepts List<String> but gives out String

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to