Re: [Chiba-users] group readonly property not applied to child controls
Creators discontinued Chiba & founded betterFORM http://betterform.de
Brought to you by:
chibaxforms,
windauer
From: Adrian B. <adr...@or...> - 2005-09-20 21:49:04
|
Ulrich Nicolas Lissé wrote: > hi adrian, > > i think this has been clarified in > http://www.w3.org/2003/10/REC-xforms-10-20031014-errata.html#N107D3 > > so, the readonly property is only 'inherited' in the model, not in the > ui structure. the only model item property being 'inherited' in the ui > is the relevant property. Ah, you are quite correct. I wish there was a version of the spec with the errata incorporated that I could work off. > > regards, > uli. > > ps: about the html 'disabled' attribute: i think it is only defined > for html form controls, not for tables. no inheritance of 'disabled' > at all. css styles like 'display:none;' work that way because of > implicit inheritance in the box model. Yes you're right. But IE at least seems to inheirit disabled on a table down to the input controls. I guess it's non-standard behaviour though. > > Adrian Baker wrote: > >> *ping* >> >> Adrian Baker wrote: >> >>> I've run into a problem where the readonly property of my group is >>> not extending to the child controls they way it should. >>> >>> Say I have the following form: >>> >>> <xforms:instance id="main"> >>> <data> >>> <red> >>> <green> >>> <blue> >>> </data> >>> </xforms:instance> >>> >>> <xforms:instance id="supplementary"> >>> <data> >>> <apple> >>> </data> >>> </xforms:instance> >>> >>> <xforms:bind id="bind-apple" >>> nodeset="instance('supplementary')/apple" readonly="true()"/> >>> <xforms:bind id="bind-red" nodeset="/data/red"/> >>> <xforms:bind id="bind-green" nodeset="/data/green"/> >>> <xforms:bind id="bind-blue" nodeset="/data/blue"/> >>> >>> <xforms:group bind="bind-apple"> >>> <xforms:input bind="bind-red>...</xforms:input> >>> <xforms:input bind="bind-green>...</xforms:input> >>> <xforms:input bind="bind-blue>...</xforms:input> >>> </xforms:group> >>> >>> Note that bind-apple is specified as readonly, therefore the >>> bind-apple group *and all it's child controls* should be readonly. >>> From 9.1.1 (http://www.w3.org/TR/xforms/index-all.html#ui-group) of >>> the spec: >>> >>> "...When model item properties do apply, they apply to all form >>> controls within the |group|. This means, for instance, that if a >>> group is bound to an instance data node that is non-relevant, all >>> child form controls will also be treated as non-relevant." >>> >>> Chiba doesn't actually do this however. It *does* correctly >>> propogate model properties in the model - ie if my parent node is >>> readonly, the resulting DataElement is readonly, and things work >>> well. So if I placed red green & blue inside the apple node, it >>> would work correctly. But as soon as the nodes don't inherit, it >>> doesn't work, regardless of the UI hierarchy. >>> >>> The simple fix is to modify all the checks for model properties like >>> chiba:data/@chiba:readonly in the xslt's so that they check ancestor >>> nodes as well. >>> >>> eg replace >>> >>> <xsl:if test="chiba:data/@chiba:readonly='true'"> >>> <xsl:attribute name="disabled">disabled</xsl:attribute> >>> </xsl:if> >>> >>> with >>> >>> <xsl:if >>> test="ancestor-or-self::node()/chiba:data/@chiba:readonly='true'"> >>> <xsl:attribute name="disabled">disabled</xsl:attribute> >>> </xsl:if> >>> >>> Actually, readonly may be the only one that needs changing due to >>> the fact that the browser (IE at least) doesn't propogate the >>> disabled property, whereas hidden-ness is propogated. (So even if I >>> set my html TABLE element to disabled, child controls are not >>> disabled, whereas if my html TABLE is set to display:none, then all >>> child elements get hidden too). >>> >>> Adrian >>> >>> >>> >>> >>> ------------------------------------------------------- >>> SF.Net email is sponsored by: >>> Tame your development challenges with Apache's Geronimo App Server. >>> Download >>> it for free - -and be entered to win a 42" plasma tv or your very own >>> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php >>> _______________________________________________ >>> Chiba-users mailing list >>> Chi...@li... >>> https://lists.sourceforge.net/lists/listinfo/chiba-users >>> >>> ______________________________________________________________________ >>> This email has been scanned by the MessageLabs Email Security System. >>> For more information please visit http://www.messagelabs.com/email >>> ______________________________________________________________________ >> >> >> >> >> >> >> >> ------------------------------------------------------- >> SF.Net email is sponsored by: >> Tame your development challenges with Apache's Geronimo App Server. >> Download >> it for free - -and be entered to win a 42" plasma tv or your very own >> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php >> _______________________________________________ >> Chiba-users mailing list >> Chi...@li... >> https://lists.sourceforge.net/lists/listinfo/chiba-users >> >> > > |