Re: Whats wrong with my component?

2009-05-26 Thread Johan Compagner
doe NOT give the compound model to the FormComponents itself!
only to the parent of the form component (so the panel)

On Tue, May 26, 2009 at 10:53, HHB  wrote:

>
> Please all forgive my ignorance as this is my first component.
> My custom component is just a text area and a couple of client side
> JavaScript links.
> This component is supposed to be used inside a form and should be bound to
> text property of MessageVO
> What am I doing wrong?
>
>
> Per Lundholm wrote:
> >
> > So the TextArea gets a CompoundPropertyModel that has a MessageVO object.
> >
> > The MessageVO has a method "getLanguage" ?
> >
> > How should the TextArea display the contents of MessageVO?
> >
> > HTH
> >
> > /Per
> >
> > 2009/5/24 HHB :
> >>
> >> Ok, the TextArea has its own model so I passed the model parameter of
> the
> >>  component constructor to the TextArea:
> >>
> >> final TextArea textArea = new TextArea("text", model);
> >>
> >> And in the panel:
> >>
> >> CompoundPropertyModel formModel =
> >>new CompoundPropertyModel(new MessageVO());
> >> MessageTextArea textArea = new MessageTextArea("text", formModel);
> >>
> >> Now, the custom textarea is displaying the toString() method of
> MessageVO
> >> object and upon submitting the form, I got the exception:
> >>
> >>  Attempted to set property value on a null object. Property expression:
> >> language Value: English
> >> org.apache.wicket.WicketRuntimeException: Attempted to set property
> value
> >> on
> >> a null object. Property expression: language Value: English
> >>
> >>
> >>
> >>
> >> James Carman-3 wrote:
> >>>
> >>> Just think to yourself what models are being used here.  The TextArea
> >>> inside the MessageTextArea is bound to what?  And, the
> >>> MessageTextArea's model is bound to what?
> >>>
> >>> On Sun, May 24, 2009 at 7:32 AM, HHB  wrote:
> >>>>
> >>>> Would you please tell me in code (my code I posted earlier) what do
> you
> >>>> mean?
> >>>> I really appreciate your time and help.
> >>>>
> >>>>
> >>>> igor.vaynberg wrote:
> >>>>>
> >>>>> you do not bind the model of the textarea to the model of the
> >>>>> messagetextarea, so why are you surprised the value never makes it
> >>>>> into your model?
> >>>>>
> >>>>> -igor
> >>>>>
> >>>>> On Thu, May 21, 2009 at 4:45 AM, HHB  wrote:
> >>>>>> Hey,
> >>>>>> I'm trying to create my first component in Wicket:
> >>>>>> +
> >>>>>> public class MessageTextArea extends
> >>>>>>FormComponentPanel {
> >>>>>>
> >>>>>>private String text;
> >>>>>>
> >>>>>>public MessageTextArea(String id) {
> >>>>>>this(id, null);
> >>>>>>}
> >>>>>>
> >>>>>>public MessageTextArea(String id, IModel model) {
> >>>>>>super(id, model);
> >>>>>>setType(String.class);
> >>>>>>setOutputMarkupId(true);
> >>>>>>
> >>>>>>final PropertyModel textModel =
> >>>>>>  new PropertyModel(this, "text");
> >>>>>>final TextArea textArea =
> >>>>>>  new TextArea("text", textModel);
> >>>>>>textArea.setRequired(true);
> >>>>>>textArea.setOutputMarkupId(true);
> >>>>>>    add(textArea);
> >>>>>>}
> >>>>>>
> >>>>>> }
> >>>>>> +
> >>>>>> And to use the component:
> >>>>>> +
> >>>>>> CompoundPropertyModel formModel =
> >>>>>>  new CompoundPropertyModel(new MessageVO());
> >>>>>> form.setModel(formModel);
> >>>>>> add(form);
> >>>>>> MessageTextArea textArea = new MessageTextArea("text");
> >>>>>> +++++
> >>&g

Re: Whats wrong with my component?

2009-05-26 Thread HHB

Please all forgive my ignorance as this is my first component.
My custom component is just a text area and a couple of client side
JavaScript links.
This component is supposed to be used inside a form and should be bound to
text property of MessageVO
What am I doing wrong?


