BUG: The non-relevant fields having embedded output elements in label or hint elements are lost

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

BUG: The non-relevant fields having embedded output elements in label or hint elements are lost

ankostis
Hi,

i have found a bug that i think it relates to output's problems when
it is embeded into label or hints (i haven't checked alerts).

When
    on form construction,
    an xform control's data is non-relevant (so the controls gets born
as "hidden"),
    and this control contains labels or hints with embedded output
elements,
then when the relevancy changes (and the control becomes visible),
    the contents of labels or hints are not displayed!
    (The computed CSS properted 'display' is 'none'.)

NOTE that for our project, this is a show-stopper for 'relevant'
attribute since we prefer to be able to dynamically generate labels
and hints.

We managed to work-around this problem by using read-only property
(with display: hidden;), which does not have similar problems, BUT
makes validation code very complicated (since all data remain
relevant).


I think there are similar open bugs, but i can't be sure that they
cover the above case, so i'm considering to post it separately.

Should i go and file the BUG?
(Also i need some help on how to make a test-case).

Here is a code reproducing the bug:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/
2001/xml-events"
  xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsd="http://
www.w3.org/2001/XMLSchema">

<head>
<title>Irrelevant fields with an output-embeded-in-label</title>
<style type="text/css">
* :disabled { /*display: none;*/
  background-color: green;
}
</style>

<xf:model id="main-model">

  <xf:instance id="data">
    <root xmlns=""> <data1 /> <data2 /> <data3 /></root>
  </xf:instance>

  <xf:bind id="data-data1" nodeset="data1" type="xsd:boolean" />
  <xf:bind id="data-data2" nodeset="data2" relevant="../data1 !=
'true'" />
  <xf:bind id="data-data3" nodeset="data3" relevant="../data1 =
'true'" />
</xf:model>

</head>

<body>
<xf:input bind="data-data1" incremental="true">
  <xf:label>Switch vivibility of controls having labels-with-embedded-
output: </xf:label>
</xf:input>

<p>The next input-control will keeps it's label and hint while
hidden.</p>
<p><xf:input bind="data-data2">
  <xf:label>
    <xf:output>Preserved Label: "</xf:output>
  </xf:label>
  <xf:hint>
    <xf:output value="'Preserved Hint.'" />
  </xf:hint>
</xf:input></p>
<p>
<p>The next input-control will 'loose' it's label and hint!</p>
<xf:input bind="data-data3">
  <xf:label>
    <xf:output>Lost Label: "</xf:output>
  </xf:label>
  <xf:hint>
    <xf:output value="'Lost hint!'" />
  </xf:hint>
</xf:input>
</p>
</body>
</html>


Thank you in advance,
  Kostis

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms