PDA

View Full Version : Binding error:


fx.barrett
10-02-2008, 09:12 PM
warning: unable to bind to property 'DATE' on class 'XML' (class is not an IEventDispatcher)
I have a vague idea about what this is but I want to be sure... I have a Repeater in which a have a few Text Areas... The data provider of the Repeater is an XML file... and inside the repeater I have a few text areas which are binded to a certain child of that XML file... I think I'm getting the error because of that but I'd like to know how to go about it if this: text="{rep_comp.currentItem.DATE}" is considered bad...

Thanks.

rawmantick
10-03-2008, 06:34 AM
Data binding is not just assigning some value to some variable.

When you bind some data to some variable - it means that when data has changed, it dispatches Event.CHANGE (not sure, but some event) event, and that cause the variable data is binded to to change. So when you for example make a document, and bind some view data povider to document's data - it causes every time document has changed to reset view's setter to new value.

That's why event dispatching ability is requred. XML object is not an event dispatcher. It cannot be bindable, since it dispatches no events.

Probably you need not to bind, bot just to set the value.

Bindaibility is a process of reacting to value changing.

Correct me if I'm wrong...

fx.barrett
10-03-2008, 08:10 AM
I'll try it out but all the examples I saw were using bindable XML when passing it to a dataprovider.. Anyway, I'll try it out and see if it works.

Besides that, I'm exprimenting a weird problem and I'm not sure if this is because of my code or it simply is not supported... As you saw, i was using something like: text="{rep_comp.currentItem.DATE} to populate one of my input fields... the problem is that whenever I try to trace the text value of the field I'm getting "undefined" as a response...

I didn't yet have the time to read up on this or see if there's any prob in my code ( since I wrote it last night ) but I thought that i'll mention my prob, maybe someone already encoutered this prob and can provide a fast answer.

Thanks for your reply romantique.