This page illustrates an unexpected behavior
in XSLTForms beta3. There are two copies of this page:
They are identical except in name and in calling different versions of
the library.
For a description of expected and observed behavior, see below.
Add children!
Edit
BBB:
CCC:
DDD:
Done
Show XML
Expected behavior
Initially, the input document contains a series of
s elements, numbered here for reference. Each
s element contains an aaa element,
followed by one or more eee elements.
The purpose of the form is to support the task of adding
three elements named bbb, ccc, and ddd to
each s element. These are to appear after the aaa
element and before the eee elements.
In many cases, the content of bbb will be very similar to
that of aaa, so the form should initialize its value to
that of aaa.
Similarly, the content of ddd will often have some things
in common with that of eee, so the form should initialize the
value of ddd appropriately.
So the expected behavior is as follows:
-
At initial page load, all aaa and eee elements
should display. If the parent s element has
children bbb, ccc, and ddd, they
should display, too, together with an Edit button.
If the parent s element has no
children bbb, ccc, and ddd, then
a button labeled Add children! should display.
-
When the user clicks an Edit button, the elements
bbb, ccc, and ddd in the appropriate s
element should be made available for editing, in text widgets, the
button clicked should disappear, and a new button labeled Done
should appear.
The aaa and eee elements should remain visible, as
should all the other s elements.
-
When the user clicks a Done button, the widgets for elements
bbb, ccc, and ddd in the appropriate s
element should disappear (as should the Done button, and their
values should be displayed in read-only form, with an Edit button,
just as at the initial page load (modulo any changes in the data).
The aaa and eee elements should remain visible, as
should all the other s elements.
-
When the user clicks an Add children! button, elements named
bbb, ccc, and ddd should be added to the
appropriate s element with appropriate initial values.
Text widgets for editing the new elements should appear, together
with a Done button.
The aaa and eee elements should remain visible, as
should all the other s elements.
Observed behavior
The initial display seems to be as expected in all browsers.
When version beta-3RC is used, all browsers tested behave as expected.
When version beta-3 is used, all browsers tested behave in unexpected ways.
In Safari, Firefox 7.0.1, and Chrome 15.0.874 (all running under Mac OS X 10.6.8):
- The Add children! button behaves as expected.
- The Edit button on the first s element behaves as expected.
The Done button on the first s element also behaves as
expected.
- The Edit button on other s elements opens up the
text widgets, as expected, but also makes all eee elements
in the document disappear. (Once they have disappeared, clicking on
a different s element's Edit button makes them reappear.
They then disappear and reappear again in a pattern I haven't fully understood,
but which appears to vary based on which buttons get pressed in which order.
In Firefox 3.6 and Opera 11.52 (again running under Mac OS X 10.6.8):
- The Edit and Done buttons on the first s element
behave as expected.
- The Edit button on other s elements does not open up the
text widgets, as expected; instead it makes all eee elements
in the document disappear. Clicking a second time on the same
Edit button causess the text widgets to appear (but does not cause
the eee elements to reappear. The eee elements do
reappear if a different button (Edit or Add children!)
is pressed.
- The Add children! buttons do not open up the text widgets
as expected; instead they make all the eee elements disappear.
A second click on the same button opens up the text widgets and
sometimes (but not always) makes the eee elements reappear.
(I have not yet figured out whether the difference depends on whether
it's the first or another Add children! button, or on
the sequence of actions.)