| 1 | <div id="repeat" dojoType="dojox.mobile.ScrollableView" style="width: 100%;"> |
| 2 | <h1 dojoType="dojox.mobile.Heading" back="Home" moveTo="foo">Repeat Data Binding Example</h1> |
| 3 | <form name="repeatTestForm" id="repeatTestForm"> |
| 4 | <div class="field-title">Search Results</div> |
| 5 | <div class="fieldset" dojoType="dojox.mvc.Repeat" class="row" ref="repeatmodel"> |
| 6 | <div dojoType="dojox.mvc.Group" ref="'rel:${this.index}'"> |
| 7 | <div class="row"> |
| 8 | <input dojoType="dojox.mobile.TextBox" |
| 9 | id="nameInput${this.index}" ref="'rel:First'" placeHolder="First Name"></input> |
| 10 | <button id="details${this.index}" type="button" dojoType="dojox.mobile.Button" class="mblBlueButton" onclick="setDetailsContext('${this.index}')">Details</button> |
| 11 | </div> |
| 12 | </div> |
| 13 | </div> |
| 14 | <div class="spacer"></div> |
| 15 | <div dojoType="dojox.mvc.Group" ref="repeatmodel"> |
| 16 | <div id="detailsBanner">Details for selected index:</div> |
| 17 | <div class="fieldset" id="detailsGroup" dojoType="dojox.mvc.Group" ref="'rel:0'"> |
| 18 | <div class="field-row"> |
| 19 | <span>First Name</span> |
| 20 | <input type=text id="firstInput" dojoType="dojox.mobile.TextBox" |
| 21 | placeholder="First Name" ref="'rel:First'"></input> |
| 22 | </div> |
| 23 | <div class="field-row"> |
| 24 | <span>Last Name</span> |
| 25 | <input type=text id="lastInput" dojoType="dojox.mobile.TextBox" |
| 26 | placeholder="Last Name" ref="'rel:Last'"></input> |
| 27 | </div> |
| 28 | <div class="field-row"> |
| 29 | <span>Email</span> |
| 30 | <input type=text id="emailInput2" dojoType="dojox.mobile.TextBox" |
| 31 | placeholder="Email" ref="'rel:Email'"></input> |
| 32 | </div> |
| 33 | <div class="field-row"> |
| 34 | <span>Telephone</span> |
| 35 | <input type=text id="telInput" dojoType="dojox.mobile.TextBox" |
| 36 | placeholder="Telephone" ref="'rel:Tel'"></input> |
| 37 | </div> |
| 38 | </div> |
| 39 | </div> |
| 40 | <div class="spacer"></div> |
| 41 | <button id="add" type="button" dojoType="dojox.mobile.Button" class="mblBlueButton" onclick="insertResult(nextIndexToAdd)">Add</button> |
| 42 | <button id="save" type="button" dojoType="dojox.mobile.Button" class="mblBlueButton" onclick="console.log(repeatmodel[selectedIndex].toPlainObject());repeatmodel[selectedIndex].commit()">Save</button> |
| 43 | <button id="reset2" type="button" dojoType="dojox.mobile.Button" class="mblBlueButton" onclick="repeatmodel.reset()">Reset</button> |
| 44 | |
| 45 | </div> |