This is for a DTO that inherits some fairly complicated describeType-based
auto-populate voodoo. It's already statically caching describeType info
(based on a getQualifiedClassName key), so that's no worry, and I've already
got all the info required for generating field-level change events as I go
through. I might refactor it and go back to those events when I get some
time. It needs to have some functionality pulled out into a generic
reflection util class anyway eventually :)
Cheers :)
-J
On Mon, May 19, 2008 at 11:18 AM, Daniel Gold <[EMAIL PROTECTED]> wrote:
> I don't usually make an entire class Bindable on a single event like you
> posted earlier, so I'm not 100% on this, but I'm pretty sure it won't
> auto-generate that event for you in your setters, so you would have to
> dispatch it manually, with the side effect that all of your other bindings
> would fire as well. I usually go the route of using the default Bindable
> event and then using describeType in my updateAll to generate the
> propertyChangeEvent so that I can still fire individual bindings without the
> overhead.
>
> I also cache the result of the describeType so that it will only happen
> once on each qualified class name as that method can be pretty heavy.
>
>
> On Sun, May 18, 2008 at 7:42 PM, Josh McDonald <[EMAIL PROTECTED]> wrote:
>
>> Does this mean I will no longer receive any automatic updates (as in
>> generated by the framework, rather than by my event dispatch code) at all
>> when an individual member is updated, or that simply all members will be
>> marked as changed when any one of them is?
>>
>> Cheers,
>> -J
>>
>>
>> On Mon, May 19, 2008 at 6:02 AM, Daniel Gold <[EMAIL PROTECTED]>
>> wrote:
>>
>>> I've done it that way before, although sometimes its better to create
>>> an "updateAll()" method, because now all of your bindings will fire when a
>>> single property changes since your entire class is Bindable on the same
>>> event. Just depends on exactly what the use case is, if your class is set up
>>> with the default Binding events you could use describeType in your updateAll
>>> method to dispatch a PropertyChangeEvent for each property in your class.
>>>
>>>
>>> On Fri, May 16, 2008 at 1:36 AM, Josh McDonald <[EMAIL PROTECTED]> wrote:
>>>
>>>> Once again, two seconds after I post, the answer pops into my head...
>>>> And as usual, the (simple) solution for anybody trawling the list in
>>>> future:
>>>>
>>>> [Bindable(event="populated")]
>>>> public class FooBar extends EventDispatcher {
>>>>
>>>> ...
>>>>
>>>> //Pay attention to me!
>>>> dispatchEvent(new Event("populated"));
>>>>
>>>>
>>>> -J
>>>>
>>>>
>>>> On Fri, May 16, 2008 at 4:30 PM, Josh McDonald <[EMAIL PROTECTED]>
>>>> wrote:
>>>>
>>>>> Hi guys,
>>>>>
>>>>> Disclaimer: this is probably a stupid question, but I've been trying to
>>>>> figure this out for way too long!
>>>>>
>>>>> I've got some code that does all sorts of things to this.foo, this.bar,
>>>>> and this.baz etc etc. At the moment I'm dispatching several standard
>>>>> PropertyChangeEvents as I change fields. What I'd like to do is once I've
>>>>> finished all my voodoo, dispatch a single event that says "everything
>>>>> needs
>>>>> to be updated", but I need to do it to this rather than on a reference in
>>>>> a
>>>>> parent object, as it's a non-visual component that has no idea where it
>>>>> sits
>>>>> in the object graph.
>>>>>
>>>>> I *know* there's a simple solution to this...
>>>>>
>>>>> -J
>>>>>
>>>>> --
>>>>> "Therefore, send not to know For whom the bell tolls. It tolls for
>>>>> thee."
>>>>>
>>>>> :: Josh 'G-Funk' McDonald
>>>>> :: 0437 221 380 :: [EMAIL PROTECTED]
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> "Therefore, send not to know For whom the bell tolls. It tolls for
>>>> thee."
>>>>
>>>> :: Josh 'G-Funk' McDonald
>>>> :: 0437 221 380 :: [EMAIL PROTECTED]
>>>>
>>>
>>>
>>
>>
>> --
>> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
>>
>> :: Josh 'G-Funk' McDonald
>> :: 0437 221 380 :: [EMAIL PROTECTED]
>>
>
>
>
--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."
:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]