Select1 default value

Hi

I'm not sure if this is a bug, or whether I am expecting a feature
that just isn't there. I would like a default value in my select1
widgets when using appearance=minimal. Instead what is happening is
that my default value is ignored and the first option is selected as
the default.

See the form at the end of this post for an example. At the moment,
the work around that I am using is to define an additional list option
with text like - "Choose a country". Is there a better way to go about
this?

Thanks
Adi

<?xml version="1.0" encoding="UTF-8"?>

<h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns="http://
www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jr="http://openrosa.org/javarosa">
<h:head>
<h:title>New Form2</h:title>


<new_form2 id="new_form2">



Choose a country
</new_form2>








QuestionA01


South Africa


Namibia




</h:head>
<h:body>




1



2


</h:body>
</h:html>

Apparently, if you have a (or select), javarosa silently throws
away any values (default or loaded from a saved instance) that don't match
the select choices. I don't like this behavior, but my guess is it's "the
spec" and we should chat with the JR community to see if this makes sense or
not.

If you make "Choose a country" an option in your list, it should work. You
could also optionally create a constraint making "choose a country" not a
valid option so the user has to pick something else.

I also think the type of A01 should be "xsd:select1" instead of
"xsd:string", but I'm not sure if that has much effect on anything.
-Carl

ยทยทยท On Mon, Oct 3, 2011 at 12:20 AM, Adi Eyal wrote:

Hi

I'm not sure if this is a bug, or whether I am expecting a feature
that just isn't there. I would like a default value in my select1
widgets when using appearance=minimal. Instead what is happening is
that my default value is ignored and the first option is selected as
the default.

See the form at the end of this post for an example. At the moment,
the work around that I am using is to define an additional list option
with text like - "Choose a country". Is there a better way to go about
this?

Thanks
Adi

<?xml version="1.0" encoding="UTF-8"?>

<h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns="http://
www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jr="http://openrosa.org/javarosa">
<h:head>
<h:title>New Form2</h:title>


<new_form2 id="new_form2">



Choose a country
</new_form2>








QuestionA01


South Africa


Namibia




</h:head>
<h:body>




1



2


</h:body>
</h:html>