Inmethod Grid Select All or Reload Grid

2011-04-18 Thread GJT
Hi there

I started using the Inmethod DataGrid because I need resizable tables and I
need to be able to select multi entries.

First, I had the problem that I couldn't select all entries and the multi
select didin't work properly. In this forum I found out that I have to
implement hashCode in the model. After that it worked, but the grid didn't
refresh anymore after I had changed the model. 

To sum up, if I use the hashCode, I the table doesn't refresh after I change
the model. If I don't use hashCode, the selection doesn't work properly.

The code for hashCode() and equals I'm using:

  public int hashCode() {
 return new Long(id).hashCode();
  }

  public boolean equals(final Object obj) {
 if (obj == this) {
return true;
 } else if (obj == null) {
return false;
 } else if (obj instanceof DetachableModel) {
DetachableModel other = (DetachableModel) obj;
return other.id == this.id;
 }
 return false;
  }

Thanks for your help.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Inmethod-Grid-Select-All-or-Reload-Grid-tp3456685p3456685.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: Inmethod Grid Select All or Reload Grid

2011-04-18 Thread Attila Király
2011/4/18 GJT taulant.gju...@helvetic.com

 Hi there

 I started using the Inmethod DataGrid because I need resizable tables and I
 need to be able to select multi entries.

 First, I had the problem that I couldn't select all entries and the multi
 select didin't work properly. In this forum I found out that I have to
 implement hashCode in the model. After that it worked, but the grid didn't
 refresh anymore after I had changed the model.

 To sum up, if I use the hashCode, I the table doesn't refresh after I
 change
 the model. If I don't use hashCode, the selection doesn't work properly.

 The code for hashCode() and equals I'm using:

  public int hashCode() {
 return new Long(id).hashCode();
  }

  public boolean equals(final Object obj) {
 if (obj == this) {
return true;
 } else if (obj == null) {
return false;
 } else if (obj instanceof DetachableModel) {
DetachableModel other = (DetachableModel) obj;
return other.id == this.id;
 }
 return false;
  }

 Thanks for your help.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Inmethod-Grid-Select-All-or-Reload-Grid-tp3456685p3456685.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


Hi

Which version are you using (1.4 or 1.5)? What do you mean the grid does not
refresh?

I suggest
examining inmethod-grid-examples (com.inmethod.grid.examples.pages.datagrid
package) which seems to work fine.

Attila


Re: Refreshing loadable detachable model object inside an ajax call

2011-04-18 Thread lucast
Hi Clint, 
Here is the example of EntityModel as taken from 
http://wicketinaction.com/2008/09/building-a-smart-entitymodel/
http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ .
I've added the constructor that calls super().
public class EntityModelT extends AbstractEntityModelT {
public EntityModel(Class? extends T clazz, Serializable id) {
super(clazz, id);   
}
@Override
protected T load(Class clazz, Serializable id) {
return WicketApplication.get().get_service().load(clazz, id);
}
}
Now my I have two errors from my IDE (Eclipse), the first one on extends
AbstractEntityModelT {. On type T, it says: Bound mismatch: The type T is
not a valid substitute for the bounded parameter T extends Identifiable?
of the type AbstractEntityModelT.
Would you know what is going on here? I am following the exact example.

The second error my IDE is complaining about is on return
WicketApplication.get().get_service().load(clazz, id);: The method
load(ClassT, long) in the type Service is not applicable for the arguments
(Class, Serializable).
That's fair enough since all the objects ID i'm persisting to DB are of type
Long. 
But why is the example using type Serializable instead of Long? 
If you look at the section Using EntityModel to bind to Forms, from the
link above you will see that the values passed are class and Long:
 public EditPersonPage(Long personId)
{
this(new EntityModelPerson(Person.class, personId));
}

I fear I'm missing a very small detail that's stopping me from having this
working.
Thanks, Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refreshing-loadable-detachable-model-object-inside-an-ajax-call-tp3446979p3456789.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: Inmethod Grid Select All or Reload Grid

2011-04-18 Thread GJT
I am using wicket 1.4.16 and inmethod-grid 1.4.17

For example, I have a list of flights. I select every flight I want to
change. So I press a button which opens a modal window. There I change the
times of the selected flights. After saving, the table should load the new
data (target.addComponent(grid)). That's what I mean with refresh. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Inmethod-Grid-Select-All-or-Reload-Grid-tp3456685p3456877.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: Inmethod Grid Select All or Reload Grid

2011-04-18 Thread Marc Nuri San Félix
Try this:
+++
grid.markAllItemsDirty();
grid.update(); // - This adds the grid to AjaxRequestTarget,
so target.addComponent(grid) is not necessary
+++
Regards
--
Marc Nuri

On Mon, Apr 18, 2011 at 10:15, GJT taulant.gju...@helvetic.com wrote:

 I am using wicket 1.4.16 and inmethod-grid 1.4.17

 For example, I have a list of flights. I select every flight I want to
 change. So I press a button which opens a modal window. There I change the
 times of the selected flights. After saving, the table should load the new
 data (target.addComponent(grid)). That's what I mean with refresh.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Inmethod-Grid-Select-All-or-Reload-Grid-tp3456685p3456877.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: Refreshing loadable detachable model object inside an ajax call

2011-04-18 Thread jcgarciam
Does your Person class implements the 'Identifiable' interface?

On Mon, Apr 18, 2011 at 4:27 AM, lucast [via Apache Wicket] 
ml-node+3456789-549093517-65...@n4.nabble.com wrote:

 Hi Clint,
 Here is the example of EntityModel as taken from
 http://wicketinaction.com/2008/09/building-a-smart-entitymodel/.
 I've added the constructor that calls super().
 public class EntityModelT extends AbstractEntityModelT {
 public EntityModel(Class? extends T clazz, Serializable id) {
 super(clazz, id);
 }
 @Override
 protected T load(Class clazz, Serializable id) {
 return WicketApplication.get().get_service().load(clazz,
 id);
 }
 }
 Now my I have two errors from my IDE (Eclipse), the first one on *extends
 AbstractEntityModelT {*. On type T, it says: Bound mismatch: The type T
 is not a valid substitute for the bounded parameter T extends
 Identifiable? of the type AbstractEntityModelT.
 Would you know what is going on here? I am following the exact example.

 The second error my IDE is complaining about is on *return
 WicketApplication.get().get_service().load(clazz, id);*: The method
 load(ClassT, long) in the type Service is not applicable for the arguments
 (Class, Serializable).
 That's fair enough since all the objects ID i'm persisting to DB are of
 type Long.
 But why is the example using type Serializable instead of Long?
 If you look at the section Using EntityModel to bind to Forms, from the
 link above you will see that the values passed are class and Long:
  public EditPersonPage(Long personId)
 {
 this(new EntityModelPerson(Person.class, personId));
 }

 I fear I'm missing a very small detail that's stopping me from having this
 working.
 Thanks, Lucas



 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://apache-wicket.1842946.n4.nabble.com/Refreshing-loadable-detachable-model-object-inside-an-ajax-call-tp3446979p3456789.html
  To start a new topic under Apache Wicket, email
 ml-node+1842946-398011874-65...@n4.nabble.com
 To unsubscribe from Apache Wicket, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=.





-- 

JC


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refreshing-loadable-detachable-model-object-inside-an-ajax-call-tp3446979p3457165.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: Refreshing loadable detachable model object inside an ajax call

2011-04-18 Thread lucast
Hi jcgarciam, 
I have made sure that my original class Parent does implement class
IdentifiableSerializable and I have now modified EntityModelT to public
class EntityModelT extends AbstractEntityModelParent {. That got rid the
error message.  So that's great. Thanks!
I will try to have it running later on during the day. 

Why does AbstractEntityModel class on 
http://wicketinaction.com/2008/09/building-a-smart-entitymodel/
http://wicketinaction.com/2008/09/building-a-smart-entitymodel/  uses 
Serializable id, when later on,  under Using EntityModel to bind to Forms 
it is passing a value of type Long to initialise the EntityModel class? 
Based on the example of the EntityModel.load() function, should I change my
WicketApplication.get().get_service().load(clazz, id) to accept Serialisable
instead of Long? 
Maybe I'm missing something basic here. But your suggestion helped to get
past the initial hurdle.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refreshing-loadable-detachable-model-object-inside-an-ajax-call-tp3446979p3457227.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: Inmethod Grid Select All or Reload Grid

2011-04-18 Thread GJT
I tried that before and I tried it again, but it doesn't work. I think the
problem is somewhere with my LoadableDetachableModel which contains a
constructor, equals(Object), hashCode() and load()


Marc Nuri wrote:
 
 Try this:
 +++
 grid.markAllItemsDirty();
 grid.update(); // - This adds the grid to AjaxRequestTarget,
 so target.addComponent(grid) is not necessary
 +++
 Regards
 --
 Marc Nuri
 
 On Mon, Apr 18, 2011 at 10:15, GJT lt;taulant.gju...@helvetic.comgt;
 wrote:
 
 I am using wicket 1.4.16 and inmethod-grid 1.4.17

 For example, I have a list of flights. I select every flight I want to
 change. So I press a button which opens a modal window. There I change
 the
 times of the selected flights. After saving, the table should load the
 new
 data (target.addComponent(grid)). That's what I mean with refresh.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Inmethod-Grid-Select-All-or-Reload-Grid-tp3456685p3456877.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


 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Inmethod-Grid-Select-All-or-Reload-Grid-tp3456685p3457237.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: Refreshing loadable detachable model object inside an ajax call

2011-04-18 Thread Clint Checketts
Your issue with the generics is you need to tell it that 'T extends
Indetifiable', or take it out entirely if you are going to explicitly tell
it that you are using the Parent class.

Also feel free to make the argument match what your load method requires.
The article could be referencing code that is old or whatever. Also keep in
mind that the class Long implements Serializable, but the primitive long
(lower case 'l') isn't an object and doesn't have a type inheritance (even
though it will serialize, but that's a disfferent topic).


-Clint



public class EntityModelT *extends Identifiable* extends
AbstractEntityModelT {
   public EntityModel(Class? extends T clazz, Serializable id) {
   super(clazz, id);
   }
   @Override
   protected T load(Class clazz, Serializable id) {
   return WicketApplication.get().get_
service().load(clazz, id);
   }
}


On Mon, Apr 18, 2011 at 6:16 AM, lucast lucastol...@hotmail.com wrote:

 Hi jcgarciam,
 I have made sure that my original class Parent does implement class
 IdentifiableSerializable and I have now modified EntityModelT to public
 class EntityModelT extends AbstractEntityModelParent {. That got rid
 the
 error message.  So that's great. Thanks!
 I will try to have it running later on during the day.

 Why does AbstractEntityModel class on
 http://wicketinaction.com/2008/09/building-a-smart-entitymodel/
 http://wicketinaction.com/2008/09/building-a-smart-entitymodel/  uses
 Serializable id, when later on,  under Using EntityModel to bind to Forms
 it is passing a value of type Long to initialise the EntityModel class?
 Based on the example of the EntityModel.load() function, should I change my
 WicketApplication.get().get_service().load(clazz, id) to accept
 Serialisable
 instead of Long?
 Maybe I'm missing something basic here. But your suggestion helped to get
 past the initial hurdle.


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Refreshing-loadable-detachable-model-object-inside-an-ajax-call-tp3446979p3457227.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: Inmethod Grid Select All or Reload Grid

2011-04-18 Thread Marc Nuri San Félix
Have you debugged your project to see if the IDatasource is queried when you
perform the Ajax reload??
If you reload the page does the data update??
--
Marc Nuri

On Mon, Apr 18, 2011 at 13:19, GJT taulant.gju...@helvetic.com wrote:

 I tried that before and I tried it again, but it doesn't work. I think the
 problem is somewhere with my LoadableDetachableModel which contains a
 constructor, equals(Object), hashCode() and load()


 Marc Nuri wrote:
 
  Try this:
  +++
  grid.markAllItemsDirty();
  grid.update(); // - This adds the grid to AjaxRequestTarget,
  so target.addComponent(grid) is not necessary
  +++
  Regards
  --
  Marc Nuri
 
  On Mon, Apr 18, 2011 at 10:15, GJT lt;taulant.gju...@helvetic.comgt;
  wrote:
 
  I am using wicket 1.4.16 and inmethod-grid 1.4.17
 
  For example, I have a list of flights. I select every flight I want to
  change. So I press a button which opens a modal window. There I change
  the
  times of the selected flights. After saving, the table should load the
  new
  data (target.addComponent(grid)). That's what I mean with refresh.
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Inmethod-Grid-Select-All-or-Reload-Grid-tp3456685p3456877.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
 
 
 


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Inmethod-Grid-Select-All-or-Reload-Grid-tp3456685p3457237.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: Inmethod Grid Select All or Reload Grid

2011-04-18 Thread GJT
After debugging, I found out the with the hashCode method, the columns don't
load. If I take out the hashCode method, the columns loads the data again.
But as I said, the selection doesn't work anymore. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Inmethod-Grid-Select-All-or-Reload-Grid-tp3456685p3457355.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: Inmethod Grid Select All or Reload Grid

2011-04-18 Thread Marc Nuri San Félix
For what you're saying, I believe you've got something messed up in your
Bean's hashCode and equals method.
Inmethod's Datagrid keeps a Set (HashSet) of IModel objects to keep track of
which items are selected. If you've implemented correctly the equals method
in your bean and believe that there's something wrong in the way the
Datagrid keeps track of selected items, you can implement your
own isItemSelected, resetSelectedItems, selectAllVisibleItems methods in a
custom implementation of Datagrid or Abstractdatagrid.
--
Marc Nuri

On Mon, Apr 18, 2011 at 14:19, GJT taulant.gju...@helvetic.com wrote:

 After debugging, I found out the with the hashCode method, the columns
 don't
 load. If I take out the hashCode method, the columns loads the data again.
 But as I said, the selection doesn't work anymore.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Inmethod-Grid-Select-All-or-Reload-Grid-tp3456685p3457355.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: Inmethod Grid Select All or Reload Grid

2011-04-18 Thread Attila Király
Can you provide a minimal example webapp showing the problem?

Attila

2011/4/18 GJT taulant.gju...@helvetic.com

 After debugging, I found out the with the hashCode method, the columns
 don't
 load. If I take out the hashCode method, the columns loads the data again.
 But as I said, the selection doesn't work anymore.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Inmethod-Grid-Select-All-or-Reload-Grid-tp3456685p3457355.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




extends statement

2011-04-18 Thread Tomas Mihok
Hello,

I created a web application with module as reausable component in it. Here
is how it looks like (very simple):

Index.html - 2 links (they are in ul list) and module added through div
Index.Java extends HomePage with three add statements (2 x
BookmarkablePageLink and one ModuleOne())
OtherPage.html - 2 links (they are in ul list) and module added through
div
OtherPage.java - extends HomePage with three add statements (2 x
BookmarkablePageLink and one ModuleTwo())

When I run the application both modules show up and links don't work.. Can
both pages extend HomePage? Thank you for your comments.


Wicket and youtube browser based upload

2011-04-18 Thread Pavol Zibrita
Hi There!

   I'm quite new to wicket and I'm doing a web application where user's can
upload videos to youtube. For that, there is an youtube API from google. The
problem I have is that I need to use browser-based upload, which means, that
the actual upload should go directly to youtube and not to the server, where
my application is running.
   And that is the point where my lack knowledge of wicket is stopping me.

Basically I would like to present a user a form, where he can enter some
values about the video (name, category, etc), the file he wants to upload.
This form should be submitted than to the youtube site with post method and
some extra parameters. But I actually don't know how to do that. Can I
change target in standard wicket form? And if I use the form in popup, how
will I close the popup if the form goes to youtube?
Has anyone experience with this?

I don't know what else information to write here, so if anything more is
needed ask for it. I hope someone will help me.

Thanx,
Pavol


Re: Wicket and youtube browser based upload

2011-04-18 Thread Zilvinas Vilutis
I think it is YouTubeDirect that you're looking for:
http://code.google.com/p/youtube-direct/wiki/GettingStarted

Regards

Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cika...@gmail.com



On Mon, Apr 18, 2011 at 2:25 PM, Pavol Zibrita pavol.zibr...@gmail.com wrote:
 Hi There!

   I'm quite new to wicket and I'm doing a web application where user's can
 upload videos to youtube. For that, there is an youtube API from google. The
 problem I have is that I need to use browser-based upload, which means, that
 the actual upload should go directly to youtube and not to the server, where
 my application is running.
   And that is the point where my lack knowledge of wicket is stopping me.

 Basically I would like to present a user a form, where he can enter some
 values about the video (name, category, etc), the file he wants to upload.
 This form should be submitted than to the youtube site with post method and
 some extra parameters. But I actually don't know how to do that. Can I
 change target in standard wicket form? And if I use the form in popup, how
 will I close the popup if the form goes to youtube?
 Has anyone experience with this?

 I don't know what else information to write here, so if anything more is
 needed ask for it. I hope someone will help me.

 Thanx,
 Pavol


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



org.apache.wicket.WicketRuntimeException: No get method defined for class: class java.lang.String expression: userName;

2011-04-18 Thread cablepuff
Hi I have the following domain object

public class User {
   private String email;
   private String firstName;
   private String lastName;
   private Account account;
   
   public String getUserName() {
  return this.account.getName();
   }

   public void setUserName(String username) {
this.account.setName(username); 
  }
}

I have a form with dropdownchoice.

final DropDownChoiceUser userChoice = new
DropDownChoicePerson(userChoice,
   new ListModelUser(users),
new ChoiceRendererUser(userName, userName));

When the page loads i get this error!

org.apache.wicket.WicketRuntimeException: No get method defined for class:
class java.lang.String expression: userName
at
org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:492)
at
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:332)
at
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:242)
at
org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:95)
at
org.apache.wicket.markup.html.form.ChoiceRenderer.getIdValue(ChoiceRenderer.java:145)
at
org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:166)
at
org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:879)
at
org.apache.wicket.markup.html.form.AbstractChoice.onComponentTagBody(AbstractChoice.java:353)
at org.apache.wicket.Component.renderComponent(Component.java:2690)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539)
at org.apache.wicket.Component.render(Component.java:2521)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1441)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604)
at
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1528)
at
org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:2012)
at org.apache.wicket.Component.renderComponent(Component.java:2690)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539)
at org.apache.wicket.Component.render(Component.java:2521)
at
org.apache.wicket.markup.html.border.Border$BorderBodyContainer.resolve(Border.java:421)
at
org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:65)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1445)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604)
at
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1528)
at
org.apache.wicket.markup.html.border.Border$BorderBodyContainer.onComponentTagBody(Border.java:403)
at org.apache.wicket.Component.renderComponent(Component.java:2690)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539)
at org.apache.wicket.Component.render(Component.java:2521)
at org.apache.wicket.markup.html.border.Border.resolve(Border.java:287)
at
org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:65)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1445)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604)
at
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1528)
at
org.apache.wicket.markup.html.border.Border$BorderBodyContainer.onComponentTagBody(Border.java:403)
at org.apache.wicket.Component.renderComponent(Component.java:2690)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539)
at org.apache.wicket.Component.render(Component.java:2521)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1441)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604)
at
org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:697)
at
org.apache.wicket.markup.html.border.Border.onComponentTagBody(Border.java:328)
at org.apache.wicket.Component.renderComponent(Component.java:2690)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539)
at org.apache.wicket.Component.render(Component.java:2521)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1441)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604)
at
org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:697)
at
org.apache.wicket.markup.html.border.Border.onComponentTagBody(Border.java:328)
at org.apache.wicket.Component.renderComponent(Component.java:2690)
at 

