"List<String> categoryList = Arrays.asList(fooList);"
List<String> categoryList = <listaDoBancoDeDados>
Olá! Estou aprendendo wicket e surguiu uma dúvida: como faço para adaptar esse exemplo com listas vindas de um banco de dados?Obrigada!
--
# Mensagem do grupo "Wicket em Português" do Google Groups.
* Para postar, envie e-mail para: wicke...@googlegroups.com
* Para cancelar inscrição, envie e-mail para wicket-ptbr...@googlegroups.com
* Mais opções, visite http://groups.google.com.br/group/wicket-ptbr?hl=pt-BR
---
You received this message because you are subscribed to the Google Groups "Wicket em Português" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wicket-ptbr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
private
final
Integer[] even = {
2
,
4
,
6
,
8
,
10
};
private
final
Integer[] odd = {
1
,
3
,
5
,
7
,
9
};
"
protected
void
onUpdate(AjaxRequestTarget target) {
if
(category.equals(categoryList.get(
0
))) {
numberList = Arrays.asList(even);
}
else
if
(category.equals(categoryList.get(
1
))) {
numberList = Arrays.asList(odd);
}
if
(target !=
null
) {
target.addComponent(numberChoice);
}
}
});
List category = <listaDoBanco>;
List segundaLista = null;
DropDownChoice categoryChoice =
new
DropDownChoice(
"categoryChoice"
,
new
PropertyModel(HomePage.
this
,
"category"
), Model.ofList(categoryList));
protected
void
onUpdate(AjaxRequestTarget target) {
if
(numberChoice.getConvertedInput() != null && numberChoice.getConvetedInput().equals("ATUALIZE"
) {
segundaLista = <procurarNoBancoNumerosPares>;
}
else
{
segundaLista = new ArrayList();
}
if
(target !=
null
) {
target.addComponent(numberChoice);
}
}
});