Per Lundholm wrote:
> 
> So the TextArea gets a CompoundPropertyModel that has a MessageVO object.
> 
> The MessageVO has a method "getLanguage" ?
> 
> How should the TextArea display the contents of MessageVO?
> 
> HTH
> 
> /Per
> 
> 2009/5/24 HHB :
>>
>> Ok, the TextArea has its own model so I passed the model parameter of the
>>  component constructor to the TextArea:
>>
>> final TextArea textArea = new TextArea("text", model);
>>
>> And in the panel:
>>
>> CompoundPropertyModel formModel =
>>        new CompoundPropertyModel(new MessageVO());
>> MessageTextArea textArea = new MessageTextArea("text", formModel);
>>
>> Now, the custom textarea is displaying the toString() method of MessageVO
>> object and upon submitting the form, I got the exception:
>>
>>  Attempted to set property value on a null object. Property expression:
>> language Value: English
>> org.apache.wicket.WicketRuntimeException: Attempted to set property value
>> on
>> a null object. Property expression: language Value: English
>>
>>
>>
>>
>> James Carman-3 wrote:
>>>
>>> Just think to yourself what models are being used here.  The TextArea
>>> inside the MessageTextArea is bound to what?  And, the
>>> MessageTextArea's model is bound to what?
>>>
>>> On Sun, May 24, 2009 at 7:32 AM, HHB  wrote:
>>>>
>>>> Would you please tell me in code (my code I posted earlier) what do you
>>>> mean?
>>>> I really appreciate your time and help.
>>>>
>>>>
>>>> igor.vaynberg wrote:
>>>>>
>>>>> you do not bind the model of the textarea to the model of the
>>>>> messagetextarea, so why are you surprised the value never makes it
>>>>> into your model?
>>>>>
>>>>> -igor
>>>>>
>>>>> On Thu, May 21, 2009 at 4:45 AM, HHB  wrote:
>>>>>> Hey,
>>>>>> I'm trying to create my first component in Wicket:
>>>>>> +
>>>>>> public class MessageTextArea extends
>>>>>>    FormComponentPanel {
>>>>>>
>>>>>>    private String text;
>>>>>>
>>>>>>    public MessageTextArea(String id) {
>>>>>>        this(id, null);
>>>>>>    }
>>>>>>
>>>>>>    public MessageTextArea(String id, IModel model) {
>>>>>>        super(id, model);
>>>>>>        setType(String.class);
>>>>>>        setOutputMarkupId(true);
>>>>>>
>>>>>>        final PropertyModel textModel =
>>>>>>              new PropertyModel(this, "text");
>>>>>>        final TextArea textArea =
>>>>>>              new TextArea("text", textModel);
>>>>>>        textArea.setRequired(true);
>>>>>>        textArea.setOutputMarkupId(true);
>>>>>>        add(textArea);
>>>>>>    }
>>>>>>
>>>>>> }
>>>>>> +
>>>>>> And to use the component:
>>>>>> +
>>>>>> CompoundPropertyModel formModel =
>>>>>>      new CompoundPropertyModel(new MessageVO());
>>>>>> form.setModel(formModel);
>>>>>> add(form);
>>>>>> MessageTextArea textArea = new MessageTextArea("text");
>>>>>> +
>>>>>> The problem is when I pass formModel to textArea component,
>>>>>> I got a value expression error, and a NPE if I don't pass the model.
>>>>>> What I'm doing wrong?
>>>>>> Thanks for help and time.
>>>>>>
>>>>>>
>>>>>> -
>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> 

Re: Whats wrong with my component?

2009-05-24 Thread Per Lundholm
So the TextArea gets a CompoundPropertyModel that has a MessageVO object.

The MessageVO has a method "getLanguage" ?

How should the TextArea display the contents of MessageVO?

HTH

/Per

2009/5/24 HHB :
>
> Ok, the TextArea has its own model so I passed the model parameter of the
>  component constructor to the TextArea:
>
> final TextArea textArea = new TextArea("text", model);
>
> And in the panel:
>
> CompoundPropertyModel formModel =
>        new CompoundPropertyModel(new MessageVO());
> MessageTextArea textArea = new MessageTextArea("text", formModel);
>
> Now, the custom textarea is displaying the toString() method of MessageVO
> object and upon submitting the form, I got the exception:
>
>  Attempted to set property value on a null object. Property expression:
> language Value: English
> org.apache.wicket.WicketRuntimeException: Attempted to set property value on
> a null object. Property expression: language Value: English
>
>
>
>
> James Carman-3 wrote:
>>
>> Just think to yourself what models are being used here.  The TextArea
>> inside the MessageTextArea is bound to what?  And, the
>> MessageTextArea's model is bound to what?
>>
>> On Sun, May 24, 2009 at 7:32 AM, HHB  wrote:
>>>
>>> Would you please tell me in code (my code I posted earlier) what do you
>>> mean?
>>> I really appreciate your time and help.
>>>
>>>
>>> igor.vaynberg wrote:
>>>>
>>>> you do not bind the model of the textarea to the model of the
>>>> messagetextarea, so why are you surprised the value never makes it
>>>> into your model?
>>>>
>>>> -igor
>>>>
>>>> On Thu, May 21, 2009 at 4:45 AM, HHB  wrote:
>>>>> Hey,
>>>>> I'm trying to create my first component in Wicket:
>>>>> +
>>>>> public class MessageTextArea extends
>>>>>    FormComponentPanel {
>>>>>
>>>>>    private String text;
>>>>>
>>>>>    public MessageTextArea(String id) {
>>>>>        this(id, null);
>>>>>    }
>>>>>
>>>>>    public MessageTextArea(String id, IModel model) {
>>>>>        super(id, model);
>>>>>        setType(String.class);
>>>>>        setOutputMarkupId(true);
>>>>>
>>>>>        final PropertyModel textModel =
>>>>>              new PropertyModel(this, "text");
>>>>>        final TextArea textArea =
>>>>>              new TextArea("text", textModel);
>>>>>        textArea.setRequired(true);
>>>>>        textArea.setOutputMarkupId(true);
>>>>>        add(textArea);
>>>>>    }
>>>>>
>>>>> }
>>>>> +
>>>>> And to use the component:
>>>>> +
>>>>> CompoundPropertyModel formModel =
>>>>>      new CompoundPropertyModel(new MessageVO());
>>>>> form.setModel(formModel);
>>>>> add(form);
>>>>> MessageTextArea textArea = new MessageTextArea("text");
>>>>> +
>>>>> The problem is when I pass formModel to textArea component,
>>>>> I got a value expression error, and a NPE if I don't pass the model.
>>>>> What I'm doing wrong?
>>>>> Thanks for help and time.
>>>>>
>>>>>
>>>>> -
>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> -
>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Whats-wrong-with-my-component--tp23651847p23692734.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Whats-wrong-with-my-component--tp23651847p23692862.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
FaceBush, min insamling i Mustaschkampen:
http://www.cancerfonden.se//sv/Mustaschkampen/Kampa/Insamlingar/?collection=243

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



Re: Whats wrong with my component?

2009-05-24 Thread HHB

Ok, the TextArea has its own model so I passed the model parameter of the
 component constructor to the TextArea:

final TextArea textArea = new TextArea("text", model);

And in the panel:

CompoundPropertyModel formModel = 
new CompoundPropertyModel(new MessageVO());
MessageTextArea textArea = new MessageTextArea("text", formModel);

Now, the custom textarea is displaying the toString() method of MessageVO
object and upon submitting the form, I got the exception:

 Attempted to set property value on a null object. Property expression:
language Value: English
org.apache.wicket.WicketRuntimeException: Attempted to set property value on
a null object. Property expression: language Value: English




James Carman-3 wrote:
> 
> Just think to yourself what models are being used here.  The TextArea
> inside the MessageTextArea is bound to what?  And, the
> MessageTextArea's model is bound to what?
> 
> On Sun, May 24, 2009 at 7:32 AM, HHB  wrote:
>>
>> Would you please tell me in code (my code I posted earlier) what do you
>> mean?
>> I really appreciate your time and help.
>>
>>
>> igor.vaynberg wrote:
>>>
>>> you do not bind the model of the textarea to the model of the
>>> messagetextarea, so why are you surprised the value never makes it
>>> into your model?
>>>
>>> -igor
>>>
>>> On Thu, May 21, 2009 at 4:45 AM, HHB  wrote:
>>>> Hey,
>>>> I'm trying to create my first component in Wicket:
>>>> +
>>>> public class MessageTextArea extends
>>>>    FormComponentPanel {
>>>>
>>>>    private String text;
>>>>
>>>>    public MessageTextArea(String id) {
>>>>        this(id, null);
>>>>    }
>>>>
>>>>    public MessageTextArea(String id, IModel model) {
>>>>        super(id, model);
>>>>        setType(String.class);
>>>>        setOutputMarkupId(true);
>>>>
>>>>        final PropertyModel textModel =
>>>>              new PropertyModel(this, "text");
>>>>        final TextArea textArea =
>>>>              new TextArea("text", textModel);
>>>>        textArea.setRequired(true);
>>>>        textArea.setOutputMarkupId(true);
>>>>        add(textArea);
>>>>    }
>>>>
>>>> }
>>>> +
>>>> And to use the component:
>>>> +
>>>> CompoundPropertyModel formModel =
>>>>      new CompoundPropertyModel(new MessageVO());
>>>> form.setModel(formModel);
>>>> add(form);
>>>> MessageTextArea textArea = new MessageTextArea("text");
>>>> +
>>>> The problem is when I pass formModel to textArea component,
>>>> I got a value expression error, and a NPE if I don't pass the model.
>>>> What I'm doing wrong?
>>>> Thanks for help and time.
>>>>
>>>>
>>>> -
>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>
>>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Whats-wrong-with-my-component--tp23651847p23692734.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Whats-wrong-with-my-component--tp23651847p23692862.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Whats wrong with my component?

2009-05-24 Thread James Carman
Just think to yourself what models are being used here.  The TextArea
inside the MessageTextArea is bound to what?  And, the
MessageTextArea's model is bound to what?

On Sun, May 24, 2009 at 7:32 AM, HHB  wrote:
>
> Would you please tell me in code (my code I posted earlier) what do you mean?
> I really appreciate your time and help.
>
>
> igor.vaynberg wrote:
>>
>> you do not bind the model of the textarea to the model of the
>> messagetextarea, so why are you surprised the value never makes it
>> into your model?
>>
>> -igor
>>
>> On Thu, May 21, 2009 at 4:45 AM, HHB  wrote:
>>> Hey,
>>> I'm trying to create my first component in Wicket:
>>> +
>>> public class MessageTextArea extends
>>>    FormComponentPanel {
>>>
>>>    private String text;
>>>
>>>    public MessageTextArea(String id) {
>>>        this(id, null);
>>>    }
>>>
>>>    public MessageTextArea(String id, IModel model) {
>>>        super(id, model);
>>>        setType(String.class);
>>>        setOutputMarkupId(true);
>>>
>>>        final PropertyModel textModel =
>>>              new PropertyModel(this, "text");
>>>        final TextArea textArea =
>>>              new TextArea("text", textModel);
>>>        textArea.setRequired(true);
>>>        textArea.setOutputMarkupId(true);
>>>        add(textArea);
>>>    }
>>>
>>> }
>>> +
>>> And to use the component:
>>> +
>>> CompoundPropertyModel formModel =
>>>      new CompoundPropertyModel(new MessageVO());
>>> form.setModel(formModel);
>>> add(form);
>>> MessageTextArea textArea = new MessageTextArea("text");
>>> +
>>> The problem is when I pass formModel to textArea component,
>>> I got a value expression error, and a NPE if I don't pass the model.
>>> What I'm doing wrong?
>>> Thanks for help and time.
>>>
>>>
>>> -----
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Whats-wrong-with-my-component--tp23651847p23692734.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Whats wrong with my component?

2009-05-24 Thread HHB

Would you please tell me in code (my code I posted earlier) what do you mean?
I really appreciate your time and help.


