Hello,
i want to bind form fields with a datasource (type local).
I started with the sample from http://bdn.backbase.com/blog/richard/data-binding-xml-to-a-form, but i didn't work out how to implement the datasource instead of loading the data with bb.command.load
This is the e:handler inside the listGrid:
var oSource = this.getProperty('dataSource');
userProfiles = oSource;
aInputs = bb.evaluateSmart('[//input]', bb.document);
for(var i=0; i<aInputs.length; i++) {
bb.command.fireEvent(aInputs[i], 'populate', true, true);
}
userProfiles = oSource;
aInputs = bb.evaluateSmart('[//input]', bb.document);
for(var i=0; i<aInputs.length; i++) {
bb.command.fireEvent(aInputs[i], 'populate', true, true);
}
The behaviour to populate is the same as in the sample:
var path = this.getAttribute('path');
this._data = bb.evaluateSmart(path, bb.document)
var sFirst = this._data.value;
bb.setProperty(this, 'value', sFirst);
this._data = bb.evaluateSmart(path, bb.document)
var sFirst = this._data.value;
bb.setProperty(this, 'value', sFirst);
These are the input-fields where i want to put the data:
<input type="text" id="firstName" path="$userProfiles/UserProfile/Name[position()=1]/@first" e:behavior="l:autofill" />
<input type="text" id="surname" path="$userProfiles/UserProfile/Name[position()=1]/@surname" e:behavior="l:autofill" />
<input type="text" id="surname" path="$userProfiles/UserProfile/Name[position()=1]/@surname" e:behavior="l:autofill" />
And at least the xml-data:
<Profiles>
<UserProfile>
<Name first="Roger" surname="Rabbit" />
<Demographics age="25" />
</UserProfile>
</Profiles>
<UserProfile>
<Name first="Roger" surname="Rabbit" />
<Demographics age="25" />
</UserProfile>
</Profiles>
Whatever i try, i just get the error:
"Javascript error: "this._data has no properties".". input#firstName anonymous()"
Anybody who can help me?
Thanks and best regards
Stephan

Nobody here who can help me?
17 June, 2008 - 13:11 — phaetonsJust a clue? Please!
Thanks and best regards
Stephan
How to bind form fields to a datasource?
28 August, 2008 - 17:22 — yudiThere is similiar question about this in one of posts in the forum.For answer, please have a look some replies in this post (http://bdn.backbase.com/node/5163 )
Cheers,
Yudi