Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Riena » SWT toolbar in Riena(Problem with binding data)
SWT toolbar in Riena [message #529940] Tue, 27 April 2010 18:45 Go to next message
Amel Jakupovic is currently offline Amel JakupovicFriend
Messages: 64
Registered: March 2010
Member
Hello to everybody,

we have riena application and from main View we call Dialog, from that Dialog we call third dialog.

On third dialog there is a toolbar, groupbox with textbox.

If we put some text in that textbox and make click on toolbar in our controller we don't see value from textbox, but if I click second time, than I see value in Controller.

It's bug or I don't see something.

If I use button everything is good.

viewClass:


//toolbar
	coolBar = new CoolBar(composite, SWT.FLAT);
		toolBar = new ToolBar(coolBar, SWT.RIGHT | SWT.FLAT);
		coolBar.setBackground(LnfManager.getLnf().getColor(LnfKeyConstants.SUB_MODULE_BACKGROUND));
		
		toolBar.setBackground(LnfManager.getLnf().getColor(LnfKeyConstants.SUB_MODULE_BACKGROUND));
				
		snimiButton = new ToolItem (toolBar, SWT.PUSH);
		snimiButton.setEnabled(false);
		snimiButton.setText("Snimi");
		snimiButton.setToolTipText("Snimi sve veze s vanjskim poslovnim partnerima");
		snimiButton.setImage(ImageStore.getInstance().getImage(ApplIcons.ICON_SNIMI));
		snimiButton.setHotImage(ImageStore.getInstance().getImage(ApplIcons.ICON_SNIMI));
		
		addUIControl(snimiButton, "snimiButton");



//textbox
Text textPoslovni = UIControlsFactory.createText(result, SWT.LEFT,
				"textPoslovni"); //$NON-NLS-1$
		
		

		hFill.applyTo(textPoslovni);
		addUIControl(textPoslovni, "textPoslovni");


//controller

companyName = ((ITextRidget) getRidget("textPoslovni"));
		companyName.setMandatory(true);


DataBindingContext dbc = new DataBindingContext();
		dbc.bindValue(BeansObservables.observeValue(companyName, ITextRidget.PROPERTY_TEXT), BeansObservables
				.observeValue(compForUpdate, "name"), null, null);


IToolItemRidget buttonTollbarSnimi = (IToolItemRidget) getRidget("snimiButton");
		 IToolItemRidget buttonTollbarOdustani = (IToolItemRidget)
	 getRidget("odustaniButton");

		buttonTollbarSnimi.addListener(new IActionListener() {
			public void callback() {
				try {
					System.out.println(compForUpdate.getName()) //First time nothing, second time we have value
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
					showMessage(e);
				}
			}
		});






thanks
Re: SWT toolbar in Riena [message #529949 is a reply to message #529940] Tue, 27 April 2010 19:45 Go to previous messageGo to next message
Amel Jakupovic is currently offline Amel JakupovicFriend
Messages: 64
Registered: March 2010
Member
if i before System.out.println open a message with IMessageBoxRidget and when I closed that dialog, I can see new value from textbox.

Problem with synchronization of ridgets ?

Maybe there is some kind of UpdateAllRidgetOnView?

And sorry for two samo topic.

Does someone know the solution ?

thanks
Re: SWT toolbar in Riena [message #529951 is a reply to message #529940] Tue, 27 April 2010 19:53 Go to previous messageGo to next message
Amel Jakupovic is currently offline Amel JakupovicFriend
Messages: 64
Registered: March 2010
Member
solution:

if I add companyName.setDirectWriting(true);
in controller (companyName is ridget) everything works fine.

But this is not good solution, if someone have other solution please post it.

Thanks
Re: SWT toolbar in Riena [message #530270 is a reply to message #529951] Thu, 29 April 2010 07:30 Go to previous messageGo to next message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
Registered: July 2009
Senior Member
Am 27.04.10 21:53, schrieb Amel Jakupovic:
> solution:
>
> if I add companyName.setDirectWriting(true);
> in controller (companyName is ridget) everything works fine.
>
> But this is not good solution, if someone have other solution please
> post it.
>
> Thanks
Hi Amel,

I believe the problem is, that the value is only written to the model on focusLost of the widget by default. So when you
click the toolbar the text field value is not yet on the model. That happens when you tab into the next field. If you
enable DirectWriting then every change to the widget model is always propagated to the model. For your usecase that is
entirely valid and the reason we build that feature.

I dont consider it a hack or something. The widget value is then also validated or converted (if you have validators)
for each character that is entered (or removed).

christian
Re: SWT toolbar in Riena [message #531272 is a reply to message #530270] Tue, 04 May 2010 11:54 Go to previous message
Amel Jakupovic is currently offline Amel JakupovicFriend
Messages: 64
Registered: March 2010
Member
thanks cristian,

I will leave it with directwiring.

Now we start with connection Riena with ECF on SpringDM...The pilot project must start 01/06/2010 Smile.

If everthing will be good, we will write some wiki, and examples.

thanks you very much.
Re: SWT toolbar in Riena [message #585199 is a reply to message #530270] Tue, 04 May 2010 11:54 Go to previous message
Amel Jakupovic is currently offline Amel JakupovicFriend
Messages: 64
Registered: March 2010
Member
thanks cristian,

I will leave it with directwiring.

Now we start with connection Riena with ECF on SpringDM...The pilot project must start 01/06/2010 :).

If everthing will be good, we will write some wiki, and examples.

thanks you very much.
Previous Topic:Switching SWT with Riena's SWT/QT
Next Topic:How Can I Remove / Modify Riena Logo?
Goto Forum:
  


Current Time: Thu Mar 28 13:16:17 GMT 2024

Powered by FUDForum. Page generated in 0.03206 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top