Hi Mehmet, I think you need change this line:

                        @Override
                        protected void setTDokar(TDokar dokart)
                        {
                                dokar = *docType*; -->
DocSearchPage.this.*docType
*=* *dokart;
                        }

anyway, why are you delegating the set/get model calls to
TDokarDocTypeDropDownChoice
? Won't be interest only use the parameter model to maintain the TDokar?

On Tue, Oct 26, 2010 at 7:55 AM, <mehmet.kaplanki...@t-systems.com> wrote:

>  Hello,
> I have a problem with dropdown list.
> Even if I select values in the Dropdown list (see picture below), the
> member variable *docType* is always null .
> Unfortunately I have found no error. I hope you can see why this is.
> Best regards, Mehmet
>
>
> //################## class DocSearchPage
> ######################################
> ...
> public class DocSearchPage extends MainTemplate
> {
>         private TDokar *docType*;
>         ...
>         public DocSearchPage()
>         {
>                 add(*getDocTypeDropDown*("docType"));
>                 ...
>                 add(executeLink("execute"));
>         }
>
>         private *TDokarDocTypeDropDownChoice* *getDocTypeDropDown*(String
> id)
>         {
>                 return new TDokarDocTypeDropDownChoice(id)
>                 {
>                         @Override
>                         protected List<TDokar> getTDokarList()
>                         {
>                                 return getDocTypeList();
>                         }
>
>                         @Override
>                         protected TDokar getTDokar()
>                         {
>                                 return *docType*;
>                         }
>
>                         @Override
>                         protected void setTDokar(TDokar dokart)
>                         {
>                                 dokar = *docType*;
>                         }
>                 };
>         }
>
>         private Link executeLink(String id)
>         {
>                 return new Link(id)
>                 {
>                         @Override
>                         public void onClick()
>                         {
>                                 disItemList =
> session().getUser().getUserDao().searchDIS(*docType*.getDokar(),
> ..);        *//docType** **is null*
>                         }
>                 };
>         }
>
> }
>
> //######################## end DocSearchPage
> ####################################
>
>
>
> ############################## class TDokarDocTypeDropDownChoice  #########
> package de.t_systems.dks.eba.pages.docsearch;
>
> import de.t_systems.dks.eba.beans.basedata.TDokar;
> import org.apache.wicket.markup.html.form.DropDownChoice;
> import org.apache.wicket.markup.html.form.IChoiceRenderer;
> import org.apache.wicket.model.IModel;
> import org.apache.wicket.model.Model;
>
> import java.util.List;
>
> public abstract class TDokarDocTypeDropDownChoice extends DropDownChoice
> {
>
>         public TDokarDocTypeDropDownChoice(String id)
>         {
>                 super(id);
>                 setModel(model());
>                 setChoices(getTDokarList());
>                 setChoiceRenderer(RENDERER);
>         }
>
>         private IModel model()
>         {
>                 return new Model()
>                 {
>                         @Override
>                         public Object getObject()
>                         {
>                                 return getTDokar();
>                         }
>
>                         @Override
>                         public void setObject(Object object)
>                         {
>                                 setTDokar((TDokar) object);
>                         }
>                 };
>         }
>
>         private static final IChoiceRenderer RENDERER = new
> IChoiceRenderer()
>         {
>                 @Override
>                 public Object getDisplayValue(final Object object)
>                 {
>                         TDokar dokar = (TDokar) object;
>                         return dokar.getDokar();
>                 }
>
>                 @Override
>                 public String getIdValue(final Object object, final int
> index)
>                 {
>                         return ((TDokar) object).getDokar();
>                 }
>         };
>
>         protected abstract TDokar getTDokar();
>         protected abstract void setTDokar(TDokar tDokar);
>         protected abstract List<TDokar> getTDokarList();
> }
>
>
> ############################## TDokarDocTypeDropDownChoice
> #############''''''''''''''''''
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
Pedro Henrique Oliveira dos Santos

Reply via email to