You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by János Jarecsni <ja...@gmail.com> on 2008/04/22 07:50:30 UTC

problem with example .TML

Hi,

I have upgraded from 5.0.10 to 5.0.11 and a .TML which worked before now
throws this:

An unexpected application exception has occurred.

Render queue error in SetupRender[AddCelebrity:celebrity.editor]: Exception
instantiating instance of com.packtpub.celebrities.model.Celebrity (for
component 'AddCelebrity:celebrity.editor'): Error invoking constructor
com.packtpub.celebrities.model.Celebrity(String, String, Date, Occupation)
(at Celebrity.java:18) (for service 'BeanModelSource'): No service
implements the interface java.util.Date.

The .TML code:

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
    <head>
        <title>Celebrity Collector: Adding New Celebrity</title>
        <link rel="stylesheet" href="${styles}" type="text/css"/>
    </head>
    <body>
        <h1>Adding New Celebrity</h1>

        <t:beaneditform t:id="celebrity" t:submitLabel="Save"
            remove="id"

reorder="firstName,lastName,dateOfBirth,birthDateVerified,occupation,biography">
            <t:parameter name="biography">
            <table cellpadding="0" cellspacing="0"><tr>
                <td><t:t5components.editor t:id="biography"
t:value="celebrity.biography"
                    t:toolbarSet="Medium" t:width="350"
t:height="200"/></td></tr>
            </table>
              </t:parameter>
        </t:beaneditform>
    </body>
</html>
and the model class (Celebrity):

package com.packtpub.celebrities.model;

import java.util.Date;

public class Celebrity {
    private Date dateOfBirth;
    // some fields omitted

    public Celebrity() {
    }

    public Celebrity(String firstName, String lastName,
                    Date dateOfBirth, Occupation occupation) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.dateOfBirth = dateOfBirth;
        this.occupation = occupation;
    }

    public Date getDateOfBirth() {
        return dateOfBirth;
    }

    public void setDateOfBirth(Date dateOfBirth) {
        this.dateOfBirth = dateOfBirth;
    }
    // more methods follow
}


Can you tell me what am I doing wrong?
thx
janos

Re: problem with example .TML

Posted by János Jarecsni <ja...@gmail.com>.
thanks, I wasn't aware of such a usage of @Inject. I thought it is for IoC
to inject some objects into the class. I will try this. And thanks!
cheers
janos

On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
>
> Hi János,
>
> Sure can:
>
> public class MyClass {
>  ...
>
>  @Inject
>  public MyClass() {
>  }
>
>  public MyClass(Date date) {
>    ...
>  }
>
>  ...
> }
>
> Something like that.
>
> -Filip
>
> János Jarecsni skrev:
>
> > hi Filip,
> > and how to do that? could you include (inject :P) an example for that?
> > thx!
> > Janos
> >
> > On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
> >
> > > Hi,
> > >
> > > You can also put an @Inject annotation on the constructor you want
> > > Tapestry to use when auto-instantiating your class. This way you can
> > > have
> > > multiple constructors.
> > >
> > > -Filip
> > >
> > > János Jarecsni skrev:
> > >
> > >  Hi Michael,
> > > >
> > > > I googled for this problem and found a response to a similar problem
> > > > from
> > > > you. I followed the instructions there, and succeeded. (I had to
> > > > remove
> > > > the
> > > > constructor which takes arguments! from the Celebrity class - until
> > > > there
> > > > was this ctr besides the no-arg, it still tried to use it, no matter
> > > > what
> > > > the model wanted to do).
> > > >
> > > > Now the beaneditor call is like this:
> > > >
> > > >       <t:beaneditform t:model="model" t:object="celebrity">
> > > >                   <!--
> > > >           <t:parameter name="biography">
> > > >           <table cellpadding="0" cellspacing="0"><tr>
> > > >               <td><t:t5components.editor t:id="biography"
> > > > t:value="celebrity.biography"
> > > >                   t:toolbarSet="Medium" t:width="350"
> > > > t:height="200"/></td></tr>
> > > >           </table>
> > > >             </t:parameter>
> > > >                       -->
> > > >       </t:beaneditform>
> > > >
> > > > Thx!
> > > > Janos
> > > > PS: I used this info:
> > > > http://www.nabble.com/T5.0.11-beanEditForm-td16536531.html
> > > >
> > > >
> > > >
> > > > On 22/04/2008, János Jarecsni <ja...@gmail.com> wrote:
> > > >
> > > >  Hi Michael,
> > > > >
> > > > > I had a look... but it does not make too much sense for me :)
> > > > > Where do
> > > > > I
> > > > > use model.remove() now? Or do you mean I should change the remove
> > > > > attribute
> > > > > in
> > > > >
> > > > >  <t:beaneditform t:id="celebrity" t:submitLabel="Save"
> > > > >          remove="id"....
> > > > >
> > > > > to exclude="id"? (I tried even this, but nothing changed).
> > > > >
> > > > > As far as I see this, there is some complain about no service
> > > > > implementing
> > > > > java.util.Date (whatever that should mean). It is obviously trying
> > > > > to
> > > > > instantiate a model class to use for bean editing. This worked so
> > > > > far,
> > > > > now
> > > > > it can't instantiate.
> > > > >
> > > > > thx!
> > > > > janos
> > > > >
> > > > > On 22/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
> > > > >
> > > > >  Hi Janos,
> > > > > >
> > > > > > take a look at the upgrade notes. Close to the bottom the change
> > > > > > of
> > > > > > the
> > > > > > BeanModel signature is documented. Now you need mode.exlude(..)
> > > > > > instead of
> > > > > > model.remove(..).
> > > > > >
> > > > > > Regards,
> > > > > > Michael
> > > > > >
> > > > > > [1]
> > > > > > http://tapestry.apache.org/tapestry5/tapestry-core/upgrade.html
> > > > > >
> > > > > > János Jarecsni schrieb:
> > > > > >
> > > > > >  Hi,
> > > > > >
> > > > > > > I have upgraded from 5.0.10 to 5.0.11 and a .TML which worked
> > > > > > > before
> > > > > > > now
> > > > > > > throws this:
> > > > > > >
> > > > > > > An unexpected application exception has occurred.
> > > > > > >
> > > > > > > Render queue error in
> > > > > > > SetupRender[AddCelebrity:celebrity.editor]:
> > > > > > > Exception
> > > > > > > instantiating instance of
> > > > > > > com.packtpub.celebrities.model.Celebrity
> > > > > > > (for
> > > > > > > component 'AddCelebrity:celebrity.editor'): Error invoking
> > > > > > > constructor
> > > > > > > com.packtpub.celebrities.model.Celebrity(String, String, Date,
> > > > > > > Occupation)
> > > > > > > (at Celebrity.java:18) (for service 'BeanModelSource'): No
> > > > > > > service
> > > > > > > implements the interface java.util.Date.
> > > > > > >
> > > > > > > The .TML code:
> > > > > > >
> > > > > > > <html xmlns:t="
> > > > > > > http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> > > > > > >  <head>
> > > > > > >      <title>Celebrity Collector: Adding New Celebrity</title>
> > > > > > >      <link rel="stylesheet" href="${styles}" type="text/css"/>
> > > > > > >  </head>
> > > > > > >  <body>
> > > > > > >      <h1>Adding New Celebrity</h1>
> > > > > > >
> > > > > > >      <t:beaneditform t:id="celebrity" t:submitLabel="Save"
> > > > > > >          remove="id"
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > reorder="firstName,lastName,dateOfBirth,birthDateVerified,occupation,biography">
> > > > > > >          <t:parameter name="biography">
> > > > > > >          <table cellpadding="0" cellspacing="0"><tr>
> > > > > > >              <td><t:t5components.editor t:id="biography"
> > > > > > > t:value="celebrity.biography"
> > > > > > >                  t:toolbarSet="Medium" t:width="350"
> > > > > > > t:height="200"/></td></tr>
> > > > > > >          </table>
> > > > > > >            </t:parameter>
> > > > > > >      </t:beaneditform>
> > > > > > >  </body>
> > > > > > > </html>
> > > > > > > and the model class (Celebrity):
> > > > > > >
> > > > > > > package com.packtpub.celebrities.model;
> > > > > > >
> > > > > > > import java.util.Date;
> > > > > > >
> > > > > > > public class Celebrity {
> > > > > > >  private Date dateOfBirth;
> > > > > > >  // some fields omitted
> > > > > > >
> > > > > > >  public Celebrity() {
> > > > > > >  }
> > > > > > >
> > > > > > >  public Celebrity(String firstName, String lastName,
> > > > > > >                  Date dateOfBirth, Occupation occupation) {
> > > > > > >      this.firstName = firstName;
> > > > > > >      this.lastName = lastName;
> > > > > > >      this.dateOfBirth = dateOfBirth;
> > > > > > >      this.occupation = occupation;
> > > > > > >  }
> > > > > > >
> > > > > > >  public Date getDateOfBirth() {
> > > > > > >      return dateOfBirth;
> > > > > > >  }
> > > > > > >
> > > > > > >  public void setDateOfBirth(Date dateOfBirth) {
> > > > > > >      this.dateOfBirth = dateOfBirth;
> > > > > > >  }
> > > > > > >  // more methods follow
> > > > > > > }
> > > > > > >
> > > > > > >
> > > > > > > Can you tell me what am I doing wrong?
> > > > > > > thx
> > > > > > > janos
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > > > >
> > > > > >
> > > > > >
> > > > > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> > >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: problem with example .TML

