Skip to content
2 changes: 1 addition & 1 deletion src/strand-checkbox/strand-checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

_stateChanged: function(newVal, oldVal) {
this.debounce("stateChecked", this._handleStateChange);
this.fire("changed", { state: this.state }, true);
this.fire("changed", { state: this.state, value: this.value }, true);
},

_handleStateChange: function() {
Expand Down
44 changes: 22 additions & 22 deletions src/strand-form/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
</head>

<body>

<strand-form id="testForm" unresolved>

<div class="col" span="1">
<strand-input fitparent name="input" placeholder="Type a Number"></strand-input>
</div>
Expand All @@ -64,7 +64,7 @@
</strand-radio>
</strand-group>
</div>

<div class="col" span="4">
<strand-repeater id="repeater" name="repeater">
<template preserve-content>
Expand All @@ -83,12 +83,15 @@
</template>
</strand-repeater>
</div>

</strand-form>

<!-- config via markup -->
<!--
<strand-form id="testForm" unresolved>
<!--
<strand-form
id="testForm"
columns="2"
v-space="20"
unresolved>
<div class="col" span="1">
<strand-input
fitparent
Expand All @@ -115,10 +118,15 @@
<strand-form-message id="special"></strand-form-message>
</div>
<div class="col" span="2">
<strand-header
id="radioDOMHead"
form-header
size="medium">Radio DOM Header</strand-header>
<strand-group
fitparent
name="radio"
label="Radio"
label="Gosh DOM It!"
label-ele="radioDOMHead"
error-msg="Choose a color"
validation="empty">
<strand-radio>
Expand All @@ -133,7 +141,7 @@
</strand-group>
</div>
</strand-form>
-->
-->

<script>

Expand Down Expand Up @@ -197,27 +205,19 @@
};

// data that holds any actual values
// var data = {
// 'input' : '1',
// 'dropdown' : 'List Item 1',
// 'radio' : 'Red'
// };

// returned from server-side validation
// the key plus the message
// var returnedData = {
// 'input' : 'Type a number greater than 0',
// 'dropdown' : 'Select a different item',
// 'radio' : 'Select Green'
// };
var data = {
'input' : '1',
'dropdown' : 'List Item 1',
'radio' : 'Red'
};

window.addEventListener('WebComponentsReady', function(e) {
var testForm = document.querySelector('#testForm'),
repeater = document.querySelector('#repeater');

// Ordering!
// Ordering DOESN'T matter anymore!
testForm.data = data;
testForm.config = config;
// testForm.data = data;

testForm.addEventListener('serialize-form', function(e){
console.log('serialize-form', e.detail);
Expand Down
Loading