Try to @InjectComponent private Block myBlock instead.
HTH
Olle

2008/11/20 Thiago H. de Paula Figueiredo <[EMAIL PROTECTED]>

> Hi!
>
> I'm writing a presentation about Tapestry 5 for an developer's event here
> in Belo Horizonte, Brazil. Suggestions are always welcome. :)
>
> I'm having a strange problem trying to write a Zone and Block example
> (5.0.16):
>
> java.lang.RuntimeException: Class
> br.com.arsmachina.introducaotapestry.pages.ajax.Block contains field(s)
> (_$resources) that are not private. You should change these fields to
> private, and add accessor methods if needed.
>
> My page class hasn't any non-private members and the exception only ocurrs
> when I try to inject a Block. Even when I comment out everything but a
> single @Inject private Block block this exception is raised.
>
> Source:
>
> public class Block {
>
>        @Persist
>        @Property
>        private int contador;
>
>        @Inject
>        private Block bandeiraBrasil;
>
>        @Inject
>        private Block bandeiraReinoUnido;
>
>        @Inject
>        private Block soTexto;
>
>        @InjectComponent
>        private Zone zone;
>
>        @OnEvent("rodarZona")
>        public Object mudarZona() {
>
>                contador++;
>
>                if (contador % 4 == 0) {
>                        return bandeiraBrasil;
>                }
>                else if (contador % 4 == 1) {
>                        return bandeiraReinoUnido;
>                }
>                else if (contador % 4 == 3) {
>                        return soTexto;
>                }
>                else {
>                        return zone;
>                }
>
>        }
>
>        @OnEvent("brasil")
>        public Object mostrarBandeiraBrasil() {
>                contador++;
>                return bandeiraBrasil;
>        }
>
>        @OnEvent("reinounido")
>        public Object mostrarBandeiraReinoUnido() {
>                contador++;
>                return bandeiraReinoUnido;
>        }
>
>        @OnEvent("sotexto")
>        public Object mostrarSoTexto() {
>                contador++;
>                return soTexto;
>        }
>
> }
>
> Any ideas?
>
> Thanks in advance. :)
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
[EMAIL PROTECTED]
www.crisp.se

Reply via email to