Posted by János Jarecsni <ja...@gmail.com>.
thx for the info, I can live with this for now :)
cheers,
janos

On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
>
> Hmm, looks like this was added in 5.0.12 which hasn't been released yet.
> Sorry about that.
>
> Not quite sure how to solve your problem, then.
>
> -Filip
>
> On 2008-04-22 15:43, János Jarecsni wrote:
>
> > The compiler is not so much interesting, Tapestry is 5.0.11 :)
> >
> > On 22/04/2008, János Jarecsni <ja...@gmail.com> wrote:
> >
> > > Hi Filip,
> > >
> > > the compiler (Netbeans 6) complains about @Inject that "annotation
> > > type
> > > not available for this kind of declaration".
> > >
> > > cheers,
> > > janos
> > >
> > > On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
> > >
> > > > Hi János,
> > > >
> > > > Sure can:
> > > >
> > > > public class MyClass {
> > > >  ...
> > > >
> > > >  @Inject
> > > >  public MyClass() {
> > > >  }
> > > >
> > > >  public MyClass(Date date) {
> > > >   ...
> > > >  }
> > > >
> > > >  ...
> > > > }
> > > >
> > > > Something like that.
> > > >
> > > > -Filip
> > > >
> > > > János Jarecsni skrev:
> > > >
> > > >  hi Filip,
> > > > > and how to do that? could you include (inject :P) an example for
> > > > > that?
> > > > > thx!
> > > > > Janos
> > > > >
> > > > > On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
> > > > >
> > > > >  Hi,
> > > > > >
> > > > > > You can also put an @Inject annotation on the constructor you
> > > > > > want
> > > > > > Tapestry to use when auto-instantiating your class. This way you
> > > > > > can
> > > > > > have
> > > > > > multiple constructors.
> > > > > >
> > > > > > -Filip
> > > > > >
> > > > > > János Jarecsni skrev:
> > > > > >
> > > > > >  Hi Michael,
> > > > > >
> > > > > > > I googled for this problem and found a response to a similar
> > > > > > > problem
> > > > > > > from
> > > > > > > you. I followed the instructions there, and succeeded. (I had
> > > > > > > to
> > > > > > > remove
> > > > > > > the
> > > > > > > constructor which takes arguments! from the Celebrity class -
> > > > > > > until
> > > > > > > there
> > > > > > > was this ctr besides the no-arg, it still tried to use it, no
> > > > > > > matter
> > > > > > > what
> > > > > > > the model wanted to do).
> > > > > > >
> > > > > > > Now the beaneditor call is like this:
> > > > > > >
> > > > > > >      <t:beaneditform t:model="model" t:object="celebrity">
> > > > > > >                  <!--
> > > > > > >          <t:parameter name="biography">
> > > > > > >          <table cellpadding="0" cellspacing="0"><tr>
> > > > > > >              <td><t:t5components.editor t:id="biography"
> > > > > > > t:value="celebrity.biography"
> > > > > > >                  t:toolbarSet="Medium" t:width="350"
> > > > > > > t:height="200"/></td></tr>
> > > > > > >          </table>
> > > > > > >            </t:parameter>
> > > > > > >                      -->
> > > > > > >      </t:beaneditform>
> > > > > > >
> > > > > > > Thx!
> > > > > > > Janos
> > > > > > > PS: I used this info:
> > > > > > > http://www.nabble.com/T5.0.11-beanEditForm-td16536531.html
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On 22/04/2008, János Jarecsni <ja...@gmail.com>
> > > > > > > wrote:
> > > > > > >
> > > > > > >  Hi Michael,
> > > > > > >
> > > > > > > > I had a look... but it does not make too much sense for me
> > > > > > > > :)
> > > > > > > > Where do
> > > > > > > > I
> > > > > > > > use model.remove() now? Or do you mean I should change the
> > > > > > > > remove
> > > > > > > > attribute
> > > > > > > > in
> > > > > > > >
> > > > > > > >  <t:beaneditform t:id="celebrity" t:submitLabel="Save"
> > > > > > > >         remove="id"....
> > > > > > > >
> > > > > > > > to exclude="id"? (I tried even this, but nothing changed).
> > > > > > > >
> > > > > > > > As far as I see this, there is some complain about no
> > > > > > > > service
> > > > > > > > implementing
> > > > > > > > java.util.Date (whatever that should mean). It is obviously
> > > > > > > > trying to
> > > > > > > > instantiate a model class to use for bean editing. This
> > > > > > > > worked
> > > > > > > > so far,
> > > > > > > > now
> > > > > > > > it can't instantiate.
> > > > > > > >
> > > > > > > > thx!
> > > > > > > > janos
> > > > > > > >
> > > > > > > > On 22/04/2008, Michael Gerzabek <mi...@gmx.net>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > >  Hi Janos,
> > > > > > > >
> > > > > > > > > take a look at the upgrade notes. Close to the bottom the
> > > > > > > > > change of
> > > > > > > > > the
> > > > > > > > > BeanModel signature is documented. Now you need
> > > > > > > > > mode.exlude(..)
> > > > > > > > > instead of
> > > > > > > > > model.remove(..).
> > > > > > > > >
> > > > > > > > > Regards,
> > > > > > > > > Michael
> > > > > > > > >
> > > > > > > > > [1]
> > > > > > > > >
> > > > > > > > > http://tapestry.apache.org/tapestry5/tapestry-core/upgrade.html
> > > > > > > > >
> > > > > > > > > János Jarecsni schrieb:
> > > > > > > > >
> > > > > > > > >  Hi,
> > > > > > > > >
> > > > > > > > >  I have upgraded from 5.0.10 to 5.0.11 and a .TML which
> > > > > > > > > > worked
> > > > > > > > > > before
> > > > > > > > > > now
> > > > > > > > > > throws this:
> > > > > > > > > >
> > > > > > > > > > An unexpected application exception has occurred.
> > > > > > > > > >
> > > > > > > > > > Render queue error in
> > > > > > > > > > SetupRender[AddCelebrity:celebrity.editor]:
> > > > > > > > > > Exception
> > > > > > > > > > instantiating instance of
> > > > > > > > > > com.packtpub.celebrities.model.Celebrity
> > > > > > > > > > (for
> > > > > > > > > > component 'AddCelebrity:celebrity.editor'): Error
> > > > > > > > > > invoking
> > > > > > > > > > constructor
> > > > > > > > > > com.packtpub.celebrities.model.Celebrity(String, String,
> > > > > > > > > > Date,
> > > > > > > > > > Occupation)
> > > > > > > > > > (at Celebrity.java:18) (for service 'BeanModelSource'):
> > > > > > > > > > No
> > > > > > > > > > service
> > > > > > > > > > implements the interface java.util.Date.
> > > > > > > > > >
> > > > > > > > > > The .TML code:
> > > > > > > > > >
> > > > > > > > > > <html xmlns:t="
> > > > > > > > > > http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> > > > > > > > > >  <head>
> > > > > > > > > >     <title>Celebrity Collector: Adding New
> > > > > > > > > > Celebrity</title>
> > > > > > > > > >     <link rel="stylesheet" href="${styles}"
> > > > > > > > > > type="text/css"/>
> > > > > > > > > >  </head>
> > > > > > > > > >  <body>
> > > > > > > > > >     <h1>Adding New Celebrity</h1>
> > > > > > > > > >
> > > > > > > > > >     <t:beaneditform t:id="celebrity"
> > > > > > > > > > t:submitLabel="Save"
> > > > > > > > > >         remove="id"
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > reorder="firstName,lastName,dateOfBirth,birthDateVerified,occupation,biography">
> > > > > > > > > >         <t:parameter name="biography">
> > > > > > > > > >         <table cellpadding="0" cellspacing="0"><tr>
> > > > > > > > > >             <td><t:t5components.editor t:id="biography"
> > > > > > > > > > t:value="celebrity.biography"
> > > > > > > > > >                 t:toolbarSet="Medium" t:width="350"
> > > > > > > > > > t:height="200"/></td></tr>
> > > > > > > > > >         </table>
> > > > > > > > > >           </t:parameter>
> > > > > > > > > >     </t:beaneditform>
> > > > > > > > > >  </body>
> > > > > > > > > > </html>
> > > > > > > > > > and the model class (Celebrity):
> > > > > > > > > >
> > > > > > > > > > package com.packtpub.celebrities.model;
> > > > > > > > > >
> > > > > > > > > > import java.util.Date;
> > > > > > > > > >
> > > > > > > > > > public class Celebrity {
> > > > > > > > > >  private Date dateOfBirth;
> > > > > > > > > >  // some fields omitted
> > > > > > > > > >
> > > > > > > > > >  public Celebrity() {
> > > > > > > > > >  }
> > > > > > > > > >
> > > > > > > > > >  public Celebrity(String firstName, String lastName,
> > > > > > > > > >                 Date dateOfBirth, Occupation occupation)
> > > > > > > > > > {
> > > > > > > > > >     this.firstName = firstName;
> > > > > > > > > >     this.lastName = lastName;
> > > > > > > > > >     this.dateOfBirth = dateOfBirth;
> > > > > > > > > >     this.occupation = occupation;
> > > > > > > > > >  }
> > > > > > > > > >
> > > > > > > > > >  public Date getDateOfBirth() {
> > > > > > > > > >     return dateOfBirth;
> > > > > > > > > >  }
> > > > > > > > > >
> > > > > > > > > >  public void setDateOfBirth(Date dateOfBirth) {
> > > > > > > > > >     this.dateOfBirth = dateOfBirth;
> > > > > > > > > >  }
> > > > > > > > > >  // more methods follow
> > > > > > > > > > }
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Can you tell me what am I doing wrong?
> > > > > > > > > > thx
> > > > > > > > > > janos
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ---------------------------------------------------------------------
> > > > > > > > > >
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > users-unsubscribe@tapestry.apache.org
> > > > > > > > > For additional commands, e-mail:
> > > > > > > > > users-help@tapestry.apache.org
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ---------------------------------------------------------------------
> > > > > > > > >
> > > > > > > > To unsubscribe, e-mail:
> > > > > > users-unsubscribe@tapestry.apache.org
> > > > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > > > >
> > > > > >
> > > > > >
> > > > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: problem with example .TML

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hmm, looks like this was added in 5.0.12 which hasn't been released yet. 
Sorry about that.

