Erro no HashMap

8 views
Skip to first unread message

Diego Venuzka

unread,
Oct 14, 2010, 4:09:45 PM10/14/10
to gxt...@googlegroups.com
Pessoal, estou com um problema, primeiro vou mostrar o codigo:

   try {
            HashMap<String, String> param = new HashMap<String, String>();
            param.put("op", "insert");
            param.put("clientesT.cpf", this.cpf.getValue());
            param.put("clientesT.rg", rg.getValue());
            param.put("clientesT.nome", nome.getValue());
            param.put("clientesT.data_nascimento", data_nascimento.getValue()); //DateField
            param.put("clientesT.sexo", sexo.getValue()); //Radio
            param.put("clientesT.endereco", endereco.getValue());
            param.put("clientesT.telefone_res", telefone_res.getValue());
            param.put("clientesT.telefone_cel", telefone_cel.getValue());
            param.put("clientesT.telefone_res", telefone_res.getValue());
            param.put("clientesT.email", email.getValue());
            param.put("clientesT.cidade", cidade.getValue());
            param.put("clientesT.estado", estado.getValue()); //simpleComboBox

Os campos que nao sao "especiais" ele passou corretamente, mas os que sao Radio, DateField e Combo ele dá erro, dizendo: "cannot find symbol"....

Alguma ideia de como resolver isso?

Obrigado!!!!

--
Diego Venuzka

Alex

unread,
Oct 14, 2010, 4:43:56 PM10/14/10
to Gxt (ExtGwt) [BR]
tem como postar a callstack completa?

Diego Venuzka

unread,
Oct 14, 2010, 5:13:20 PM10/14/10
to gxt...@googlegroups.com
ai vai...

init:
deps-module-jar:
deps-ear-jar:
deps-jar:
Compiling 1 source file to C:\projetos\RaceTech\build\web\WEB-INF\classes
C:\projetos\RaceTech\src\java\br\com\site\racetech\client\display\easyEngenharia\CadastrarClienteGWT.java:160: cannot find symbol
symbol  : method put(java.lang.String,java.util.Date)
location: class java.util.HashMap<java.lang.String,java.lang.String>
            param.put("clientesT.data_nascimento", data_nascimento.getValue());
C:\projetos\RaceTech\src\java\br\com\site\racetech\client\display\easyEngenharia\CadastrarClienteGWT.java:161: cannot find symbol
symbol  : method put(java.lang.String,com.extjs.gxt.ui.client.widget.form.Radio)
location: class java.util.HashMap<java.lang.String,java.lang.String>
            param.put("clientesT.sexo", sexo.getValue());
C:\projetos\RaceTech\src\java\br\com\site\racetech\client\display\easyEngenharia\CadastrarClienteGWT.java:168: cannot find symbol
symbol  : method put(java.lang.String,com.extjs.gxt.ui.client.data.ModelData)
location: class java.util.HashMap<java.lang.String,java.lang.String>
            param.put("clientesT.estado", estado.getValue());
C:\projetos\RaceTech\src\java\br\com\site\racetech\client\display\easyEngenharia\CadastrarClienteGWT.java:170: cannot find symbol
symbol  : constructor EasyAccessURL(br.com.site.racetech.client.display.easyEngenharia.CadastrarClienteGWT)
location: class br.com.site.racetech.client.EasyAccessURL
            EasyAccessURL access = new EasyAccessURL(this);
Note: C:\projetos\RaceTech\src\java\br\com\site\racetech\client\display\easyEngenharia\CadastrarClienteGWT.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
C:\projetos\RaceTech\nbproject\build-impl.xml:546: The following error occurred while executing this line:
C:\projetos\RaceTech\nbproject\build-impl.xml:285: Compile failed; see the compiler error output for details.
FALHA NA CONSTRUÇÃO (tempo total: 1 segundo)


--
Você está recebendo esta mensagem porque se inscreveu no grupo "Gxt (ExtGwt) [BR]" dos Grupos do Google.
Para postar neste grupo, envie um e-mail para gxt...@googlegroups.com.
Para cancelar a inscrição nesse grupo, envie um e-mail para gxt-br+un...@googlegroups.com.
Para obter mais opções, visite esse grupo em http://groups.google.com/group/gxt-br?hl=pt-BR.




--
Diego Venuzka

Alex

unread,
Oct 14, 2010, 6:31:16 PM10/14/10
to Gxt (ExtGwt) [BR]
Vc tah tentando colocar tipos distintos de dados no lugar de string,
vou explicar melhor.
quando vc chama um widget.getValue() o gxt te devolve o tipo natural
desse widget, se eu dou um getValue() numa textbox ele me dah uma
string, naturalmente, já se eu faço o mesmo em um datefield ele me
retorna um valor tipo Date, :), simples assim, ou vc tenta achar um
getRawValue que te retorne sempre string(feio), ou faz um wrapper pra
cada widget(trabalhoso) ou faz uma factory(elegante) que te retorna
string para cada tipo de widget que vc passe.
ex:

Factory(){
Widget wid = null;
String getValue(){
if (wid instanceof DAteField){
return ((DAteField)wid).getvalue().tostring();
} else if (wid instanceof TextField){
return ((TextField)wid).getValue().tostring();
} ...... e assim por diante ...

}

Factory(Widget wid){
this.wid = wid;
}

}

Desculpe eu nao tive tempo de testar esse codigo ,,, provavelmente ele
vai bater fofo! mais a ideia é essa!
> > gxt-br+un...@googlegroups.com<gxt-br%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages