myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wolfgang <wkl...@ebi.ac.uk>
Subject set default value by h:selectOneRadio
Date Fri, 31 Aug 2007 11:05:33 GMT
Hi,

I tried to set a default value by the h:selectOneRadio tag but it didn't 
work

my bean looks like this:

    private String radio="Accessions";

        if (radio.equals("0")) {
            System.out.println("Accession choosed");
        } else {
            System.out.println("Sequence choosed");
        }

    public String getRadio() {
        return radio;
    }

    public void setRadio(String radio) {
        this.radio = radio;
    }

and my xhtml like this:

<h:selectOneRadio id="radio" value="#{home.radio}">
                    <f:selectItem itemLabel="Accessions" itemValue="0"/>
                    <f:selectItem itemLabel="Sequences" itemValue="1"/>
</h:selectOneRadio>

Cheers WOlfgang


Mime
View raw message