igor.vaynberg wrote:
> 
> you do not bind the model of the textarea to the model of the
> messagetextarea, so why are you surprised the value never makes it
> into your model?
> 
> -igor
> 
> On Thu, May 21, 2009 at 4:45 AM, HHB  wrote:
>> Hey,
>> I'm trying to create my first component in Wicket:
>> +
>> public class MessageTextArea extends
>>    FormComponentPanel {
>>
>>    private String text;
>>
>>    public MessageTextArea(String id) {
>>        this(id, null);
>>    }
>>
>>    public MessageTextArea(String id, IModel model) {
>>        super(id, model);
>>        setType(String.class);
>>        setOutputMarkupId(true);
>>
>>        final PropertyModel textModel =
>>              new PropertyModel(this, "text");
>>        final TextArea textArea =
>>              new TextArea("text", textModel);
>>        textArea.setRequired(true);
>>        textArea.setOutputMarkupId(true);
>>        add(textArea);
>>    }
>>
>> }
>> +
>> And to use the component:
>> +
>> CompoundPropertyModel formModel =
>>      new CompoundPropertyModel(new MessageVO());
>> form.setModel(formModel);
>> add(form);
>> MessageTextArea textArea = new MessageTextArea("text");
>> +
>> The problem is when I pass formModel to textArea component,
>> I got a value expression error, and a NPE if I don't pass the model.
>> What I'm doing wrong?
>> Thanks for help and time.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Whats-wrong-with-my-component--tp23651847p23692734.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Whats wrong with my component?

2009-05-21 Thread Igor Vaynberg
you do not bind the model of the textarea to the model of the
messagetextarea, so why are you surprised the value never makes it
into your model?

-igor

On Thu, May 21, 2009 at 4:45 AM, HHB  wrote:
> Hey,
> I'm trying to create my first component in Wicket:
> +
> public class MessageTextArea extends
>    FormComponentPanel {
>
>    private String text;
>
>    public MessageTextArea(String id) {
>        this(id, null);
>    }
>
>    public MessageTextArea(String id, IModel model) {
>        super(id, model);
>        setType(String.class);
>        setOutputMarkupId(true);
>
>        final PropertyModel textModel =
>              new PropertyModel(this, "text");
>        final TextArea textArea =
>              new TextArea("text", textModel);
>        textArea.setRequired(true);
>        textArea.setOutputMarkupId(true);
>        add(textArea);
>    }
>
> }
> +
> And to use the component:
> +
> CompoundPropertyModel formModel =
>      new CompoundPropertyModel(new MessageVO());
> form.setModel(formModel);
> add(form);
> MessageTextArea textArea = new MessageTextArea("text");
> +
> The problem is when I pass formModel to textArea component,
> I got a value expression error, and a NPE if I don't pass the model.
> What I'm doing wrong?
> Thanks for help and time.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Whats wrong with my component?

2009-05-21 Thread HHB
rvletHandler$CachedChain.doFilter(ServletHandler.java:1148)
>> at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387)
>> at
>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>> at
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>> at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
>> at
>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>> at
>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>> at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>> at org.mortbay.jetty.Server.handle(Server.java:324)
>> at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
>> at
>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:880)
>> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
>> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
>> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>> at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>> at
>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
>> 
>> 
>> Alexandru Objelean wrote:
>>> 
>>> Read more about CompoundPropertyModel. When you apply this kind of model
>>> on component, all children components which do not have explicit model
>>> set will try to find a mapping from the parent based on its wicket id. 
>>> 
>>> In your case, if the MessageVO would have a "text" property (with
>>> setters and getters) everything would work fine. 
>>> 
>>> Alex
>>> 
>>> 
>>> HHB wrote:
>>>> 
>>>> Hey,
>>>> I'm trying to create my first component in Wicket:
>>>> +
>>>> public class MessageTextArea extends 
>>>> FormComponentPanel {
>>>> 
>>>> private String text;
>>>> 
>>>> public MessageTextArea(String id) {
>>>> this(id, null);
>>>> }
>>>> 
>>>> public MessageTextArea(String id, IModel model) {
>>>> super(id, model);
>>>> setType(String.class);
>>>> setOutputMarkupId(true);
>>>> 
>>>> final PropertyModel textModel = 
>>>>       new PropertyModel(this, "text");
>>>> final TextArea textArea = 
>>>>   new TextArea("text", textModel);
>>>> textArea.setRequired(true);
>>>> textArea.setOutputMarkupId(true);
>>>> add(textArea);
>>>> }
>>>> 
>>>> }
>>>> +
>>>> And to use the component:
>>>> +
>>>> CompoundPropertyModel formModel = 
>>>>   new CompoundPropertyModel(new MessageVO());
>>>> form.setModel(formModel);
>>>> add(form);
>>>> MessageTextArea textArea = new MessageTextArea("text");
>>>> +
>>>> The problem is when I pass formModel to textArea component,
>>>> I got a value expression error, and a NPE if I don't pass the model.
>>>> What I'm doing wrong?
>>>> Thanks for help and time.
>>>> 
>>>> 
>>>> -
>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Whats-wrong-with-my-component--tp23651847p23654235.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Whats wrong with my component?

2009-05-21 Thread Alex Objelean
tbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:324)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:880)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
> 
> 
> Alexandru Objelean wrote:
>> 
>> Read more about CompoundPropertyModel. When you apply this kind of model
>> on component, all children components which do not have explicit model
>> set will try to find a mapping from the parent based on its wicket id. 
>> 
>> In your case, if the MessageVO would have a "text" property (with setters
>> and getters) everything would work fine. 
>> 
>> Alex
>> 
>> 
>> HHB wrote:
>>> 
>>> Hey,
>>> I'm trying to create my first component in Wicket:
>>> +
>>> public class MessageTextArea extends 
>>> FormComponentPanel {
>>> 
>>> private String text;
>>> 
>>> public MessageTextArea(String id) {
>>> this(id, null);
>>> }
>>> 
>>> public MessageTextArea(String id, IModel model) {
>>> super(id, model);
>>> setType(String.class);
>>> setOutputMarkupId(true);
>>> 
>>> final PropertyModel textModel = 
>>>   new PropertyModel(this, "text");
>>> final TextArea textArea = 
>>>   new TextArea("text", textModel);
>>> textArea.setRequired(true);
>>> textArea.setOutputMarkupId(true);
>>> add(textArea);
>>> }
>>> 
>>> }
>>> +
>>> And to use the component:
>>> +++++++++
>>> CompoundPropertyModel formModel = 
>>>   new CompoundPropertyModel(new MessageVO());
>>> form.setModel(formModel);
>>> add(form);
>>> MessageTextArea textArea = new MessageTextArea("text");
>>> +
>>> The problem is when I pass formModel to textArea component,
>>> I got a value expression error, and a NPE if I don't pass the model.
>>> What I'm doing wrong?
>>> Thanks for help and time.
>>> 
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Whats-wrong-with-my-component--tp23651847p23653358.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Whats wrong with my component?

2009-05-21 Thread HHB
thing would work fine. 
> 
> Alex
> 
> 
> HHB wrote:
>> 
>> Hey,
>> I'm trying to create my first component in Wicket:
>> +
>> public class MessageTextArea extends 
>> FormComponentPanel {
>> 
>> private String text;
>> 
>> public MessageTextArea(String id) {
>> this(id, null);
>> }
>> 
>> public MessageTextArea(String id, IModel model) {
>> super(id, model);
>> setType(String.class);
>> setOutputMarkupId(true);
>> 
>> final PropertyModel textModel = 
>>   new PropertyModel(this, "text");
>> final TextArea textArea = 
>>   new TextArea("text", textModel);
>> textArea.setRequired(true);
>> textArea.setOutputMarkupId(true);
>> add(textArea);
>> }
>> 
>> }
>> +
>> And to use the component:
>> +
>> CompoundPropertyModel formModel = 
>>   new CompoundPropertyModel(new MessageVO());
>> form.setModel(formModel);
>> add(form);
>> MessageTextArea textArea = new MessageTextArea("text");
>> +
>> The problem is when I pass formModel to textArea component,
>> I got a value expression error, and a NPE if I don't pass the model.
>> What I'm doing wrong?
>> Thanks for help and time.
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Whats-wrong-with-my-component--tp23651847p23653293.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Whats wrong with my component?

