Html:select com valor default vindo de um bean

0 respostas
M

Pessoal,

To apanhando pra conseguir deixar pre-selecionado um campo select em um html:select com informacoes vindas de um bean.

tenho esse codigo aqui:

<html:select property="mesInicial" onchange="updateMesInicial(this)" value="${reportFormBean.mesInicial}">
	<html:optionsCollection property="mesesValidos"/>
</html:select>

tenho um formBean com todos gets e sets...

no meu form eu consigo pegar os campos de modo hidden, mas nao consigo de jeito algum colocar ele pre-selecionado no html:select

Tentei pra testar tambem usar isso:

<html:select property="mesInicial" onchange="updateMesInicial(this)" value="getMesInicial()">
	<html:optionsCollection property="mesesValidos"/>
</html:select>

..

function getMesInicial()
{
        return document.reportFormBean.mesInicial.value;
}

e tambem nao funcionou...

Se alguem puder dar uma luz, eu agradeço

Criado 24 de novembro de 2006
Respostas 0
Participantes 1