Not quite sure how to solve your problem, then.

-Filip

On 2008-04-22 15:43, János Jarecsni wrote:
> The compiler is not so much interesting, Tapestry is 5.0.11 :)
> 
> On 22/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>> Hi Filip,
>>
>> the compiler (Netbeans 6) complains about @Inject that "annotation type
>> not available for this kind of declaration".
>>
>> cheers,
>> janos
>>
>> On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
>>> Hi János,
>>>
>>> Sure can:
>>>
>>> public class MyClass {
>>>  ...
>>>
>>>  @Inject
>>>  public MyClass() {
>>>  }
>>>
>>>  public MyClass(Date date) {
>>>    ...
>>>  }
>>>
>>>  ...
>>> }
>>>
>>> Something like that.
>>>
>>> -Filip
>>>
>>> János Jarecsni skrev:
>>>
>>>> hi Filip,
>>>> and how to do that? could you include (inject :P) an example for that?
>>>> thx!
>>>> Janos
>>>>
>>>> On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> You can also put an @Inject annotation on the constructor you want
>>>>> Tapestry to use when auto-instantiating your class. This way you can
>>>>> have
>>>>> multiple constructors.
>>>>>
>>>>> -Filip
>>>>>
>>>>> János Jarecsni skrev:
>>>>>
>>>>>  Hi Michael,
>>>>>> I googled for this problem and found a response to a similar
>>>>>> problem
>>>>>> from
>>>>>> you. I followed the instructions there, and succeeded. (I had to
>>>>>> remove
>>>>>> the
>>>>>> constructor which takes arguments! from the Celebrity class -
>>>>>> until
>>>>>> there
>>>>>> was this ctr besides the no-arg, it still tried to use it, no
>>>>>> matter
>>>>>> what
>>>>>> the model wanted to do).
>>>>>>
>>>>>> Now the beaneditor call is like this:
>>>>>>
>>>>>>       <t:beaneditform t:model="model" t:object="celebrity">
>>>>>>                   <!--
>>>>>>           <t:parameter name="biography">
>>>>>>           <table cellpadding="0" cellspacing="0"><tr>
>>>>>>               <td><t:t5components.editor t:id="biography"
>>>>>> t:value="celebrity.biography"
>>>>>>                   t:toolbarSet="Medium" t:width="350"
>>>>>> t:height="200"/></td></tr>
>>>>>>           </table>
>>>>>>             </t:parameter>
>>>>>>                       -->
>>>>>>       </t:beaneditform>
>>>>>>
>>>>>> Thx!
>>>>>> Janos
>>>>>> PS: I used this info:
>>>>>> http://www.nabble.com/T5.0.11-beanEditForm-td16536531.html
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 22/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>>>>>>
>>>>>>  Hi Michael,
>>>>>>> I had a look... but it does not make too much sense for me :)
>>>>>>> Where do
>>>>>>> I
>>>>>>> use model.remove() now? Or do you mean I should change the
>>>>>>> remove
>>>>>>> attribute
>>>>>>> in
>>>>>>>
>>>>>>>  <t:beaneditform t:id="celebrity" t:submitLabel="Save"
>>>>>>>          remove="id"....
>>>>>>>
>>>>>>> to exclude="id"? (I tried even this, but nothing changed).
>>>>>>>
>>>>>>> As far as I see this, there is some complain about no service
>>>>>>> implementing
>>>>>>> java.util.Date (whatever that should mean). It is obviously
>>>>>>> trying to
>>>>>>> instantiate a model class to use for bean editing. This worked
>>>>>>> so far,
>>>>>>> now
>>>>>>> it can't instantiate.
>>>>>>>
>>>>>>> thx!
>>>>>>> janos
>>>>>>>
>>>>>>> On 22/04/2008, Michael Gerzabek <mi...@gmx.net>
>>>>>>> wrote:
>>>>>>>
>>>>>>>  Hi Janos,
>>>>>>>> take a look at the upgrade notes. Close to the bottom the
>>>>>>>> change of
>>>>>>>> the
>>>>>>>> BeanModel signature is documented. Now you need
>>>>>>>> mode.exlude(..)
>>>>>>>> instead of
>>>>>>>> model.remove(..).
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>> Michael
>>>>>>>>
>>>>>>>> [1]
>>>>>>>> http://tapestry.apache.org/tapestry5/tapestry-core/upgrade.html
>>>>>>>>
>>>>>>>> János Jarecsni schrieb:
>>>>>>>>
>>>>>>>>  Hi,
>>>>>>>>
>>>>>>>>> I have upgraded from 5.0.10 to 5.0.11 and a .TML which
>>>>>>>>> worked
>>>>>>>>> before
>>>>>>>>> now
>>>>>>>>> throws this:
>>>>>>>>>
>>>>>>>>> An unexpected application exception has occurred.
>>>>>>>>>
>>>>>>>>> Render queue error in
>>>>>>>>> SetupRender[AddCelebrity:celebrity.editor]:
>>>>>>>>> Exception
>>>>>>>>> instantiating instance of
>>>>>>>>> com.packtpub.celebrities.model.Celebrity
>>>>>>>>> (for
>>>>>>>>> component 'AddCelebrity:celebrity.editor'): Error invoking
>>>>>>>>> constructor
>>>>>>>>> com.packtpub.celebrities.model.Celebrity(String, String,
>>>>>>>>> Date,
>>>>>>>>> Occupation)
>>>>>>>>> (at Celebrity.java:18) (for service 'BeanModelSource'): No
>>>>>>>>> service
>>>>>>>>> implements the interface java.util.Date.
>>>>>>>>>
>>>>>>>>> The .TML code:
>>>>>>>>>
>>>>>>>>> <html xmlns:t="
>>>>>>>>> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>>>>>>>>>  <head>
>>>>>>>>>      <title>Celebrity Collector: Adding New
>>>>>>>>> Celebrity</title>
>>>>>>>>>      <link rel="stylesheet" href="${styles}"
>>>>>>>>> type="text/css"/>
>>>>>>>>>  </head>
>>>>>>>>>  <body>
>>>>>>>>>      <h1>Adding New Celebrity</h1>
>>>>>>>>>
>>>>>>>>>      <t:beaneditform t:id="celebrity" t:submitLabel="Save"
>>>>>>>>>          remove="id"
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> reorder="firstName,lastName,dateOfBirth,birthDateVerified,occupation,biography">
>>>>>>>>>          <t:parameter name="biography">
>>>>>>>>>          <table cellpadding="0" cellspacing="0"><tr>
>>>>>>>>>              <td><t:t5components.editor t:id="biography"
>>>>>>>>> t:value="celebrity.biography"
>>>>>>>>>                  t:toolbarSet="Medium" t:width="350"
>>>>>>>>> t:height="200"/></td></tr>
>>>>>>>>>          </table>
>>>>>>>>>            </t:parameter>
>>>>>>>>>      </t:beaneditform>
>>>>>>>>>  </body>
>>>>>>>>> </html>
>>>>>>>>> and the model class (Celebrity):
>>>>>>>>>
>>>>>>>>> package com.packtpub.celebrities.model;
>>>>>>>>>
>>>>>>>>> import java.util.Date;
>>>>>>>>>
>>>>>>>>> public class Celebrity {
>>>>>>>>>  private Date dateOfBirth;
>>>>>>>>>  // some fields omitted
>>>>>>>>>
>>>>>>>>>  public Celebrity() {
>>>>>>>>>  }
>>>>>>>>>
>>>>>>>>>  public Celebrity(String firstName, String lastName,
>>>>>>>>>                  Date dateOfBirth, Occupation occupation) {
>>>>>>>>>      this.firstName = firstName;
>>>>>>>>>      this.lastName = lastName;
>>>>>>>>>      this.dateOfBirth = dateOfBirth;
>>>>>>>>>      this.occupation = occupation;
>>>>>>>>>  }
>>>>>>>>>
>>>>>>>>>  public Date getDateOfBirth() {
>>>>>>>>>      return dateOfBirth;
>>>>>>>>>  }
>>>>>>>>>
>>>>>>>>>  public void setDateOfBirth(Date dateOfBirth) {
>>>>>>>>>      this.dateOfBirth = dateOfBirth;
>>>>>>>>>  }
>>>>>>>>>  // more methods follow
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Can you tell me what am I doing wrong?
>>>>>>>>> thx
>>>>>>>>> janos
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail:
>>>>>>>> users-help@tapestry.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>

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


Re: problem with example .TML

Posted by János Jarecsni <ja...@gmail.com>.
The compiler is not so much interesting, Tapestry is 5.0.11 :)

