Data Binding to a Formfield (input)

Hello,
i want to bind a datasource to a formfield. I allready read about 80% of manuals, reference and Tutorials but i'm still confused.

In the following sample i can access $spielothek/@id, but not the child nodes like $spielothek/strasse.

That are my formfields:

Name <input type="text" id="name" path="$spielothek/@id" e:behavior="l:autofill" /> <br />
Strasse <input type="text" id="strasse" path="$spielothek/strasse" e:behavior="l:autofill" /><br />

I have a listgrid with a number of items (spielotheken) and on event "click" i want to show details of the selected item (spielothek) in the form fields:

<b:listGrid dataSource="spielotheken_list" readonly="true" rowClasses="rowClass1, rowClass2">
  <e:handler event="click" type="application/javascript"><![CDATA[
   var iSelected = this.getProperty('selectedIndex');
   var oSource = this.getProperty('dataSource');
   spielotheken = oSource.modelNode.getElementsByTagName('spielotheken')[0];
   spielothek = spielotheken.getElementsByTagName('spielothek')[iSelected];
   aInputs = bb.evaluateSmart('[//input]', bb.document);
   for(var i=0; i<aInputs.length; i++) {
    bb.command.fireEvent(aInputs[i], 'populate', true, true);
   }
  ]]></e:handler>
   ...
</b:listGrid>

The XML-Data is like this:

<spielotheken totalRecords="1">
  <spielothek id="spielothek-1">
    <id>1</id>
    <name>Spielothek</name>
    <strasse>Musterstr</strasse>
    <ort>Berlin</ort>
  </spielothek>
</spielotheken>

I'm not sure, if the association from datasource nodes to "spielotheken" and "spielothek" is done in the right way. Please can you tell me how i can do a proper association of the datasource nodes?

Thanks and Best regards
Stephan

Data Binding to a Formfield (input)

Could you try get the data in the selected row (selectedIndex) by using btl.dataSource.getValue and then put the data in the input as its value property.

var selectedIndex = listGrid.getProperty('selectedIndex');
var value = btl.dataSource.getValue(oSource, selectedIndex,queryString);
oInput.setProperty('value', value );

~Yudi

You can use the solution from here

You can use the solution from here:

http://demo.backbase.com/Backbase_4_1_2_optimized/demos/pim/indexChamele...

(use methods from lookout.js - I'm using them a lot)