2009-05-21 Thread HHB

I have setter and getter property in MessageVO and still get the exception.


Alexandru Objelean wrote:
> 
> Read more about CompoundPropertyModel. When you apply this kind of model
> on component, all children components which do not have explicit model set
> will try to find a mapping from the parent based on its wicket id. 
> 
> In your case, if the MessageVO would have a "text" property (with setters
> and getters) everything would work fine. 
> 
> Alex
> 
> 
> HHB wrote:
>> 
>> Hey,
>> I'm trying to create my first component in Wicket:
>> +
>> public class MessageTextArea extends 
>> FormComponentPanel {
>> 
>> private String text;
>> 
>> public MessageTextArea(String id) {
>> this(id, null);
>> }
>> 
>> public MessageTextArea(String id, IModel model) {
>> super(id, model);
>> setType(String.class);
>> setOutputMarkupId(true);
>> 
>> final PropertyModel textModel = 
>>   new PropertyModel(this, "text");
>> final TextArea textArea = 
>>   new TextArea("text", textModel);
>> textArea.setRequired(true);
>> textArea.setOutputMarkupId(true);
>> add(textArea);
>> }
>> 
>> }
>> +
>> And to use the component:
>> +
>> CompoundPropertyModel formModel = 
>>   new CompoundPropertyModel(new MessageVO());
>> form.setModel(formModel);
>> add(form);
>> MessageTextArea textArea = new MessageTextArea("text");
>> +
>> The problem is when I pass formModel to textArea component,
>> I got a value expression error, and a NPE if I don't pass the model.
>> What I'm doing wrong?
>> Thanks for help and time.
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Whats-wrong-with-my-component--tp23651847p23653112.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Whats wrong with my component?

2009-05-21 Thread Alex Objelean

Read more about CompoundPropertyModel. When you apply this kind of model on
component, all children components which do not have explicit model set will
try to find a mapping from the parent based on its wicket id. 

In your case, if the MessageVO would have a "text" property (with setters
and getters) everything would work fine. 

Alex


HHB wrote:
> 
> Hey,
> I'm trying to create my first component in Wicket:
> +
> public class MessageTextArea extends 
> FormComponentPanel {
> 
> private String text;
> 
> public MessageTextArea(String id) {
> this(id, null);
> }
> 
> public MessageTextArea(String id, IModel model) {
> super(id, model);
> setType(String.class);
> setOutputMarkupId(true);
> 
> final PropertyModel textModel = 
>   new PropertyModel(this, "text");
> final TextArea textArea = 
>   new TextArea("text", textModel);
> textArea.setRequired(true);
> textArea.setOutputMarkupId(true);
> add(textArea);
> }
> 
> }
> +
> And to use the component:
> +
> CompoundPropertyModel formModel = 
>   new CompoundPropertyModel(new MessageVO());
> form.setModel(formModel);
> add(form);
> MessageTextArea textArea = new MessageTextArea("text");
> +
> The problem is when I pass formModel to textArea component,
> I got a value expression error, and a NPE if I don't pass the model.
> What I'm doing wrong?
> Thanks for help and time.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Whats-wrong-with-my-component--tp23651847p23652523.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Whats wrong with my component?

2009-05-21 Thread HHB
Hey,
I'm trying to create my first component in Wicket:
+
public class MessageTextArea extends 
FormComponentPanel {

private String text;

public MessageTextArea(String id) {
this(id, null);
}

public MessageTextArea(String id, IModel model) {
super(id, model);
setType(String.class);
setOutputMarkupId(true);

final PropertyModel textModel = 
  new PropertyModel(this, "text");
final TextArea textArea = 
  new TextArea("text", textModel);
textArea.setRequired(true);
textArea.setOutputMarkupId(true);
add(textArea);
}

}
+
And to use the component:
+
CompoundPropertyModel formModel = 
  new CompoundPropertyModel(new MessageVO());
form.setModel(formModel);
add(form);
MessageTextArea textArea = new MessageTextArea("text");
+
The problem is when I pass formModel to textArea component,
I got a value expression error, and a NPE if I don't pass the model.
What I'm doing wrong?
Thanks for help and time.


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