On 22/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>
> Hi Filip,
>
> the compiler (Netbeans 6) complains about @Inject that "annotation type
> not available for this kind of declaration".
>
> cheers,
> janos
>
> On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
> >
> > Hi János,
> >
> > Sure can:
> >
> > public class MyClass {
> >  ...
> >
> >  @Inject
> >  public MyClass() {
> >  }
> >
> >  public MyClass(Date date) {
> >    ...
> >  }
> >
> >  ...
> > }
> >
> > Something like that.
> >
> > -Filip
> >
> > János Jarecsni skrev:
> >
> > > hi Filip,
> > > and how to do that? could you include (inject :P) an example for that?
> > > thx!
> > > Janos
> > >
> > > On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > You can also put an @Inject annotation on the constructor you want
> > > > Tapestry to use when auto-instantiating your class. This way you can
> > > > have
> > > > multiple constructors.
> > > >
> > > > -Filip
> > > >
> > > > János Jarecsni skrev:
> > > >
> > > >  Hi Michael,
> > > > >
> > > > > I googled for this problem and found a response to a similar
> > > > > problem
> > > > > from
> > > > > you. I followed the instructions there, and succeeded. (I had to
> > > > > remove
> > > > > the
> > > > > constructor which takes arguments! from the Celebrity class -
> > > > > until
> > > > > there
> > > > > was this ctr besides the no-arg, it still tried to use it, no
> > > > > matter
> > > > > what
> > > > > the model wanted to do).
> > > > >
> > > > > Now the beaneditor call is like this:
> > > > >
> > > > >       <t:beaneditform t:model="model" t:object="celebrity">
> > > > >                   <!--
> > > > >           <t:parameter name="biography">
> > > > >           <table cellpadding="0" cellspacing="0"><tr>
> > > > >               <td><t:t5components.editor t:id="biography"
> > > > > t:value="celebrity.biography"
> > > > >                   t:toolbarSet="Medium" t:width="350"
> > > > > t:height="200"/></td></tr>
> > > > >           </table>
> > > > >             </t:parameter>
> > > > >                       -->
> > > > >       </t:beaneditform>
> > > > >
> > > > > Thx!
> > > > > Janos
> > > > > PS: I used this info:
> > > > > http://www.nabble.com/T5.0.11-beanEditForm-td16536531.html
> > > > >
> > > > >
> > > > >
> > > > > On 22/04/2008, János Jarecsni <ja...@gmail.com> wrote:
> > > > >
> > > > >  Hi Michael,
> > > > > >
> > > > > > I had a look... but it does not make too much sense for me :)
> > > > > > Where do
> > > > > > I
> > > > > > use model.remove() now? Or do you mean I should change the
> > > > > > remove
> > > > > > attribute
> > > > > > in
> > > > > >
> > > > > >  <t:beaneditform t:id="celebrity" t:submitLabel="Save"
> > > > > >          remove="id"....
> > > > > >
> > > > > > to exclude="id"? (I tried even this, but nothing changed).
> > > > > >
> > > > > > As far as I see this, there is some complain about no service
> > > > > > implementing
> > > > > > java.util.Date (whatever that should mean). It is obviously
> > > > > > trying to
> > > > > > instantiate a model class to use for bean editing. This worked
> > > > > > so far,
> > > > > > now
> > > > > > it can't instantiate.
> > > > > >
> > > > > > thx!
> > > > > > janos
> > > > > >
> > > > > > On 22/04/2008, Michael Gerzabek <mi...@gmx.net>
> > > > > > wrote:
> > > > > >
> > > > > >  Hi Janos,
> > > > > > >
> > > > > > > take a look at the upgrade notes. Close to the bottom the
> > > > > > > change of
> > > > > > > the
> > > > > > > BeanModel signature is documented. Now you need
> > > > > > > mode.exlude(..)
> > > > > > > instead of
> > > > > > > model.remove(..).
> > > > > > >
> > > > > > > Regards,
> > > > > > > Michael
> > > > > > >
> > > > > > > [1]
> > > > > > > http://tapestry.apache.org/tapestry5/tapestry-core/upgrade.html
> > > > > > >
> > > > > > > János Jarecsni schrieb:
> > > > > > >
> > > > > > >  Hi,
> > > > > > >
> > > > > > > > I have upgraded from 5.0.10 to 5.0.11 and a .TML which
> > > > > > > > worked
> > > > > > > > before
> > > > > > > > now
> > > > > > > > throws this:
> > > > > > > >
> > > > > > > > An unexpected application exception has occurred.
> > > > > > > >
> > > > > > > > Render queue error in
> > > > > > > > SetupRender[AddCelebrity:celebrity.editor]:
> > > > > > > > Exception
> > > > > > > > instantiating instance of
> > > > > > > > com.packtpub.celebrities.model.Celebrity
> > > > > > > > (for
> > > > > > > > component 'AddCelebrity:celebrity.editor'): Error invoking
> > > > > > > > constructor
> > > > > > > > com.packtpub.celebrities.model.Celebrity(String, String,
> > > > > > > > Date,
> > > > > > > > Occupation)
> > > > > > > > (at Celebrity.java:18) (for service 'BeanModelSource'): No
> > > > > > > > service
> > > > > > > > implements the interface java.util.Date.
> > > > > > > >
> > > > > > > > The .TML code:
> > > > > > > >
> > > > > > > > <html xmlns:t="
> > > > > > > > http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> > > > > > > >  <head>
> > > > > > > >      <title>Celebrity Collector: Adding New
> > > > > > > > Celebrity</title>
> > > > > > > >      <link rel="stylesheet" href="${styles}"
> > > > > > > > type="text/css"/>
> > > > > > > >  </head>
> > > > > > > >  <body>
> > > > > > > >      <h1>Adding New Celebrity</h1>
> > > > > > > >
> > > > > > > >      <t:beaneditform t:id="celebrity" t:submitLabel="Save"
> > > > > > > >          remove="id"
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > reorder="firstName,lastName,dateOfBirth,birthDateVerified,occupation,biography">
> > > > > > > >          <t:parameter name="biography">
> > > > > > > >          <table cellpadding="0" cellspacing="0"><tr>
> > > > > > > >              <td><t:t5components.editor t:id="biography"
> > > > > > > > t:value="celebrity.biography"
> > > > > > > >                  t:toolbarSet="Medium" t:width="350"
> > > > > > > > t:height="200"/></td></tr>
> > > > > > > >          </table>
> > > > > > > >            </t:parameter>
> > > > > > > >      </t:beaneditform>
> > > > > > > >  </body>
> > > > > > > > </html>
> > > > > > > > and the model class (Celebrity):
> > > > > > > >
> > > > > > > > package com.packtpub.celebrities.model;
> > > > > > > >
> > > > > > > > import java.util.Date;
> > > > > > > >
> > > > > > > > public class Celebrity {
> > > > > > > >  private Date dateOfBirth;
> > > > > > > >  // some fields omitted
> > > > > > > >
> > > > > > > >  public Celebrity() {
> > > > > > > >  }
> > > > > > > >
> > > > > > > >  public Celebrity(String firstName, String lastName,
> > > > > > > >                  Date dateOfBirth, Occupation occupation) {
> > > > > > > >      this.firstName = firstName;
> > > > > > > >      this.lastName = lastName;
> > > > > > > >      this.dateOfBirth = dateOfBirth;
> > > > > > > >      this.occupation = occupation;
> > > > > > > >  }
> > > > > > > >
> > > > > > > >  public Date getDateOfBirth() {
> > > > > > > >      return dateOfBirth;
> > > > > > > >  }
> > > > > > > >
> > > > > > > >  public void setDateOfBirth(Date dateOfBirth) {
> > > > > > > >      this.dateOfBirth = dateOfBirth;
> > > > > > > >  }
> > > > > > > >  // more methods follow
> > > > > > > > }
> > > > > > > >
> > > > > > > >
> > > > > > > > Can you tell me what am I doing wrong?
> > > > > > > > thx
> > > > > > > > janos
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > > > > For additional commands, e-mail:
> > > > > > > users-help@tapestry.apache.org
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > >
> > > >
> > > >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: problem with example .TML

