Closed Bug 344693 Opened 18 years ago Closed 9 years ago

Select1 selection gives invalid state

Categories

(Core Graveyard :: XForms, defect)

Other
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: js177634, Unassigned)

References

()

Details

Attachments

(1 file)

2.38 KB, application/xhtml+xml
Details
User-Agent:       Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.8.0.5) Gecko/20060619 Firefox/1.5.0.5
Build Identifier: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.8.0.5) Gecko/20060619 Firefox/1.5.0.5

In the example file, both an input and a select1 are bound to the same (integer) variable. Even though the select1 only contains numbers, selecting any of them moves the state to invalid (as can be seen by red colour due to some CSS). However, entering the same numbers into the input field works ok (and obviously, entering letters there leads to invalid state).

Reproducible: Always




Happens with all recent xforms extensions.
I was smart enough to test this on Minefield too, same result.
Assignee: nobody → xforms
Component: General → XForms
Product: Firefox → Core
QA Contact: general → spride
Summary: [xforms] Select1 selection gives invalid state → Select1 selection gives invalid state
Version: unspecified → Trunk
Can you attach testcase?
sor(In reply to comment #1)
> Can you attach testcase?
> 

Sorry, I see.
XForms specs says (http://www.w3.org/TR/xforms/slice8.html#ui-selectOne):

Note that the datatype bound to this form control may include a non-enumerated value space, e.g., xsd:string, or a union of a enumeration and a non-enumerated datatype (called an open enumeration).
But in my case, it doesn't have an "open enumeration" (on purpose).

On a related note (separate bug report?) select1 in xforms even allows selection="open" with "closed enumerations" as my one.
The issue here is that we are counting the carriage returns and whitespaces as part of the values.  According to the Schema spec, we shouldn't do that for numerical and string types.  cr and lf should be changed to spaces and then the leading and trailing spaces should be dropped.  So we shouldn't be marking the controls invalid.  HOWEVER, it isn't clear that xforms should modify the values so that they DON'T have the cr's and lf's so your select1 could still show as out-of-range if you just put '10' in the input.

If you want to work around this in your form, you should change:

<xf:value>
1
</xf:value>

to

<xf:value>1</xf:value>
Attached file testcase 2
should selecting an item from this select1 cause everything to be invalid or not?
(In reply to comment #6)
> Created an attachment (id=229275) [edit]
> testcase 2
> 
> should selecting an item from this select1 cause everything to be invalid or
> not?
> 

I guess everything should have one and the same behaviour like select1 since instance node contains invalid data in accordance with type.
RIP xforms
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: