Re: Unusual problem is coming in rendering component

2012-05-03 Thread kshitiz
I read that out...sorry I missed that while coding. Thanks for the help..:)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unusual-problem-is-coming-in-rendering-component-tp4604163p4607651.html
Sent from the Users forum 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: Unusual problem is coming in rendering component

2012-05-03 Thread Thomas Götz
Please have a look at the JavaDoc of 
org.apache.wicket.model.CompoundPropertyModel. Other interesting reads:

https://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-CompoundPropertyModels
http://www.mkyong.com/wicket/wicket-compoundpropertymodel-example/

Cheers,
   -Tom




On 03.05.2012 at 05:07 kshitiz wrote:

> Thank you very much for the repliesI got the problem and solved it using
> the code:
> 
> *final RequiredTextField postTextField = new
> RequiredTextField(
>   "postTextField", 
> Model.of(postDomain.getPost()));
> *
> 
> But please tell me one thing...the first parameter in new
> RequiredTextField() function is used to map textfield tag present in
> html page with its java definition. Why wicket is using that parameter to
> map it to the property of compound model (PostDomain in this case)???
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Unusual-problem-is-coming-in-rendering-component-tp4604163p4605012.html
> Sent from the Users forum 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: Unusual problem is coming in rendering component

2012-05-02 Thread kshitiz
Thank you very much for the repliesI got the problem and solved it using
the code:

*final RequiredTextField postTextField = new
RequiredTextField(
"postTextField", 
Model.of(postDomain.getPost()));
*

But please tell me one thing...the first parameter in new
RequiredTextField() function is used to map textfield tag present in
html page with its java definition. Why wicket is using that parameter to
map it to the property of compound model (PostDomain in this case)???

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unusual-problem-is-coming-in-rendering-component-tp4604163p4605012.html
Sent from the Users forum 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: Unusual problem is coming in rendering component

2012-05-02 Thread Adam Gray
It looks that since you aren't giving the text field a model to bind to,
it's walking up the component hierarchy to find a model to check for a
getter getPostTextField().  I'm guessing that PostDomain does have a
getPost() method, which it's finding and using.  You'll either want to keep
the wicket id as post, or give the text field an explicit property model
like, new PropertyModel(form.getModel(), "post") as the second
argument to the text field constructor (assuming you are providing the form
with the model for PostDomain).

On Wed, May 2, 2012 at 3:07 PM, kshitiz  wrote:

> Hi,
>
> I am trying to render a text field :
>
> Java code:
>
> *final RequiredTextField postTextField = new
> RequiredTextField(
>"postTextField");
>
> *postForm.add(postTextField);*
>
> Html code
> **
>
> But I am gettin the error:
>
> Root cause:
>
> org.apache.wicket.WicketRuntimeException: No get method defined for class:
> class domain.PostDomain expression: postTextField
> at
>
> org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:499)
> at
>
> org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:341)
> at
>
> org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:244)
> at
>
> org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:97)
> at
>
> org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:134)
> at
> org.apache.wicket.Component.getDefaultModelObject(Component.java:1668)
> at
>
> org.apache.wicket.Component.getDefaultModelObjectAsString(Component.java:1695)
> at
>
> org.apache.wicket.markup.html.form.FormComponent.getModelValue(FormComponent.java:1211)
> at
>
> org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:837)
> at
>
> org.apache.wicket.markup.html.form.TextField.onComponentTag(TextField.java:108)
> at
> org.apache.wicket.Component.internalRenderComponent(Component.java:2510)
> at
> org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1534)
> at org.apache.wicket.Component.internalRender(Component.java:2369)
> at org.apache.wicket.Component.render(Component.java:2297)
>
> Now, when I replace *postTextField* with *post*, no error comes...!!!
>
> That is, if my java code is:
> *final RequiredTextField postTextField = new
> RequiredTextField(
>            "post");
>
> and Html code is:
>
> **
>
> The code runs fine...
>
> What can be the problem...?
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Unusual-problem-is-coming-in-rendering-component-tp4604163.html
> Sent from the Users forum 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: Unusual problem is coming in rendering component

2012-05-02 Thread Dan Retzlaff
I'd guess that you're using CompoundPropertyModel. This kind of confusion
is common with CPM, which is why people often recommend against it.

On Wed, May 2, 2012 at 12:09 PM, Richard W. Adams  wrote:

> It means it's looking for a method called getPostTextField() in your
> model, but not finding one.
>
>
>
>
> From:   kshitiz 
> To: users@wicket.apache.org
> Date:   05/02/2012 02:08 PM
> Subject:    Unusual problem is coming in rendering component
>
>
>
> Hi,
>
> I am trying to render a text field :
>
> Java code:
>
> *final RequiredTextField postTextField = new
> RequiredTextField(
>  "postTextField");
>
> *postForm.add(postTextField);*
>
> Html code
> **
>
> But I am gettin the error:
>
> Root cause:
>
> org.apache.wicket.WicketRuntimeException: No get method defined for class:
> class domain.PostDomain expression: postTextField
> at
>
> org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:499)
> at
>
> org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:341)
> at
>
> org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:244)
> at
>
> org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:97)
> at
>
> org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:134)
> at
> org.apache.wicket.Component.getDefaultModelObject(Component.java:1668)
> at
>
> org.apache.wicket.Component.getDefaultModelObjectAsString(Component.java:1695)
> at
>
> org.apache.wicket.markup.html.form.FormComponent.getModelValue(FormComponent.java:1211)
> at
>
> org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:837)
> at
>
> org.apache.wicket.markup.html.form.TextField.onComponentTag(TextField.java:108)
> at
> org.apache.wicket.Component.internalRenderComponent(Component.java:2510)
> at
> org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1534)
> at org.apache.wicket.Component.internalRender(Component.java:2369)
> at org.apache.wicket.Component.render(Component.java:2297)
>
> Now, when I replace *postTextField* with *post*, no error comes...!!!
>
> That is, if my java code is:
> *final RequiredTextField postTextField = new
> RequiredTextField(
>                     "post");
>
> and Html code is:
>
> **
>
> The code runs fine...
>
> What can be the problem...?
>
>
>
> --
> View this message in context:
>
> http://apache-wicket.1842946.n4.nabble.com/Unusual-problem-is-coming-in-rendering-component-tp4604163.html
>
> Sent from the Users forum 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
>
>
>
>
> **
>
> This email and any attachments may contain information that is
> confidential and/or privileged for the sole use of the intended recipient.
>  Any use, review, disclosure, copying, distribution or reliance by others,
> and any forwarding of this email or its contents, without the express
> permission of the sender is strictly prohibited by law.  If you are not the
> intended recipient, please contact the sender immediately, delete the
> e-mail and destroy all copies.
> **
>


Re: Unusual problem is coming in rendering component

2012-05-02 Thread Richard W. Adams
It means it's looking for a method called getPostTextField() in your 
model, but not finding one.




From:   kshitiz 
To: users@wicket.apache.org
Date:   05/02/2012 02:08 PM
Subject:    Unusual problem is coming in rendering component



Hi,

I am trying to render a text field :

Java code:

*final RequiredTextField postTextField = new
RequiredTextField(
 "postTextField");

*postForm.add(postTextField);*

Html code
**

But I am gettin the error:

Root cause:

org.apache.wicket.WicketRuntimeException: No get method defined for class:
class domain.PostDomain expression: postTextField
 at
org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:499)
 at
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:341)
 at
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:244)
 at
org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:97)
 at
org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:134)
 at
org.apache.wicket.Component.getDefaultModelObject(Component.java:1668)
 at
org.apache.wicket.Component.getDefaultModelObjectAsString(Component.java:1695)
 at
org.apache.wicket.markup.html.form.FormComponent.getModelValue(FormComponent.java:1211)
 at
org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:837)
 at
org.apache.wicket.markup.html.form.TextField.onComponentTag(TextField.java:108)
 at
org.apache.wicket.Component.internalRenderComponent(Component.java:2510)
 at
org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1534)
 at org.apache.wicket.Component.internalRender(Component.java:2369)
 at org.apache.wicket.Component.render(Component.java:2297)

Now, when I replace *postTextField* with *post*, no error comes...!!!

That is, if my java code is:
*final RequiredTextField postTextField = new
RequiredTextField(
 "post");

and Html code is:

**

The code runs fine...

What can be the problem...?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unusual-problem-is-coming-in-rendering-component-tp4604163.html

Sent from the Users forum 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




**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**