Posted by János Jarecsni <ja...@gmail.com>.
Hi Filip,

the compiler (Netbeans 6) complains about @Inject that "annotation type not
available for this kind of declaration".

cheers,
janos

On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
>
> Hi János,
>
> Sure can:
>
> public class MyClass {
>  ...
>
>  @Inject
>  public MyClass() {
>  }
>
>  public MyClass(Date date) {
>    ...
>  }
>
>  ...
> }
>
> Something like that.
>
> -Filip
>
> János Jarecsni skrev:
>
> > hi Filip,
> > and how to do that? could you include (inject :P) an example for that?
> > thx!
> > Janos
> >
> > On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
> >
> > > Hi,
> > >
> > > You can also put an @Inject annotation on the constructor you want
> > > Tapestry to use when auto-instantiating your class. This way you can
> > > have
> > > multiple constructors.
> > >
> > > -Filip
> > >
> > > János Jarecsni skrev:
> > >
> > >  Hi Michael,
> > > >
> > > > I googled for this problem and found a response to a similar problem
> > > > from
> > > > you. I followed the instructions there, and succeeded. (I had to
> > > > remove
> > > > the
> > > > constructor which takes arguments! from the Celebrity class - until
> > > > there
> > > > was this ctr besides the no-arg, it still tried to use it, no matter
> > > > what
> > > > the model wanted to do).
> > > >
> > > > Now the beaneditor call is like this:
> > > >
> > > >       <t:beaneditform t:model="model" t:object="celebrity">
> > > >                   <!--
> > > >           <t:parameter name="biography">
> > > >           <table cellpadding="0" cellspacing="0"><tr>
> > > >               <td><t:t5components.editor t:id="biography"
> > > > t:value="celebrity.biography"
> > > >                   t:toolbarSet="Medium" t:width="350"
> > > > t:height="200"/></td></tr>
> > > >           </table>
> > > >             </t:parameter>
> > > >                       -->
> > > >       </t:beaneditform>
> > > >
> > > > Thx!
> > > > Janos
> > > > PS: I used this info:
> > > > http://www.nabble.com/T5.0.11-beanEditForm-td16536531.html
> > > >
> > > >
> > > >
> > > > On 22/04/2008, János Jarecsni <ja...@gmail.com> wrote:
> > > >
> > > >  Hi Michael,
> > > > >
> > > > > I had a look... but it does not make too much sense for me :)
> > > > > Where do
> > > > > I
> > > > > use model.remove() now? Or do you mean I should change the remove
> > > > > attribute
> > > > > in
> > > > >
> > > > >  <t:beaneditform t:id="celebrity" t:submitLabel="Save"
> > > > >          remove="id"....
> > > > >
> > > > > to exclude="id"? (I tried even this, but nothing changed).
> > > > >
> > > > > As far as I see this, there is some complain about no service
> > > > > implementing
> > > > > java.util.Date (whatever that should mean). It is obviously trying
> > > > > to
> > > > > instantiate a model class to use for bean editing. This worked so
> > > > > far,
> > > > > now
> > > > > it can't instantiate.
> > > > >
> > > > > thx!
> > > > > janos
> > > > >
> > > > > On 22/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
> > > > >
> > > > >  Hi Janos,
> > > > > >
> > > > > > take a look at the upgrade notes. Close to the bottom the change
> > > > > > of
> > > > > > the
> > > > > > BeanModel signature is documented. Now you need mode.exlude(..)
> > > > > > instead of
> > > > > > model.remove(..).
> > > > > >
> > > > > > Regards,
> > > > > > Michael
> > > > > >
> > > > > > [1]
> > > > > > http://tapestry.apache.org/tapestry5/tapestry-core/upgrade.html
> > > > > >
> > > > > > János Jarecsni schrieb:
> > > > > >
> > > > > >  Hi,
> > > > > >
> > > > > > > I have upgraded from 5.0.10 to 5.0.11 and a .TML which worked
> > > > > > > before
> > > > > > > now
> > > > > > > throws this:
> > > > > > >
> > > > > > > An unexpected application exception has occurred.
> > > > > > >
> > > > > > > Render queue error in
> > > > > > > SetupRender[AddCelebrity:celebrity.editor]:
> > > > > > > Exception
> > > > > > > instantiating instance of
> > > > > > > com.packtpub.celebrities.model.Celebrity
> > > > > > > (for
> > > > > > > component 'AddCelebrity:celebrity.editor'): Error invoking
> > > > > > > constructor
> > > > > > > com.packtpub.celebrities.model.Celebrity(String, String, Date,
> > > > > > > Occupation)
> > > > > > > (at Celebrity.java:18) (for service 'BeanModelSource'): No
> > > > > > > service
> > > > > > > implements the interface java.util.Date.
> > > > > > >
> > > > > > > The .TML code:
> > > > > > >
> > > > > > > <html xmlns:t="
> > > > > > > http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> > > > > > >  <head>
> > > > > > >      <title>Celebrity Collector: Adding New Celebrity</title>
> > > > > > >      <link rel="stylesheet" href="${styles}" type="text/css"/>
> > > > > > >  </head>
> > > > > > >  <body>
> > > > > > >      <h1>Adding New Celebrity</h1>
> > > > > > >
> > > > > > >      <t:beaneditform t:id="celebrity" t:submitLabel="Save"
> > > > > > >          remove="id"
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > reorder="firstName,lastName,dateOfBirth,birthDateVerified,occupation,biography">
> > > > > > >          <t:parameter name="biography">
> > > > > > >          <table cellpadding="0" cellspacing="0"><tr>
> > > > > > >              <td><t:t5components.editor t:id="biography"
> > > > > > > t:value="celebrity.biography"
> > > > > > >                  t:toolbarSet="Medium" t:width="350"
> > > > > > > t:height="200"/></td></tr>
> > > > > > >          </table>
> > > > > > >            </t:parameter>
> > > > > > >      </t:beaneditform>
> > > > > > >  </body>
> > > > > > > </html>
> > > > > > > and the model class (Celebrity):
> > > > > > >
> > > > > > > package com.packtpub.celebrities.model;
> > > > > > >
> > > > > > > import java.util.Date;
> > > > > > >
> > > > > > > public class Celebrity {
> > > > > > >  private Date dateOfBirth;
> > > > > > >  // some fields omitted
> > > > > > >
> > > > > > >  public Celebrity() {
> > > > > > >  }
> > > > > > >
> > > > > > >  public Celebrity(String firstName, String lastName,
> > > > > > >                  Date dateOfBirth, Occupation occupation) {
> > > > > > >      this.firstName = firstName;
> > > > > > >      this.lastName = lastName;
> > > > > > >      this.dateOfBirth = dateOfBirth;
> > > > > > >      this.occupation = occupation;
> > > > > > >  }
> > > > > > >
> > > > > > >  public Date getDateOfBirth() {
> > > > > > >      return dateOfBirth;
> > > > > > >  }
> > > > > > >
> > > > > > >  public void setDateOfBirth(Date dateOfBirth) {
> > > > > > >      this.dateOfBirth = dateOfBirth;
> > > > > > >  }
> > > > > > >  // more methods follow
> > > > > > > }
> > > > > > >
> > > > > > >
> > > > > > > Can you tell me what am I doing wrong?
> > > > > > > thx
> > > > > > > janos
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > > > >
> > > > > >
> > > > > >
> > > > > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> > >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: problem with example .TML

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi János,

Sure can:

public class MyClass {
   ...

   @Inject
   public MyClass() {
   }

   public MyClass(Date date) {
     ...
   }

   ...
}

Something like that.

-Filip

János Jarecsni skrev:
> hi Filip,
> and how to do that? could you include (inject :P) an example for that?
> thx!
> Janos
> 
> On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
>> Hi,
>>
>> You can also put an @Inject annotation on the constructor you want
>> Tapestry to use when auto-instantiating your class. This way you can have
>> multiple constructors.
>>
>> -Filip
>>
>> János Jarecsni skrev:
>>
>>> Hi Michael,
>>>
>>> I googled for this problem and found a response to a similar problem
>>> from
>>> you. I followed the instructions there, and succeeded. (I had to remove
>>> the
>>> constructor which takes arguments! from the Celebrity class - until
>>> there
>>> was this ctr besides the no-arg, it still tried to use it, no matter
>>> what
>>> the model wanted to do).
>>>
>>> Now the beaneditor call is like this:
>>>
>>>        <t:beaneditform t:model="model" t:object="celebrity">
>>>                    <!--
>>>            <t:parameter name="biography">
>>>            <table cellpadding="0" cellspacing="0"><tr>
>>>                <td><t:t5components.editor t:id="biography"
>>> t:value="celebrity.biography"
>>>                    t:toolbarSet="Medium" t:width="350"
>>> t:height="200"/></td></tr>
>>>            </table>
>>>              </t:parameter>
>>>                        -->
>>>        </t:beaneditform>
>>>
>>> Thx!
>>> Janos
>>> PS: I used this info:
>>> http://www.nabble.com/T5.0.11-beanEditForm-td16536531.html
>>>
>>>
>>>
>>> On 22/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>>>
>>>> Hi Michael,
>>>>
>>>> I had a look... but it does not make too much sense for me :) Where do
>>>> I
>>>> use model.remove() now? Or do you mean I should change the remove
>>>> attribute
>>>> in
>>>>
>>>>  <t:beaneditform t:id="celebrity" t:submitLabel="Save"
>>>>           remove="id"....
>>>>
>>>> to exclude="id"? (I tried even this, but nothing changed).
>>>>
>>>> As far as I see this, there is some complain about no service
>>>> implementing
>>>> java.util.Date (whatever that should mean). It is obviously trying to
>>>> instantiate a model class to use for bean editing. This worked so far,
>>>> now
>>>> it can't instantiate.
>>>>
>>>> thx!
>>>> janos
>>>>
>>>> On 22/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
>>>>
>>>>> Hi Janos,
>>>>>
>>>>> take a look at the upgrade notes. Close to the bottom the change of
>>>>> the
>>>>> BeanModel signature is documented. Now you need mode.exlude(..)
>>>>> instead of
>>>>> model.remove(..).
>>>>>
>>>>> Regards,
>>>>> Michael
>>>>>
>>>>> [1] http://tapestry.apache.org/tapestry5/tapestry-core/upgrade.html
>>>>>
>>>>> János Jarecsni schrieb:
>>>>>
>>>>>  Hi,
>>>>>> I have upgraded from 5.0.10 to 5.0.11 and a .TML which worked
>>>>>> before
>>>>>> now
>>>>>> throws this:
>>>>>>
>>>>>> An unexpected application exception has occurred.
>>>>>>
>>>>>> Render queue error in SetupRender[AddCelebrity:celebrity.editor]:
>>>>>> Exception
>>>>>> instantiating instance of com.packtpub.celebrities.model.Celebrity
>>>>>> (for
>>>>>> component 'AddCelebrity:celebrity.editor'): Error invoking
>>>>>> constructor
>>>>>> com.packtpub.celebrities.model.Celebrity(String, String, Date,
>>>>>> Occupation)
>>>>>> (at Celebrity.java:18) (for service 'BeanModelSource'): No service
>>>>>> implements the interface java.util.Date.
>>>>>>
>>>>>> The .TML code:
>>>>>>
>>>>>> <html xmlns:t="
>>>>>> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>>>>>>   <head>
>>>>>>       <title>Celebrity Collector: Adding New Celebrity</title>
>>>>>>       <link rel="stylesheet" href="${styles}" type="text/css"/>
>>>>>>   </head>
>>>>>>   <body>
>>>>>>       <h1>Adding New Celebrity</h1>
>>>>>>
>>>>>>       <t:beaneditform t:id="celebrity" t:submitLabel="Save"
>>>>>>           remove="id"
>>>>>>
>>>>>>
>>>>>>
>>>>>> reorder="firstName,lastName,dateOfBirth,birthDateVerified,occupation,biography">
>>>>>>           <t:parameter name="biography">
>>>>>>           <table cellpadding="0" cellspacing="0"><tr>
>>>>>>               <td><t:t5components.editor t:id="biography"
>>>>>> t:value="celebrity.biography"
>>>>>>                   t:toolbarSet="Medium" t:width="350"
>>>>>> t:height="200"/></td></tr>
>>>>>>           </table>
>>>>>>             </t:parameter>
>>>>>>       </t:beaneditform>
>>>>>>   </body>
>>>>>> </html>
>>>>>> and the model class (Celebrity):
>>>>>>
>>>>>> package com.packtpub.celebrities.model;
>>>>>>
>>>>>> import java.util.Date;
>>>>>>
>>>>>> public class Celebrity {
>>>>>>   private Date dateOfBirth;
>>>>>>   // some fields omitted
>>>>>>
>>>>>>   public Celebrity() {
>>>>>>   }
>>>>>>
>>>>>>   public Celebrity(String firstName, String lastName,
>>>>>>                   Date dateOfBirth, Occupation occupation) {
>>>>>>       this.firstName = firstName;
>>>>>>       this.lastName = lastName;
>>>>>>       this.dateOfBirth = dateOfBirth;
>>>>>>       this.occupation = occupation;
>>>>>>   }
>>>>>>
>>>>>>   public Date getDateOfBirth() {
>>>>>>       return dateOfBirth;
>>>>>>   }
>>>>>>
>>>>>>   public void setDateOfBirth(Date dateOfBirth) {
>>>>>>       this.dateOfBirth = dateOfBirth;
>>>>>>   }
>>>>>>   // more methods follow
>>>>>> }
>>>>>>
>>>>>>
>>>>>> Can you tell me what am I doing wrong?
>>>>>> thx
>>>>>> janos
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>

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


Re: problem with example .TML

Posted by János Jarecsni <ja...@gmail.com>.
hi Filip,
and how to do that? could you include (inject :P) an example for that?
thx!
Janos

On 22/04/2008, Filip S. Adamsen <fs...@fsadev.com> wrote:
>
> Hi,
>
> You can also put an @Inject annotation on the constructor you want
> Tapestry to use when auto-instantiating your class. This way you can have
> multiple constructors.
>
> -Filip
>
> János Jarecsni skrev:
>
> > Hi Michael,
> >
> > I googled for this problem and found a response to a similar problem
> > from
> > you. I followed the instructions there, and succeeded. (I had to remove
> > the
> > constructor which takes arguments! from the Celebrity class - until
> > there
> > was this ctr besides the no-arg, it still tried to use it, no matter
> > what
> > the model wanted to do).
> >
> > Now the beaneditor call is like this:
> >
> >        <t:beaneditform t:model="model" t:object="celebrity">
> >                    <!--
> >            <t:parameter name="biography">
> >            <table cellpadding="0" cellspacing="0"><tr>
> >                <td><t:t5components.editor t:id="biography"
> > t:value="celebrity.biography"
> >                    t:toolbarSet="Medium" t:width="350"
> > t:height="200"/></td></tr>
> >            </table>
> >              </t:parameter>
> >                        -->
> >        </t:beaneditform>
> >
> > Thx!
> > Janos
> > PS: I used this info:
> > http://www.nabble.com/T5.0.11-beanEditForm-td16536531.html
> >
> >
> >
> > On 22/04/2008, János Jarecsni <ja...@gmail.com> wrote:
> >
> > > Hi Michael,
> > >
> > > I had a look... but it does not make too much sense for me :) Where do
> > > I
> > > use model.remove() now? Or do you mean I should change the remove
> > > attribute
> > > in
> > >
> > >  <t:beaneditform t:id="celebrity" t:submitLabel="Save"
> > >           remove="id"....
> > >
> > > to exclude="id"? (I tried even this, but nothing changed).
> > >
> > > As far as I see this, there is some complain about no service
> > > implementing
> > > java.util.Date (whatever that should mean). It is obviously trying to
> > > instantiate a model class to use for bean editing. This worked so far,
> > > now
> > > it can't instantiate.
> > >
> > > thx!
> > > janos
> > >
> > > On 22/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
> > >
> > > > Hi Janos,
> > > >
> > > > take a look at the upgrade notes. Close to the bottom the change of
> > > > the
> > > > BeanModel signature is documented. Now you need mode.exlude(..)
> > > > instead of
> > > > model.remove(..).
> > > >
> > > > Regards,
> > > > Michael
> > > >
> > > > [1] http://tapestry.apache.org/tapestry5/tapestry-core/upgrade.html
> > > >
> > > > János Jarecsni schrieb:
> > > >
> > > >  Hi,
> > > > >
> > > > > I have upgraded from 5.0.10 to 5.0.11 and a .TML which worked
> > > > > before
> > > > > now
> > > > > throws this:
> > > > >
> > > > > An unexpected application exception has occurred.
> > > > >
> > > > > Render queue error in SetupRender[AddCelebrity:celebrity.editor]:
> > > > > Exception
> > > > > instantiating instance of com.packtpub.celebrities.model.Celebrity
> > > > > (for
> > > > > component 'AddCelebrity:celebrity.editor'): Error invoking
> > > > > constructor
> > > > > com.packtpub.celebrities.model.Celebrity(String, String, Date,
> > > > > Occupation)
> > > > > (at Celebrity.java:18) (for service 'BeanModelSource'): No service
> > > > > implements the interface java.util.Date.
> > > > >
> > > > > The .TML code:
> > > > >
> > > > > <html xmlns:t="
> > > > > http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> > > > >   <head>
> > > > >       <title>Celebrity Collector: Adding New Celebrity</title>
> > > > >       <link rel="stylesheet" href="${styles}" type="text/css"/>
> > > > >   </head>
> > > > >   <body>
> > > > >       <h1>Adding New Celebrity</h1>
> > > > >
> > > > >       <t:beaneditform t:id="celebrity" t:submitLabel="Save"
> > > > >           remove="id"
> > > > >
> > > > >
> > > > >
> > > > > reorder="firstName,lastName,dateOfBirth,birthDateVerified,occupation,biography">
> > > > >           <t:parameter name="biography">
> > > > >           <table cellpadding="0" cellspacing="0"><tr>
> > > > >               <td><t:t5components.editor t:id="biography"
> > > > > t:value="celebrity.biography"
> > > > >                   t:toolbarSet="Medium" t:width="350"
> > > > > t:height="200"/></td></tr>
> > > > >           </table>
> > > > >             </t:parameter>
> > > > >       </t:beaneditform>
> > > > >   </body>
> > > > > </html>
> > > > > and the model class (Celebrity):
> > > > >
> > > > > package com.packtpub.celebrities.model;
> > > > >
> > > > > import java.util.Date;
> > > > >
> > > > > public class Celebrity {
> > > > >   private Date dateOfBirth;
> > > > >   // some fields omitted
> > > > >
> > > > >   public Celebrity() {
> > > > >   }
> > > > >
> > > > >   public Celebrity(String firstName, String lastName,
> > > > >                   Date dateOfBirth, Occupation occupation) {
> > > > >       this.firstName = firstName;
> > > > >       this.lastName = lastName;
> > > > >       this.dateOfBirth = dateOfBirth;
> > > > >       this.occupation = occupation;
> > > > >   }
> > > > >
> > > > >   public Date getDateOfBirth() {
> > > > >       return dateOfBirth;
> > > > >   }
> > > > >
> > > > >   public void setDateOfBirth(Date dateOfBirth) {
> > > > >       this.dateOfBirth = dateOfBirth;
> > > > >   }
> > > > >   // more methods follow
> > > > > }
> > > > >
> > > > >
> > > > > Can you tell me what am I doing wrong?
> > > > > thx
> > > > > janos
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: problem with example .TML

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi,

