Hello all!!

So I quite get mix up with the getters and setters ^^ but now the problem is
solved and you were right, the getter for Types was automatically generated
with @Property but I needed it to be constructed with BDD data, so I wrote
my own getter (and removed @Property) and now everything works fine!!

Thanks for spending time for my problem!!!

See you!!



Erick Erickson wrote:
> 
> Eclipse has nothing to do with it, it's the @Property annotation.
> This annotation generates getters and setters automatically, which
> is why you're getting them even when you don't define them and
> why you're getting errors when you use the @Property
> annotation AND define a getter/setter.
> 
> You can leave off the @Property annotation AND provide
> getters and setters. Or you can use the @Property annotation
> and be satisfied with the default behavior. But you have to
> do one or the other if you want your tml to be aware of your
> fields.
> 
> HTH
> Erick
> 
> On Mon, Aug 9, 2010 at 9:05 AM, mcfly37 <vincentgou...@gmail.com> wrote:
> 
>>
>> Yep it was this. But I'm wondering if it is normal....
>>
>> To put my case in a nutshell :
>>  1- I declared types whithout getter but with @Property, but I get an
>> exception because I don't have getters...
>>  2- I wrote getters, and I have an exception because I have already
>> defined
>> a getter...
>>
>>  3- Now I have the same problem for another criteria but even with or
>> without getters, with or without @Property I have an error...
>>
>> It is the value "libelle" in this code :
>>
>> <label t:type="label" t:for="libelle"  /> :
>>                <input t:type="select" t:id="libelle" t:model="types"
>> style="width: 230px;" />
>>
>> As you can see, I fill my "select" with the String list "types" and I get
>> the value selected by the user in "libelle"... And I have the same
>> problem
>> but if I withdraw the @Property off "libelle", I cannot use it as a value
>> selected by a user...
>>
>> And thanks for taking time to help me ;-D
>>
>> Inge Solvoll-2 wrote:
>> >
>> > You probably have this in your page class:
>> >
>> > @Property
>> > private List types;
>> >
>> > That will generate getters and setters, which is what is going on when
>> you
>> > get the exception.
>> >
>> > On Mon, Aug 9, 2010 at 2:19 PM, mcfly37 <vincentgou...@gmail.com>
>> wrote:
>> >
>> >>
>> >> Hey!
>> >>
>> >> You were right I didn't add getTypes method, but I believe that
>> eclipse
>> >> automatically add getters and setters when they are not wrote am I
>> wrong?
>> >>
>> >> Because when I add those methods, A new exception rise up :
>> >>
>> >> Render queue error in BeginRender[borne/Borne:pagelink_1]:
>> >> java.lang.ClassNotFoundException: caught an exception while obtaining
>> a
>> >> class file for com.applira.web.pages.borne.BorneDetails
>> >>
>> >> You can notice that the exception is in bornes.tml witch is the page
>> from
>> >> where the link for Bornedetails is. And apparently the root cause of
>> this
>> >> is
>> >> :
>> >>
>> >> Caused by:
>> >> org.apache.tapestry5.internal.services.TransformationException:
>> >> Unable to add new method public final java.util.List getTypes() as it
>> >> already exists.
>> >>
>> >> But I checked in the file and I have only one getTypes method...
>> >>
>> >> Tornn wrote:
>> >> >
>> >> > Hi!
>> >> >
>> >> >   >> <input t:type="select" t:id="type" t:model="types"
>> >> > t:value="libelle" style="width: 230px;" />
>> >> >   Where is method getTypes?
>> >> >
>> >> >   Try to read route cause of exception. Tapestry5 is really great in
>> >> > reporting detailed exceptons.
>> >> >
>> >> > 2010/8/9 mcfly37 <vincentgou...@gmail.com>:
>> >> >>
>> >> >> Hello peoples!!
>> >> >>
>> >> >> I'm trying to design a multi criteria research for an application.
>> >> This
>> >> >> application have to display a list of object this way :
>> >> >>
>> >> >> <div id="corps">
>> >> >>                        <div t:type="loop" t:source="isoMsgList"
>> >> >> t:value="isoMsg">
>> >> >>                                <div id="Liste"
>> >> style="background-color:
>> >> >> ${getIsoMsgState()}">
>> >> >>
>> >> >>  ${isoMsg.idMessage}/${isoMsg.horodatage}/${getLibelleType()}
>> >> >>
>> >> >>                                        <div t:type="loop"
>> >> >> t:source="ssMsgList" t:value="isoMSg">
>> >> >>                                                <div id="ListSsMsg"
>> >> >> style="background-color: ${getIsoMsgState()}">
>> >> >>
>> >> >>
>> >>
>> ${isoMsg.idMessage}/${isoMsg.horodatage}/${isoMsg.exception}/${getLibelleType()}
>> >> >>                                                </div>
>> >> >>                                        </div>
>> >> >>                                </div>
>> >> >>                          </div>
>> >> >>
>> >> >>                </div>
>> >> >>
>> >> >> These objects are message objects and they can have sub messages.
>> So
>> I
>> >> >> the
>> >> >> user to research particular message with somes criteria (date,
>> state
>> >> >> etc...)
>> >> >>
>> >> >> Here his the .tml code :
>> >> >>
>> >> >>                <t:form>
>> >> >>                 <p>
>> >> >>                <label t:type="label" t:for="type"  /> :
>> >> >>                <input t:type="select" t:id="type" t:model="types"
>> >> >> t:value="libelle" style="width: 230px;" />
>> >> >>                <label t:type="label" t:for="etatRetour" /> :
>> >> >>                <input t:type="select" t:id="etatRetour"
>> >> t:model="literal:
>> >> >> ok,
>> >> >> non-ok"/>
>> >> >>                <input t:id="dateTimeField1"/>
>> >> >>                <input t:type="submit" t:name="Rechercher"/>
>> >> >>         </p>
>> >> >>                </t:form>
>> >> >>
>> >> >> And the java code :
>> >> >>
>> >> >>        @Persist
>> >> >>        @Property
>> >> >>        private String libelle;
>> >> >>
>> >> >>        @SuppressWarnings("unused")
>> >> >>        @Component(parameters = { "value=actualDate1",
>> >> >>                        "datePattern=dd-MM-yyyy HH:mm" })
>> >> >>        private DateTimeField _dateTimeField1;
>> >> >>
>> >> >>
>> >> >>        @Persist
>> >> >>        @Property
>> >> >>        private Date _actualDate1;
>> >> >>
>> >> >>        @Persist
>> >> >>        @Property
>> >> >>        private String _etatRetour;
>> >> >>
>> >> >>        Object onSuccess(){
>> >> >>                return BorneDetails.class;
>> >> >>        }
>> >> >>
>> >> >> public List<IsoMsg> getIsoMsgList() {
>> >> >>                String error = null;
>> >> >>                try {
>> >> >>                        if(_etatRetour == null)
>> >> >>                        {
>> >> >>                                error = null;
>> >> >>                        }
>> >> >>                        else if(_etatRetour.equals("ok"))
>> >> >>                        {
>> >> >>                                error = "false";
>> >> >>                        }
>> >> >>                        else if(_etatRetour.equals("non-ok"))
>> >> >>                        {
>> >> >>                                error = "true";
>> >> >>                        }
>> >> >>                        TypeIso type = null;
>> >> >>                        if (libelle !=null){
>> >> >>                                type =
>> >> >> typeIsoManager.findByLibelle(libelle);
>> >> >>                        }
>> >> >>
>> >> >>                        return (List<IsoMsg>)
>> >> >> isoMsgManager.findMultiCritere(bornes.getId(),
>> >> >> _actualDate1, type, error);
>> >> >>                } catch (BusinessException e) {
>> >> >>
>> >> >>                        e.printStackTrace();
>> >> >>                        return null;
>> >> >>                } catch (TechnicalException e) {
>> >> >>
>> >> >>                        e.printStackTrace();
>> >> >>                        return null;
>> >> >>                }
>> >> >>        }
>> >> >> public List<String> getLibelleList() {
>> >> >>                try {
>> >> >>                        return typeIsoManager.findLibelle();
>> >> >>                } catch (BusinessException e) {
>> >> >>                        // TODO Auto-generated catch block
>> >> >>                        e.printStackTrace();
>> >> >>                        return null;
>> >> >>                } catch (TechnicalException e) {
>> >> >>                        // TODO Auto-generated catch block
>> >> >>                        e.printStackTrace();
>> >> >>                        return null;
>> >> >>                }
>> >> >>        }
>> >> >>
>> >> >>        public List<IsoMsg> getSsMsgList() {
>> >> >>
>> >> >>                try {
>> >> >>                        return (List<IsoMsg>)
>> >> >> (isoMsgManager.findSsMsg(isoMsg
>> >> >>                                        .getIdMessage()));
>> >> >>                } catch (BusinessException e) {
>> >> >>                        e.printStackTrace();
>> >> >>                        return null;
>> >> >>                } catch (TechnicalException e) {
>> >> >>                        e.printStackTrace();
>> >> >>                        return null;
>> >> >>                }
>> >> >>        }
>> >> >>
>> >> >>        public String getIsoMsgState() {
>> >> >>                color = service.isoMsgState(isoMsg.getIdMessage());
>> >> >>                return color;
>> >> >>        }
>> >> >>
>> >> >>        public String getLibelleType() {
>> >> >>                TypeIso type;
>> >> >>                try {
>> >> >>                        type =
>> >> >> typeIsoManager.findById(isoMsg.getTypeIso().getIdType());
>> >> >>                } catch (BusinessException e) {
>> >> >>                        e.printStackTrace();
>> >> >>                        return null;
>> >> >>                } catch (TechnicalException e) {
>> >> >>                        e.printStackTrace();
>> >> >>                        return null;
>> >> >>                }
>> >> >>                return type.getLibelle();
>> >> >>        }
>> >> >>
>> >> >> But when I try this code, I get the following exception :
>> >> >>
>> >> >> [ERROR] borne.BorneDetails Render queue error in
>> >> >> BeforeRenderTemplate[borne/Details:type]: Parameter 'model' of
>> >> component
>> >> >> borne/Details:type is bound to null. This parameter is not allowed
>> to
>> >> be
>> >> >> null.
>> >> >> org.apache.tapestry5.ioc.internal.util.TapestryException: Parameter
>> >> >> 'model'
>> >> >> of component borne/Details:type is bound to null. This parameter is
>> >> not
>> >> >> allowed to be null. [at
>> >> >>
>> >>
>> classpath:com/atosworldline/effia/applira/web/pages/borne/BorneDetails.tml,
>> >> >> line 24]
>> >> >>
>> >> >> In my mind the onSuccess function his the false one (I'm not very
>> sure
>> >> >> that
>> >> >> refreshing the page with persistant criteria his the right thing to
>> >> do...
>> >> >> but I didn't find another idea) But I didn't manage to find how to
>> >> >> withdraw
>> >> >> this error.
>> >> >>
>> >> >> So has a pilote in a plane, I say mayday mayday!! ;-D
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> http://old.nabble.com/Multicriteria-research-tp29386056p29386056.html
>> >> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> >> >> For additional commands, e-mail: users-h...@tapestry.apache.org
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > С Уважением,
>> >> >  Карпушин Сергей
>> >> >
>> >> >
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> >> > For additional commands, e-mail: users-h...@tapestry.apache.org
>> >> >
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >> http://old.nabble.com/Multicriteria-research-tp29386056p29387271.html
>> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> >> For additional commands, e-mail: users-h...@tapestry.apache.org
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Multicriteria-research-tp29386056p29387685.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Multicriteria-research-tp29386056p29397110.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to