Re: org.apache.wicket.WicketRuntimeException: No get method defined for class: class java.lang.String expression: userName;

2011-04-18 Thread Clint Checketts
The error is in the model you gave your form. Since you aren't explicitly
stating a model for the DDC, it is assuming a CompoundPropertyModel on the
parent form.

I suspect your form declaration is something like

 new Form(form,new CompoundPropertyModel(getUserName()))

It should be something like

 new Form(form,new CompoundPropertyModel(new User()))

I'm personally not a fan of CPMs and prefer explicitly setting the model for
each of my components.

-Clint

On Mon, Apr 18, 2011 at 11:59 PM, cablepuff cablep...@gmail.com wrote:

 Hi I have the following domain object

 public class User {
   private String email;
   private String firstName;
   private String lastName;
   private Account account;

   public String getUserName() {
  return this.account.getName();
   }

   public void setUserName(String username) {
this.account.setName(username);
  }
 }

 I have a form with dropdownchoice.

 final DropDownChoiceUser userChoice = new
 DropDownChoicePerson(userChoice,
   new ListModelUser(users),
 new ChoiceRendererUser(userName, userName));

 When the page loads i get this error!

 org.apache.wicket.WicketRuntimeException: No get method defined for class:
 class java.lang.String expression: userName
at

 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:492)
