<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 17, 2012, at 1:01 PM, Diego Lont wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>In another application (commercial, so no code example) we have made a Field that dependent on the value, showed one or more other fields. I will try to add this "ConditionalFieldList" &nbsp;to the framework this week. I have to check if this still works.<br></div></blockquote></div><br><div>Hi All,</div><div><br></div><div>It took a bit more time than expected, but finally I got around to adding this Field to Deltawerken with an example. I used Parasol to add some tests, but I guess these should be more extensive.</div><div><br></div><div>I have now added a project called "DeltaWeb" to the Deltawerken repository, that demo's the functionality of this field.&nbsp;Some remarks to understand this field a bit better.</div><div><div><br></div><div>In order to have a choice field that "auto" updates itself and generates a list of fields that depends on the state we have modified the following things:</div><div>&nbsp; &nbsp;&gt; In order to specify what fields need to be rendered we have an interface that allows us to add a value, with a list of fields that should be rendered when that value is selected. This is the method DEConditionalField addFieldList: aList for: aKey. It takes an array of fields and a key of the select value. Since it is a subclass of a select field, one can also set the labels.</div><div>&nbsp; &nbsp;&gt; in DEFieldComponent the actual rendering of the fields takes place. Here we check if a field is a "composite" field. If a field is composite, we render an extra id, so we can render the rows as a whole. <b>Note:</b> this only works for a div view. For a table view one needs to update more (the entire table). This is not implemented.</div><div>&nbsp; &nbsp;&gt; The conditional field should create a correct updater when asked for a compositeId. This does not need to be the updater id. It is the id of the div around the composite Fields. This is why it only functions with divs: with a table, I do not have a surrounding element. Also note that when you modify the id, you should also set the updateBlock of the updater.</div><div>&nbsp; &nbsp;&gt; Finally there is a problem in the demo with updates of the string / memo field. In deltawerken we use the onChange for updates, and the onChange is fired when you exit this field. It is not fired when you press with your mouse on the radio button (well it is, but after the radio button, and since the field is no longer there). So maybe I need some fix here (I probably should serialize more) ... but I believe this field demonstrates how you can modify the updater to update a bigger part.</div></div></body></html>