You can also put an @Inject annotation on the constructor you want 
Tapestry to use when auto-instantiating your class. This way you can 
have multiple constructors.

-Filip

János Jarecsni skrev:
> Hi Michael,
> 
> I googled for this problem and found a response to a similar problem from
> you. I followed the instructions there, and succeeded. (I had to remove the
> constructor which takes arguments! from the Celebrity class - until there
> was this ctr besides the no-arg, it still tried to use it, no matter what
> the model wanted to do).
> 
> Now the beaneditor call is like this:
> 
>         <t:beaneditform t:model="model" t:object="celebrity">
>                     <!--
>             <t:parameter name="biography">
>             <table cellpadding="0" cellspacing="0"><tr>
>                 <td><t:t5components.editor t:id="biography"
> t:value="celebrity.biography"
>                     t:toolbarSet="Medium" t:width="350"
> t:height="200"/></td></tr>
>             </table>
>               </t:parameter>
>                         -->
>         </t:beaneditform>
> 
> Thx!
> Janos
> PS: I used this info:
> http://www.nabble.com/T5.0.11-beanEditForm-td16536531.html
> 
> 
> 
> On 22/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>> Hi Michael,
>>
>> I had a look... but it does not make too much sense for me :) Where do I
>> use model.remove() now? Or do you mean I should change the remove attribute
>> in
>>
>>  <t:beaneditform t:id="celebrity" t:submitLabel="Save"
>>            remove="id"....
>>
>> to exclude="id"? (I tried even this, but nothing changed).
>>
>> As far as I see this, there is some complain about no service implementing
>> java.util.Date (whatever that should mean). It is obviously trying to
>> instantiate a model class to use for bean editing. This worked so far, now
>> it can't instantiate.
>>
>> thx!
>> janos
>>
>> On 22/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
>>> Hi Janos,
>>>
>>> take a look at the upgrade notes. Close to the bottom the change of the
>>> BeanModel signature is documented. Now you need mode.exlude(..) instead of
>>> model.remove(..).
>>>
>>> Regards,
>>> Michael
>>>
>>> [1] http://tapestry.apache.org/tapestry5/tapestry-core/upgrade.html
>>>
>>> János Jarecsni schrieb:
>>>
>>>> Hi,
>>>>
>>>> I have upgraded from 5.0.10 to 5.0.11 and a .TML which worked before
>>>> now
>>>> throws this:
>>>>
>>>> An unexpected application exception has occurred.
>>>>
>>>> Render queue error in SetupRender[AddCelebrity:celebrity.editor]:
>>>> Exception
>>>> instantiating instance of com.packtpub.celebrities.model.Celebrity
>>>> (for
>>>> component 'AddCelebrity:celebrity.editor'): Error invoking constructor
>>>> com.packtpub.celebrities.model.Celebrity(String, String, Date,
>>>> Occupation)
>>>> (at Celebrity.java:18) (for service 'BeanModelSource'): No service
>>>> implements the interface java.util.Date.
>>>>
>>>> The .TML code:
>>>>
>>>> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>>>>    <head>
>>>>        <title>Celebrity Collector: Adding New Celebrity</title>
>>>>        <link rel="stylesheet" href="${styles}" type="text/css"/>
>>>>    </head>
>>>>    <body>
>>>>        <h1>Adding New Celebrity</h1>
>>>>
>>>>        <t:beaneditform t:id="celebrity" t:submitLabel="Save"
>>>>            remove="id"
>>>>
>>>>
>>>> reorder="firstName,lastName,dateOfBirth,birthDateVerified,occupation,biography">
>>>>            <t:parameter name="biography">
>>>>            <table cellpadding="0" cellspacing="0"><tr>
>>>>                <td><t:t5components.editor t:id="biography"
>>>> t:value="celebrity.biography"
>>>>                    t:toolbarSet="Medium" t:width="350"
>>>> t:height="200"/></td></tr>
>>>>            </table>
>>>>              </t:parameter>
>>>>        </t:beaneditform>
>>>>    </body>
>>>> </html>
>>>> and the model class (Celebrity):
>>>>
>>>> package com.packtpub.celebrities.model;
>>>>
>>>> import java.util.Date;
>>>>
>>>> public class Celebrity {
>>>>    private Date dateOfBirth;
>>>>    // some fields omitted
>>>>
>>>>    public Celebrity() {
>>>>    }
>>>>
>>>>    public Celebrity(String firstName, String lastName,
>>>>                    Date dateOfBirth, Occupation occupation) {
>>>>        this.firstName = firstName;
>>>>        this.lastName = lastName;
>>>>        this.dateOfBirth = dateOfBirth;
>>>>        this.occupation = occupation;
>>>>    }
>>>>
>>>>    public Date getDateOfBirth() {
>>>>        return dateOfBirth;
>>>>    }
>>>>
>>>>    public void setDateOfBirth(Date dateOfBirth) {
>>>>        this.dateOfBirth = dateOfBirth;
>>>>    }
>>>>    // more methods follow
>>>> }
>>>>
>>>>
>>>> Can you tell me what am I doing wrong?
>>>> thx
>>>> janos
>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>

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


Re: problem with example .TML

Posted by János Jarecsni <ja...@gmail.com>.
Hi Michael,

I googled for this problem and found a response to a similar problem from
you. I followed the instructions there, and succeeded. (I had to remove the
constructor which takes arguments! from the Celebrity class - until there
was this ctr besides the no-arg, it still tried to use it, no matter what
the model wanted to do).

Now the beaneditor call is like this:

        <t:beaneditform t:model="model" t:object="celebrity">
                    <!--
            <t:parameter name="biography">
            <table cellpadding="0" cellspacing="0"><tr>
                <td><t:t5components.editor t:id="biography"
t:value="celebrity.biography"
                    t:toolbarSet="Medium" t:width="350"
t:height="200"/></td></tr>
            </table>
              </t:parameter>
                        -->
        </t:beaneditform>

Thx!
Janos
PS: I used this info:
http://www.nabble.com/T5.0.11-beanEditForm-td16536531.html



