Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [riena-dev] Unbind the modelBinding and rebind to an other attribute

Florian,

there is no API for unbinding. However you should be able to re-bind, i.e.:

textRidget.bindToModel(...model1....)
// textRidget now bound to model 1

// later:
textRidget.bindToModel(...model2...) //
// textRidget now bound to model 2 and NOT bound to model1

See attached snippet.

Elias.

On Fri, Feb 20, 2009 at 11:10 PM, Florian Pirchner
<florian.pirchner@xxxxxxxxx> wrote:
> Hi riena-team,
>
> i have a question to a very special binding case:
>
> Redview can be run in different modes. One of them is a designer mode, which
> offers a very dynamically behavior on manipulating the ui. With a designer
> editor the ui elements like controls, layouts and layoutdatas can be
> designed. The editor offers a direct update. This means, that changes to the
> model are directly reflected to the ui. This works quite well..
>
> Now i am implementing the modelBindings. With the great riena binding api it
> is also easy to accieve this. But i am not sure how to process binding
> changes in the designer editor best. If a ridget is already bound to the
> model and the bindingAttribute changes, i have to unbind the modelBinding
> and create a new one. I am not sure how to do this riena like. There is no
> api like ridget.unbindFromModel(). So i have to destroy the controller
> completely an create it again. It works well, but maybe there is a better
> way.
>
> For example:
> TextRidget is bound to the attribute "lastName" of the Adress bean. The
> designer shows "Pirchner".
> Now the designer decides to bind an other attribute like Address.firstName.
> After the rebinding, the designer should show "Flo".
> So i have to unbind the TextRidget<->Adress.lastName binding and create a
> new one: TextRidget<->Adress.firstName
>
> Thanks in advance for your answer
> Flo
>
>



-- 
Elias Volanakis
Technical Lead
Innoopract (EclipseSource)
351 NW 12th Avenue
Portland, Oregon 97209

elias@xxxxxxxxxxxxxxxxx
evolanakis@xxxxxxxxxxxxxx
Tel: +1-503-552-1457
Fax: +1-503-715-4915
Mobile: +1-503-929-5537
---
Innoopract is becoming EclipseSource - www.eclipsesource.com

Attachment: SnippetTextRidget.java
Description: Binary data


Back to the top