Re: DropDownChoice problem

2010-05-28 Thread James Carman
Make sure it's using the markup files you think it is.  Turn on the logging
for the markup finder thingy.

On May 28, 2010 5:23 PM, "Matthieu"  wrote:


Hi,

thanks for you input! It's not a html problem, when i copy/paste the
"english" html code (who is working) into my _fr html file, i get the same
error...

yes, i ommited "" in this mail but not in my code :)

and i write my mails in html format so i have to break the html code with \


--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-problem-tp2233814p2235230.html

Sent from the Wicket - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-...


Re: DropDownChoice problem

2010-05-28 Thread Matthieu

Hi,

thanks for you input! It's not a html problem, when i copy/paste the
"english" html code (who is working) into my _fr html file, i get the same
error...

yes, i ommited "" in this mail but not in my code :)

and i write my mails in html format so i have to break the html code with \


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-problem-tp2233814p2235230.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: DropDownChoice problem

2010-05-27 Thread Dr. Wolf Blecher
Hi,

just a few guesses:
- I don't think that this is according to a language problem.
- as far as I can see in your HTML code the DropDown is inside the , so maybe this is an issue
- may be you just ommited it, but I don't see a closing tag for your 
- If I remember correctly, there (has been?) is an issue about wicket and the
short format of closing tags like in your input tag. May be you can try

- According to the error messages you presented, the error is not in the Java
Code but in the HTML markup you provided, so may be you have to look here
I'm not an HTML expert and may be this is valid HTML, but why do you use e.g.
<\span> instead of  as opening tag?

Good luck

Wolf

Am 27.05.2010 23:26, schrieb Matthieu:
> 
> Hello,
> 
> 
> I've a problem with the DropDownChoice (and maybe language?). 
> 
> I've a Panel who's rendering perfectly when i set the language in "english"
> and not rendering when i set in "french"... 
> 
> 
> The message from wicket :
> 
> WicketMessage: The component(s) below failed to render. A common problem is
> that you have 
> added a component in code but forgot to reference it in the markup (thus the
> component will never be rendered).
>  
> 1. [Component id = address_city]
>  
> Root cause:
>  
> org.apache.wicket.WicketRuntimeException: The component(s) below failed to
> render. A common problem is that you 
> have added a component in code but forgot to reference it in the markup
> (thus the component will never be rendered).
> 
> 
> 1. [Component id = address_city]
> 
> 
> My java code is :
> 
> 
> final DropDownChoice cityChoice = new DropDownChoice("address_city", new
> PropertyModel
> (form.getModelObject(), "city"), cityList); (here you can see the
> "address_city")
> 
> 
> final AjaxFormComponentUpdatingBehavior updatingBehavior2 = new
> AjaxFormComponentUpdatingBehavior("onchange") {
> 
>   @Override
>   protected void onUpdate(AjaxRequestTarget target) {
> 
>   getAddress(form, customer_address, cityChoice, the_map);
> 
>   }
> 
> };
> 
> cityChoice.add(updatingBehavior2);
> 
> 
> form.add(cityChoice);
> 
>  
> My html code is :
> 
> 
> <\span wicket:id="address_border"><\input wicket:id="address" id="address" 
> class="address"
> title="an address in Belgium" type="text" /><\select wicket:id="address_city">
> 
> I don't really understand why, anyone to explain me the problem?
> 
> 
> Thank you.

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



Re: DropDownChoice problem

2010-04-29 Thread Josh Kamau
Thanks all for your response.

It worked after i override the equals Method on my beans

Thanks again

Regards
Josh

On Wed, Apr 28, 2010 at 5:28 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> I remember having a similar problem because missing the equal on some
> bean. Could that be the case?
>
> Ernesto
>
> On Wed, Apr 28, 2010 at 4:20 PM, Josh Kamau  wrote:
> > Hi team
> >
> > I need your help
> >
> > I am using a DropDownChoice in a form as follows:
> >
> > DropDownChoice lstNationality = new
> > DropDownChoice("nationality",getNationalities());
> >
> >  The form has a CompoundPropertyModel
> >
> > After adding the dropdown to the form, i am able to save the record
> > properly. However, when i display a  form with an existing record,
> >
> > the DropDownChoice is not showing the current 'nationality' and it is
> only
> > showing "Choose One";
> >
> > When i replace is with a textfield, the correct record is displayed. Is
> > where could i be going wrong?
> >
> > Regards.
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: DropDownChoice problem

2010-04-28 Thread Swanthe Lindgren

I had the same problem you do. Solved it by doing

lstNationality.setDefaultModel(new 
PropertyModel(getDefaultModel(), "nationality"));


but I bet you that Igor is gonna jump right in an say how its supposed 
to be done and why.


//Swanthe

On 2010-04-28 16:20, Josh Kamau wrote:

Hi team

I need your help

I am using a DropDownChoice  in a form as follows:

DropDownChoice  lstNationality = new
DropDownChoice("nationality",getNationalities());

  The form has a CompoundPropertyModel

After adding the dropdown to the form, i am able to save the record
properly. However, when i display a  form with an existing record,

the DropDownChoice is not showing the current 'nationality' and it is only
showing "Choose One";

When i replace is with a textfield, the correct record is displayed. Is
where could i be going wrong?

Regards.

   



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



Re: DropDownChoice problem

2010-04-28 Thread Xavier López
Hi,

I also bumped into this matter when starting with Wicket, make sure the
Collection returned by getNationalities() contains the value of the
'nationality' attribute of the CPM's backing object, or use a suitable
ChoiceRenderer, as Wilhelmsen suggests, in order to be able to put as
choices the same objects you can have in the 'nationality' attribute.

I think the DDC's ModelObject has to be/will be one of the objects in the
choices list before rendering/after form submission

Cheers,
Xavier

2010/4/28 Wilhelmsen Tor Iver 

> > After adding the dropdown to the form, i am able to save the record
> > properly. However, when i display a  form with an existing record,
> >
> > the DropDownChoice is not showing the current 'nationality' and it is
> > only
> > showing "Choose One";
>
> Sounds like Wicket gets confused regarding value/id, try setting an
> IChoiceRenderer, e.g.
>
> lstNationality.setChoiceRenderer(new ChoiceRenderer("name", "id"));
>
> - Tor Iver
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
"Klein bottle for rent--inquire within."


Re: DropDownChoice problem

2010-04-28 Thread Ernesto Reinaldo Barreiro
I remember having a similar problem because missing the equal on some
bean. Could that be the case?

Ernesto

On Wed, Apr 28, 2010 at 4:20 PM, Josh Kamau  wrote:
> Hi team
>
> I need your help
>
> I am using a DropDownChoice in a form as follows:
>
> DropDownChoice lstNationality = new
> DropDownChoice("nationality",getNationalities());
>
>  The form has a CompoundPropertyModel
>
> After adding the dropdown to the form, i am able to save the record
> properly. However, when i display a  form with an existing record,
>
> the DropDownChoice is not showing the current 'nationality' and it is only
> showing "Choose One";
>
> When i replace is with a textfield, the correct record is displayed. Is
> where could i be going wrong?
>
> Regards.
>

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



Re: DropDownChoice problem

2008-04-18 Thread Johan Compagner
Yes i also hope that these questions are finally dont come any more.
Checkout the current trunk and its way more clear