On 22/04/2008, János Jarecsni <ja...@gmail.com> wrote:
>
> Hi Michael,
>
> I had a look... but it does not make too much sense for me :) Where do I
> use model.remove() now? Or do you mean I should change the remove attribute
> in
>
>  <t:beaneditform t:id="celebrity" t:submitLabel="Save"
>            remove="id"....
>
> to exclude="id"? (I tried even this, but nothing changed).
>
> As far as I see this, there is some complain about no service implementing
> java.util.Date (whatever that should mean). It is obviously trying to
> instantiate a model class to use for bean editing. This worked so far, now
> it can't instantiate.
>
> thx!
> janos
>
> On 22/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
> >
> > Hi Janos,
> >
> > take a look at the upgrade notes. Close to the bottom the change of the
> > BeanModel signature is documented. Now you need mode.exlude(..) instead of
> > model.remove(..).
> >
> > Regards,
> > Michael
> >
> > [1] http://tapestry.apache.org/tapestry5/tapestry-core/upgrade.html
> >
> > János Jarecsni schrieb:
> >
> > > Hi,
> > >
> > > I have upgraded from 5.0.10 to 5.0.11 and a .TML which worked before
> > > now
> > > throws this:
> > >
> > > An unexpected application exception has occurred.
> > >
> > > Render queue error in SetupRender[AddCelebrity:celebrity.editor]:
> > > Exception
> > > instantiating instance of com.packtpub.celebrities.model.Celebrity
> > > (for
> > > component 'AddCelebrity:celebrity.editor'): Error invoking constructor
> > > com.packtpub.celebrities.model.Celebrity(String, String, Date,
> > > Occupation)
> > > (at Celebrity.java:18) (for service 'BeanModelSource'): No service
> > > implements the interface java.util.Date.
> > >
> > > The .TML code:
> > >
> > > <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> > >    <head>
> > >        <title>Celebrity Collector: Adding New Celebrity</title>
> > >        <link rel="stylesheet" href="${styles}" type="text/css"/>
> > >    </head>
> > >    <body>
> > >        <h1>Adding New Celebrity</h1>
> > >
> > >        <t:beaneditform t:id="celebrity" t:submitLabel="Save"
> > >            remove="id"
> > >
> > >
> > > reorder="firstName,lastName,dateOfBirth,birthDateVerified,occupation,biography">
> > >            <t:parameter name="biography">
> > >            <table cellpadding="0" cellspacing="0"><tr>
> > >                <td><t:t5components.editor t:id="biography"
> > > t:value="celebrity.biography"
> > >                    t:toolbarSet="Medium" t:width="350"
> > > t:height="200"/></td></tr>
> > >            </table>
> > >              </t:parameter>
> > >        </t:beaneditform>
> > >    </body>
> > > </html>
> > > and the model class (Celebrity):
> > >
> > > package com.packtpub.celebrities.model;
> > >
> > > import java.util.Date;
> > >
> > > public class Celebrity {
> > >    private Date dateOfBirth;
> > >    // some fields omitted
> > >
> > >    public Celebrity() {
> > >    }
> > >
> > >    public Celebrity(String firstName, String lastName,
> > >                    Date dateOfBirth, Occupation occupation) {
> > >        this.firstName = firstName;
> > >        this.lastName = lastName;
> > >        this.dateOfBirth = dateOfBirth;
> > >        this.occupation = occupation;
> > >    }
> > >
> > >    public Date getDateOfBirth() {
> > >        return dateOfBirth;
> > >    }
> > >
> > >    public void setDateOfBirth(Date dateOfBirth) {
> > >        this.dateOfBirth = dateOfBirth;
> > >    }
> > >    // more methods follow
> > > }
> > >
> > >
> > > Can you tell me what am I doing wrong?
> > > thx
> > > janos
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: problem with example .TML

Posted by János Jarecsni <ja...@gmail.com>.
Hi Michael,

I had a look... but it does not make too much sense for me :) Where do I use
model.remove() now? Or do you mean I should change the remove attribute in

 <t:beaneditform t:id="celebrity" t:submitLabel="Save"
           remove="id"....

to exclude="id"? (I tried even this, but nothing changed).

As far as I see this, there is some complain about no service implementing
java.util.Date (whatever that should mean). It is obviously trying to
instantiate a model class to use for bean editing. This worked so far, now
it can't instantiate.

thx!
janos

On 22/04/2008, Michael Gerzabek <mi...@gmx.net> wrote:
>
> Hi Janos,
>
> take a look at the upgrade notes. Close to the bottom the change of the
> BeanModel signature is documented. Now you need mode.exlude(..) instead of
> model.remove(..).
>
> Regards,
> Michael
>
> [1] http://tapestry.apache.org/tapestry5/tapestry-core/upgrade.html
>
> János Jarecsni schrieb:
>
> > Hi,
> >
> > I have upgraded from 5.0.10 to 5.0.11 and a .TML which worked before now
> > throws this:
> >
> > An unexpected application exception has occurred.
> >
> > Render queue error in SetupRender[AddCelebrity:celebrity.editor]:
> > Exception
> > instantiating instance of com.packtpub.celebrities.model.Celebrity (for
> > component 'AddCelebrity:celebrity.editor'): Error invoking constructor
> > com.packtpub.celebrities.model.Celebrity(String, String, Date,
> > Occupation)
> > (at Celebrity.java:18) (for service 'BeanModelSource'): No service
> > implements the interface java.util.Date.
> >
> > The .TML code:
> >
> > <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> >    <head>
> >        <title>Celebrity Collector: Adding New Celebrity</title>
> >        <link rel="stylesheet" href="${styles}" type="text/css"/>
> >    </head>
> >    <body>
> >        <h1>Adding New Celebrity</h1>
> >
> >        <t:beaneditform t:id="celebrity" t:submitLabel="Save"
> >            remove="id"
> >
> >
> > reorder="firstName,lastName,dateOfBirth,birthDateVerified,occupation,biography">
> >            <t:parameter name="biography">
> >            <table cellpadding="0" cellspacing="0"><tr>
> >                <td><t:t5components.editor t:id="biography"
> > t:value="celebrity.biography"
> >                    t:toolbarSet="Medium" t:width="350"
> > t:height="200"/></td></tr>
> >            </table>
> >              </t:parameter>
> >        </t:beaneditform>
> >    </body>
> > </html>
> > and the model class (Celebrity):
> >
> > package com.packtpub.celebrities.model;
> >
> > import java.util.Date;
> >
> > public class Celebrity {
> >    private Date dateOfBirth;
> >    // some fields omitted
> >
> >    public Celebrity() {
> >    }
> >
> >    public Celebrity(String firstName, String lastName,
> >                    Date dateOfBirth, Occupation occupation) {
> >        this.firstName = firstName;
> >        this.lastName = lastName;
> >        this.dateOfBirth = dateOfBirth;
> >        this.occupation = occupation;
> >    }
> >
> >    public Date getDateOfBirth() {
> >        return dateOfBirth;
> >    }
> >
> >    public void setDateOfBirth(Date dateOfBirth) {
> >        this.dateOfBirth = dateOfBirth;
> >    }
> >    // more methods follow
> > }
> >
> >
> > Can you tell me what am I doing wrong?
> > thx
> > janos
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: problem with example .TML

Posted by Michael Gerzabek <mi...@gmx.net>.
Hi Janos,

take a look at the upgrade notes. Close to the bottom the change of the 
BeanModel signature is documented. Now you need mode.exlude(..) instead 
of model.remove(..).

Regards,
Michael

[1] http://tapestry.apache.org/tapestry5/tapestry-core/upgrade.html

János Jarecsni schrieb:
> Hi,
>
> I have upgraded from 5.0.10 to 5.0.11 and a .TML which worked before now
> throws this:
>
> An unexpected application exception has occurred.
>
> Render queue error in SetupRender[AddCelebrity:celebrity.editor]: Exception
> instantiating instance of com.packtpub.celebrities.model.Celebrity (for
> component 'AddCelebrity:celebrity.editor'): Error invoking constructor
> com.packtpub.celebrities.model.Celebrity(String, String, Date, Occupation)
> (at Celebrity.java:18) (for service 'BeanModelSource'): No service
> implements the interface java.util.Date.
>
> The .TML code:
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>     <head>
>         <title>Celebrity Collector: Adding New Celebrity</title>
>         <link rel="stylesheet" href="${styles}" type="text/css"/>
>     </head>
>     <body>
>         <h1>Adding New Celebrity</h1>
>
>         <t:beaneditform t:id="celebrity" t:submitLabel="Save"
>             remove="id"
>
> reorder="firstName,lastName,dateOfBirth,birthDateVerified,occupation,biography">
>             <t:parameter name="biography">
>             <table cellpadding="0" cellspacing="0"><tr>
>                 <td><t:t5components.editor t:id="biography"
> t:value="celebrity.biography"
>                     t:toolbarSet="Medium" t:width="350"
> t:height="200"/></td></tr>
>             </table>
>               </t:parameter>
>         </t:beaneditform>
>     </body>
> </html>
> and the model class (Celebrity):
>
> package com.packtpub.celebrities.model;
>
> import java.util.Date;
>
> public class Celebrity {
>     private Date dateOfBirth;
>     // some fields omitted
>
>     public Celebrity() {
>     }
>
>     public Celebrity(String firstName, String lastName,
>                     Date dateOfBirth, Occupation occupation) {
>         this.firstName = firstName;
>         this.lastName = lastName;
>         this.dateOfBirth = dateOfBirth;
>         this.occupation = occupation;
>     }
>
>     public Date getDateOfBirth() {
>         return dateOfBirth;
>     }
>
>     public void setDateOfBirth(Date dateOfBirth) {
>         this.dateOfBirth = dateOfBirth;
>     }
>     // more methods follow
> }
>
>
> Can you tell me what am I doing wrong?
> thx
> janos
>
>   


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