at

 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:332)
at

 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:242)
at

 org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:95)
at

 org.apache.wicket.markup.html.form.ChoiceRenderer.getIdValue(ChoiceRenderer.java:145)
at

 org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:166)
at

 org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:879)
at

 org.apache.wicket.markup.html.form.AbstractChoice.onComponentTagBody(AbstractChoice.java:353)
at org.apache.wicket.Component.renderComponent(Component.java:2690)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539)
at org.apache.wicket.Component.render(Component.java:2521)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1441)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604)
at

 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1528)
at
 org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:2012)
at org.apache.wicket.Component.renderComponent(Component.java:2690)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539)
at org.apache.wicket.Component.render(Component.java:2521)
at

 org.apache.wicket.markup.html.border.Border$BorderBodyContainer.resolve(Border.java:421)
at

 org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:65)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1445)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604)
at

 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1528)
at

 org.apache.wicket.markup.html.border.Border$BorderBodyContainer.onComponentTagBody(Border.java:403)
at org.apache.wicket.Component.renderComponent(Component.java:2690)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539)
at org.apache.wicket.Component.render(Component.java:2521)
at
 org.apache.wicket.markup.html.border.Border.resolve(Border.java:287)
at

 org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:65)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1445)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604)
at

 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1528)
at

 org.apache.wicket.markup.html.border.Border$BorderBodyContainer.onComponentTagBody(Border.java:403)
at org.apache.wicket.Component.renderComponent(Component.java:2690)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539)
at org.apache.wicket.Component.render(Component.java:2521)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1441)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1604)
at

 org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:697)
at

 org.apache.wicket.markup.html.border.Border.onComponentTagBody(Border.java:328)
at org.apache.wicket.Component.renderComponent(Component.java:2690)
at