On 4/18/08, John Krasnay <[EMAIL PROTECTED]> wrote:
> This has to qualify as one of the most common questions on the list!
> Hopefully, generics in 1.4 will make it more clear.
>
> The items in your list have to be the same type as the value model (the
> PropertyModel in your case). In your case, Wicket is complaining because
> the PropertyModel returns a long, but the list contains Authors.
>
> The cleanest solution is to change your property type to Author. If you
> can't, you can either give the DDC a list of author IDs instead of
> Authors (in which case you need to implement
> ChoiceRenderer.getDisplayValue to look up the author's name given an ID)
> or implement a custom model instead of the property model:
>
> IModel authorModel = IModel() {
>   public Object getObject() {
> return lookUpAuthor(article.getArticleAuthorId());
>   }
>   public void setObject(Object object) {
> article.setArticleAuthorId(((Author) object).getId());
>   }
> }
>
> HTH
>
> jk
>
>
> On Thu, Apr 17, 2008 at 04:05:45PM -0500, Andrew Broderick wrote:
> > Hi,
> >
> > I have a DropDownChoice in a form, with markup:
> >
> > 
> >
> > In my Form class, I add it like this:
> >
> >   add(new DropDownChoice("authors", new
> PropertyModel(this.article, "articleAuthorId"),
> >   acService.getAuthors(), new
> ChoiceRenderer("authorDisplayName", "articleAuthorId")));
> >
> > this.article refers to a class that has a property of articleAuthorId:
> >
> >   public long getArticleAuthorId() {
> > return articleAuthorId;
> >   }
> >
> >   public void setArticleAuthorId(long articleAuthorId) {
> > this.articleAuthorId = articleAuthorId;
> >   }
> >
> > The acService.getAuthors() call gets a list of Author objects:
> >
> > public class Author implements Serializable {
> >
> >   private long articleAuthorId;
> >   private String authorFirstName;
> >   private String authorMiddleName;
> >   private String authorLastName;
> >   private String authorDisplayName;
> >
> >
> >   public String getAuthorFirstName() {
> > return authorFirstName;
> >   }
> >   public void setAuthorFirstName(String authorFirstName) {
> > this.authorFirstName = authorFirstName;
> >   }
> >   public String getAuthorMiddleName() {
> > return authorMiddleName;
> >   }
> >   public void setAuthorMiddleName(String authorMiddleName) {
> > this.authorMiddleName = authorMiddleName;
> >   }
> >   public String getAuthorLastName() {
> > return authorLastName;
> >   }
> >   public void setAuthorLastName(String authorLastName) {
> > this.authorLastName = authorLastName;
> >   }
> >   public String getAuthorDisplayName() {
> > return authorDisplayName;
> >   }
> >   public void setAuthorDisplayName(String authorDisplayName) {
> > this.authorDisplayName = authorDisplayName;
> >   }
> >   public Long getId()
> >   {
> > return new Long(getArticleAuthorId());
> >   }
> >   public long getArticleAuthorId() {
> > return articleAuthorId;
> >   }
> >   public void setArticleAuthorId(long articleAuthorId) {
> > this.articleAuthorId = articleAuthorId;
> >   }
> > }
> >
> > The error I get when I try to render the page is:
> >
> > WicketMessage: No get method defined for class: class java.lang.Long
> expression: articleAuthorId
> >
> > I don't understand this, as the class used for the choices is Author, not
> java.lang.Long 
> >
> > Any help appreciated!
> >
> > Thanks
> >
> >
> >
> >
> > ___
> >
> > The  information in this email or in any file attached
> > hereto is intended only for the personal and confiden-
> > tial  use  of  the individual or entity to which it is
> > addressed and may contain information that is  propri-
> > etary  and  confidential.  If you are not the intended
> > recipient of this message you are hereby notified that
> > any  review, dissemination, distribution or copying of
> > this message is strictly prohibited.  This  communica-
> > tion  is  for information purposes only and should not
> > be regarded as an offer to sell or as  a  solicitation
> > of an offer to buy any financial product. Email trans-
> > mission cannot be guaranteed to be  secure  or  error-
> > free. P6070214
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DropDownChoice problem

2008-04-17 Thread John Krasnay
This has to qualify as one of the most common questions on the list!
Hopefully, generics in 1.4 will make it more clear.

The items in your list have to be the same type as the value model (the
PropertyModel in your case). In your case, Wicket is complaining because
the PropertyModel returns a long, but the list contains Authors.

The cleanest solution is to change your property type to Author. If you
can't, you can either give the DDC a list of author IDs instead of
Authors (in which case you need to implement
ChoiceRenderer.getDisplayValue to look up the author's name given an ID)
or implement a custom model instead of the property model:

IModel authorModel = IModel() {
  public Object getObject() {
return lookUpAuthor(article.getArticleAuthorId());
  }
  public void setObject(Object object) {
article.setArticleAuthorId(((Author) object).getId());
  }
}

HTH

jk


On Thu, Apr 17, 2008 at 04:05:45PM -0500, Andrew Broderick wrote:
> Hi,
> 
> I have a DropDownChoice in a form, with markup:
> 
> 
> 
> In my Form class, I add it like this:
> 
>   add(new DropDownChoice("authors", new 
> PropertyModel(this.article, "articleAuthorId"),
>   acService.getAuthors(), new 
> ChoiceRenderer("authorDisplayName", "articleAuthorId")));
> 
> this.article refers to a class that has a property of articleAuthorId:
> 
>   public long getArticleAuthorId() {
> return articleAuthorId;
>   }
> 
>   public void setArticleAuthorId(long articleAuthorId) {
> this.articleAuthorId = articleAuthorId;
>   }
> 
> The acService.getAuthors() call gets a list of Author objects:
> 
> public class Author implements Serializable {
> 
>   private long articleAuthorId;
>   private String authorFirstName;
>   private String authorMiddleName;
>   private String authorLastName;
>   private String authorDisplayName;
> 
> 
>   public String getAuthorFirstName() {
> return authorFirstName;
>   }
>   public void setAuthorFirstName(String authorFirstName) {
> this.authorFirstName = authorFirstName;
>   }
>   public String getAuthorMiddleName() {
> return authorMiddleName;
>   }
>   public void setAuthorMiddleName(String authorMiddleName) {
> this.authorMiddleName = authorMiddleName;
>   }
>   public String getAuthorLastName() {
> return authorLastName;
>   }
>   public void setAuthorLastName(String authorLastName) {
> this.authorLastName = authorLastName;
>   }
>   public String getAuthorDisplayName() {
> return authorDisplayName;
>   }
>   public void setAuthorDisplayName(String authorDisplayName) {
> this.authorDisplayName = authorDisplayName;
>   }
>   public Long getId()
>   {
> return new Long(getArticleAuthorId());
>   }
>   public long getArticleAuthorId() {
> return articleAuthorId;
>   }
>   public void setArticleAuthorId(long articleAuthorId) {
> this.articleAuthorId = articleAuthorId;
>   }
> }
> 
> The error I get when I try to render the page is:
> 
> WicketMessage: No get method defined for class: class java.lang.Long 
> expression: articleAuthorId
> 
> I don't understand this, as the class used for the choices is Author, not 
> java.lang.Long 
> 
> Any help appreciated!
> 
> Thanks
> 
> 
> 
> 
> ___
> 
> The  information in this email or in any file attached
> hereto is intended only for the personal and confiden-
> tial  use  of  the individual or entity to which it is
> addressed and may contain information that is  propri-
> etary  and  confidential.  If you are not the intended
> recipient of this message you are hereby notified that
> any  review, dissemination, distribution or copying of
> this message is strictly prohibited.  This  communica-
> tion  is  for information purposes only and should not
> be regarded as an offer to sell or as  a  solicitation
> of an offer to buy any financial product. Email trans-
> mission cannot be guaranteed to be  secure  or  error-
> free. P6070214

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: DropDownChoice problem

2008-04-17 Thread Andrew Broderick
I tried changing both the property being set by the DropDownChoice and the 
property used in the Author class to Long, and it didn't make any 
difference any help appreciated!

Thanks

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ryan Gravener
Sent: Thursday, April 17, 2008 4:23 PM
To: users@wicket.apache.org
Subject: Re: DropDownChoice problem

Use Long instead of long

On Thu, Apr 17, 2008 at 5:05 PM, Andrew Broderick
<[EMAIL PROTECTED]> wrote:
> Hi,
>
>  I have a DropDownChoice in a form, with markup:
>
>  
>
>  In my Form class, I add it like this:
>
>   add(new DropDownChoice("authors", new 
> PropertyModel(this.article, "articleAuthorId"),
>   acService.getAuthors(), new 
> ChoiceRenderer("authorDisplayName", "articleAuthorId")));
>
>  this.article refers to a class that has a property of articleAuthorId:
>
>   public long getArticleAuthorId() {
> return articleAuthorId;
>   }
>
>   public void setArticleAuthorId(long articleAuthorId) {
> this.articleAuthorId = articleAuthorId;
>   }
>
>  The acService.getAuthors() call gets a list of Author objects:
>
>  public class Author implements Serializable {
>
>   private long articleAuthorId;
>   private String authorFirstName;
>   private String authorMiddleName;
>   private String authorLastName;
>   private String authorDisplayName;
>
>
>   public String getAuthorFirstName() {
> return authorFirstName;
>   }
>   public void setAuthorFirstName(String authorFirstName) {
> this.authorFirstName = authorFirstName;
>   }
>   public String getAuthorMiddleName() {
> return authorMiddleName;
>   }
>   public void setAuthorMiddleName(String authorMiddleName) {
> this.authorMiddleName = authorMiddleName;
>   }
>   public String getAuthorLastName() {
> return authorLastName;
>   }
>   public void setAuthorLastName(String authorLastName) {
> this.authorLastName = authorLastName;
>   }
>   public String getAuthorDisplayName() {
> return authorDisplayName;
>   }
>   public void setAuthorDisplayName(String authorDisplayName) {
> this.authorDisplayName = authorDisplayName;
>   }
>   public Long getId()
>   {
> return new Long(getArticleAuthorId());
>   }
>   public long getArticleAuthorId() {
> return articleAuthorId;
>   }
>   public void setArticleAuthorId(long articleAuthorId) {
> this.articleAuthorId = articleAuthorId;
>   }
>  }
>
>  The error I get when I try to render the page is:
>
>  WicketMessage: No get method defined for class: class java.lang.Long 
> expression: articleAuthorId
>
>  I don't understand this, as the class used for the choices is Author, not 
> java.lang.Long 
>
>  Any help appreciated!
>
>  Thanks
>
>
>
>
>  ___
>
>  The  information in this email or in any file attached
>  hereto is intended only for the personal and confiden-
>  tial  use  of  the individual or entity to which it is
>  addressed and may contain information that is  propri-
>  etary  and  confidential.  If you are not the intended
>  recipient of this message you are hereby notified that
>  any  review, dissemination, distribution or copying of
>  this message is strictly prohibited.  This  communica-
>  tion  is  for information purposes only and should not
>  be regarded as an offer to sell or as  a  solicitation
>  of an offer to buy any financial product. Email trans-
>  mission cannot be guaranteed to be  secure  or  error-
>  free. P6070214
>



--
Ryan Gravener
http://ryangravener.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DropDownChoice problem

2008-04-17 Thread Ryan Gravener
Use Long instead of long

On Thu, Apr 17, 2008 at 5:05 PM, Andrew Broderick
<[EMAIL PROTECTED]> wrote:
> Hi,
>
>  I have a DropDownChoice in a form, with markup:
>
>  
>
>  In my Form class, I add it like this:
>
>   add(new DropDownChoice("authors", new 
> PropertyModel(this.article, "articleAuthorId"),
>   acService.getAuthors(), new 
> ChoiceRenderer("authorDisplayName", "articleAuthorId")));
>
>  this.article refers to a class that has a property of articleAuthorId:
>
>   public long getArticleAuthorId() {
> return articleAuthorId;
>   }
>
>   public void setArticleAuthorId(long articleAuthorId) {
> this.articleAuthorId = articleAuthorId;
>   }
>
>  The acService.getAuthors() call gets a list of Author objects:
>
>  public class Author implements Serializable {
>
>   private long articleAuthorId;
>   private String authorFirstName;
>   private String authorMiddleName;
>   private String authorLastName;
>   private String authorDisplayName;
>
>
>   public String getAuthorFirstName() {
> return authorFirstName;
>   }
>   public void setAuthorFirstName(String authorFirstName) {
> this.authorFirstName = authorFirstName;
>   }
>   public String getAuthorMiddleName() {
> return authorMiddleName;
>   }
>   public void setAuthorMiddleName(String authorMiddleName) {
> this.authorMiddleName = authorMiddleName;
>   }
>   public String getAuthorLastName() {
> return authorLastName;
>   }
>   public void setAuthorLastName(String authorLastName) {
> this.authorLastName = authorLastName;
>   }
>   public String getAuthorDisplayName() {
> return authorDisplayName;
>   }
>   public void setAuthorDisplayName(String authorDisplayName) {
> this.authorDisplayName = authorDisplayName;
>   }
>   public Long getId()
>   {
> return new Long(getArticleAuthorId());
>   }
>   public long getArticleAuthorId() {
> return articleAuthorId;
>   }
>   public void setArticleAuthorId(long articleAuthorId) {
> this.articleAuthorId = articleAuthorId;
>   }
>  }
>
>  The error I get when I try to render the page is:
>
>  WicketMessage: No get method defined for class: class java.lang.Long 
> expression: articleAuthorId
>
>  I don't understand this, as the class used for the choices is Author, not 
> java.lang.Long 
>
>  Any help appreciated!
>
>  Thanks
>
>
>
>
>  ___
>
>  The  information in this email or in any file attached
>  hereto is intended only for the personal and confiden-
>  tial  use  of  the individual or entity to which it is
>  addressed and may contain information that is  propri-
>  etary  and  confidential.  If you are not the intended
>  recipient of this message you are hereby notified that
>  any  review, dissemination, distribution or copying of
>  this message is strictly prohibited.  This  communica-
>  tion  is  for information purposes only and should not
>  be regarded as an offer to sell or as  a  solicitation
>  of an offer to buy any financial product. Email trans-
>  mission cannot be guaranteed to be  secure  or  error-
>  free. P6070214
>



-- 
Ryan Gravener
http://ryangravener.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DropDownChoice problem

2008-01-25 Thread Mathias P.W Nilsson

Yes, I have read all about it. It solved when I used just new Model() and not
PropertyModel


-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-problem-tp15095051p15097813.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DropDownChoice problem

2008-01-25 Thread icecode

sorry dudu, i am new to wicket as well, 
have you came across this link yet? 
http://cwiki.apache.org/WICKET/dropdownchoice-examples.html

if not give it a shot


Mathias P.W Nilsson wrote:
> 
> 
> 
> Wicket Quickstart Archetype Homepage
> 
> 
> 
>   
>   
> Wicket Quickstart Archetype Homepage
> 
> message will be here
>   
>   
>   Some Person
>   Some Other Person
> 
> 
>   
>   
> 
> 
> 
> 
> ===
> CODE
> ===
> package se.boardstore.model;
> 
> import java.io.Serializable;
> import java.util.ArrayList;
> import java.util.List;
> 
> import se.boardstore.entities.store.Store;
> 
> public class Category implements Serializable{
>   
>   private Long id;
>   private String identifier;
>   private Long sortOrder;
>   private String name;
>   private String shortDescription;
>   private String longDescription;
>   private Store store;
>   private Long cachedBalance;
>   private List categories = new ArrayList();
>   
>   public Category(){
>   
>   }
> 
>   public String getIdentifier() {
>   return identifier;
>   }
> 
>   public void setIdentifier(String identifier) {
>   this.identifier = identifier;
>   }
> 
>   public Long getSortOrder() {
>   return sortOrder;
>   }
> 
>   public void setSortOrder(Long sortOrder) {
>   this.sortOrder = sortOrder;
>   }
> 
>   public Long getId() {
>   return id;
>   }
>   
>   public String toString(){
>   StringBuffer buffer = new StringBuffer();
>   buffer.append( "[Id: " + id + "]"  );
>   buffer.append( "[Identifier: " + identifier + "]"  );
>   buffer.append( "[Sortorder: " + sortOrder + "]"  );
>   
>   return buffer.toString();
>   }
> 
> 
>   public String getName() {
>   return name;
>   }
> 
> 
>   public void setName(String name) {
>   this.name = name;
>   }
> 
> 
>   public String getShortDescription() {
>   return shortDescription;
>   }
> 
> 
>   public void setShortDescription(String shortDescription) {
>   this.shortDescription = shortDescription;
>   }
> 
> 
>   public String getLongDescription() {
>   return longDescription;
>   }
> 
> 
>   public void setLongDescription(String longDescription) {
>   this.longDescription = longDescription;
>   }
> 
> 
>   public Store getStore() {
>   return store;
>   }
> 
> 
>   public void setStore(Store store) {
>   this.store = store;
>   }
> 
> 
>   public List getCategories() {
>   return categories;
>   }
> 
> 
>   public void setId(Long id) {
>   this.id = id;
>   }
> 
>   public Long getCachedBalance() {
>   return cachedBalance;
>   }
> 
>   public void setCachedBalance(Long cachedBalance) {
>   this.cachedBalance = cachedBalance;
>   }
>   
>   public void addCategory( Category category ){
>   this.categories.add( category );
>   }
>   
> }
> 
> 
> 
> CODE
> =
> 
> 
> package se.edgesoft;
> 
> import java.io.Serializable;
> import java.util.List;
> 
> import org.apache.wicket.PageParameters;
> import org.apache.wicket.extensions.markup.html.form.select.SelectOption;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.markup.html.form.Button;
> import org.apache.wicket.markup.html.form.DropDownChoice;
> import org.apache.wicket.markup.html.form.Form;
> import org.apache.wicket.markup.html.form.IChoiceRenderer;
> import org.apache.wicket.markup.html.list.ListItem;
> import org.apache.wicket.markup.html.list.ListView;
> import org.apache.wicket.model.LoadableDetachableModel;
> import org.apache.wicket.model.PropertyModel;
> import org.apache.wicket.spring.injection.annot.SpringBean;
> 
> import se.boardstore.dao.CategoryDAO;
> 
> 
> /**
>  * Homepage
>  */
> public class HomePage extends WebPage {
> 
>   private static final long serialVersionUID = 1L;
>   @SpringBean(name="categoryDao")
>   private CategoryDAO categoryDAO;
> List categories;
> public HomePage(final PageParameters parameters) {
>   
> Form form = new LoginForm( "loginForm" );
>   add(form);
> 
> form.add(new Label("message", "If you see this message wicket is
> properly configured and running"));
> 
> categories =
> categoryDAO.getProxiedCategories(se.boardstore.entities.store.Store.EDDYEMERY_EU);
>   
> DropDownCho

Re: DropDownChoice problem

2008-01-25 Thread icecode

can you post some code? and wicket tags?


Mathias P.W Nilsson wrote:
> 
> Hi!
> 
> I can't get the simples DropDownChoice to work! I want to return the
> object in my model but it returns string
> 
> This is what I have so far. I have a ArrayList of Category objects. Each
> of this Objects have a list of child Categories. I want to render the
> Category id and name in the list and when onSelectionChanged is fired I
> want to Category object. Can this be done? In my renderer I want the
> childcategories to be indented
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-problem-tp15095051p15096272.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]