Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Property depending on path property not refreshed after Browse dialog closes
Property depending on path property not refreshed after Browse dialog closes [message #1121299] Mon, 30 September 2013 13:27 Go to next message
Peter Benedikovič is currently offline Peter BenedikovičFriend
Messages: 8
Registered: September 2013
Junior Member
Hi,

I have a path property with browse button and one disabled property that should refresh it contents based on value from path property. The disabled property is defined with @Enablement(expr = "false") annotation and has @DependsOn annotation that points to the path property. The path property has validation service with side-effect changing the value of the disabled property - not directly but on the underlying resource.
When I type into the path value (without using browse button) the new value from resource is refreshed after the validation service is called (through ValuePropertyBinding.read). But when browse button is used to change the path value, the ValuePropertyBinding.read is not being called after the validation service call which damages the data integrity between model and resource.
Is this a bug or am I supposed to do something else here?
Re: Property depending on path property not refreshed after Browse dialog closes [message #1121450 is a reply to message #1121299] Mon, 30 September 2013 16:34 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 962
Registered: July 2009
Senior Member
I would guess that you are hitting the case where validation service doesn't change property validation. That means no validation event is triggered, so @DependsOn doesn't perform a refresh on the dependent property.

Rather than using @DependsOn, you can do one of the following...

1. Have the resource refresh the property when underlying data is changed. This is the preferred option.

2. Have the validation service call refresh on the property after changing its underlying data.

[Updated on: Mon, 30 September 2013 16:35]

Report message to a moderator

Re: Property depending on path property not refreshed after Browse dialog closes [message #1123489 is a reply to message #1121450] Wed, 02 October 2013 16:15 Go to previous messageGo to next message
Peter Benedikovič is currently offline Peter BenedikovičFriend
Messages: 8
Registered: September 2013
Junior Member
Thanks Konstantin, I have used 1. solution and it works.
Re: Property depending on path property not refreshed after Browse dialog closes [message #1151104 is a reply to message #1123489] Wed, 23 October 2013 06:07 Go to previous messageGo to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
Registered: September 2012
Member
Hello Smile

How do you do option 1 exactly?
Re: Property depending on path property not refreshed after Browse dialog closes [message #1151270 is a reply to message #1151104] Wed, 23 October 2013 08:26 Go to previous messageGo to next message
Greg Amerson is currently offline Greg AmersonFriend
Messages: 118
Registered: March 2010
Senior Member
Hazem ELRAFFIEE wrote on Wed, 23 October 2013 02:07
Hello Smile

How do you do option 1 exactly?


In your 'init' of your validation service, you need to attach listeners to the properties that you are interested in. Then when the listener fires you just call 'refresh()'. And the property that this service is attached to will get revalidated.

See here: https://github.com/liferay/liferay-ide/blob/master/tools/plugins/com.liferay.ide.project.core/src/com/liferay/ide/project/core/model/internal/PortletFrameworkValidationService.java

In that example the validation service is depending on two other properties on the model.

[Updated on: Wed, 23 October 2013 08:29]

Report message to a moderator

Re: Property depending on path property not refreshed after Browse dialog closes [message #1151377 is a reply to message #1151270] Wed, 23 October 2013 09:57 Go to previous message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
Registered: September 2012
Member
perfect, thnx Smile
Previous Topic:Runtime Exception when opening Editor
Next Topic:Questions on Drag-n-Drop in Forms
Goto Forum:
  


Current Time: Sat Dec 20 12:21:05 GMT 2014

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

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