You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sathish Gopal <sa...@emirates.com> on 2008/04/02 06:59:18 UTC

Reg: issue in using ListView component

Hi all,

I'm trying to create a table using wickets repeater component ListView. The
problem that i face now is i have search panel where search query will be
entered. When the form is submitted the table needs to be populated with
data received from the Database. The data received from the database is a
list of DataTransferObjects. I need to pass this List of transferObjects to
the ListView. But the listview expects that this object should be passed  at
the time of creation. i.e

add(new ListView(&quot;rows&quot;, listData){
 public void populateItem(final ListItem item)
  	{
  		final UserDetails user = (UserDetails)item.getModelObject();
  		item.add(new Label("id", user.getId()));
  	}
  });

I cannot pass the list of DataTransferObject until the user enters search
criteria and submits the form.
Is there any better way to do this?
-- 
View this message in context: http://www.nabble.com/Reg%3A-issue-in-using-ListView-component-tp16442209p16442209.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Reg: issue in using ListView component

Posted by Al Maw <wi...@almaw.com>.
Or search this list for a thread called "refreshing page".

On Wed, Apr 2, 2008 at 4:44 PM, Igor Vaynberg <ig...@gmail.com>
wrote:

> new model(listdata) is the same as a static reference. like i said,
> read the models page because without understanding them you wont get
> far.
>
> basically you would have a loadabledetachablemodel that in its load
> performs the search query based on user's criteria.
>
> -igor
>
>
> On Wed, Apr 2, 2008 at 1:06 AM, Sathish Gopal <sa...@emirates.com>
> wrote:
> >
> >  Hi,
> >
> >  How do i wrap list to this model.
> >  As i construct this ListView component, pass the DTO list wrapped in a
> >  model....
> >
> >  add(new ListView("id", new Model(listData))){
> >  ......................
> >  }
> >
> >  This is not helping as the component is rendered nothing shows up. I
> think
> >  i'm missing something.
> >
> >  Do i need to use some other Model (A Dynamic model). Do i need to
> override
> >  initModel()...
> >
> >  Am i doing it the right way?
> >
> >
> >
> >
> >  igor.vaynberg wrote:
> >  >
> >  > read models wiki page
> >  >
> >  > -igor
> >  >
> >  >
> >  > On Tue, Apr 1, 2008 at 9:59 PM, Sathish Gopal <
> satish.gopal@emirates.com>
> >  > wrote:
> >  >>
> >  >>  Hi all,
> >  >>
> >  >>  I'm trying to create a table using wickets repeater component
> ListView.
> >  >> The
> >  >>  problem that i face now is i have search panel where search query
> will
> >  >> be
> >  >>  entered. When the form is submitted the table needs to be populated
> with
> >  >>  data received from the Database. The data received from the
> database is
> >  >> a
> >  >>  list of DataTransferObjects. I need to pass this List of
> transferObjects
> >  >> to
> >  >>  the ListView. But the listview expects that this object should be
> passed
> >  >> at
> >  >>  the time of creation. i.e
> >  >>
> >  >>  add(new ListView(&quot;rows&quot;, listData){
> >  >>   public void populateItem(final ListItem item)
> >  >>         {
> >  >>                 final UserDetails user =
> >  >> (UserDetails)item.getModelObject();
> >  >>                 item.add(new Label("id", user.getId()));
> >  >>         }
> >  >>   });
> >  >>
> >  >>  I cannot pass the list of DataTransferObject until the user enters
> >  >> search
> >  >>  criteria and submits the form.
> >  >>  Is there any better way to do this?
> >  >>  --
> >  >>  View this message in context:
> >  >>
> http://www.nabble.com/Reg%3A-issue-in-using-ListView-component-tp16442209p16442209.html
> >  >>  Sent from the Wicket - User mailing list archive at Nabble.com.
> >  >>
> >  >>
> >  >>
>  ---------------------------------------------------------------------
> >  >>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >  >>  For additional commands, e-mail: users-help@wicket.apache.org
> >  >>
> >  >>
> >  >
> >  > ---------------------------------------------------------------------
> >  > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >  > For additional commands, e-mail: users-help@wicket.apache.org
> >  >
> >  >
> >  >
> >
> >  --
> >  View this message in context:
> http://www.nabble.com/Reg%3A-issue-in-using-ListView-component-tp16442209p16444480.html
> >
> >
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> >  ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >  For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Reg: issue in using ListView component

Posted by Igor Vaynberg <ig...@gmail.com>.
new model(listdata) is the same as a static reference. like i said,
read the models page because without understanding them you wont get
far.

basically you would have a loadabledetachablemodel that in its load
performs the search query based on user's criteria.

-igor


On Wed, Apr 2, 2008 at 1:06 AM, Sathish Gopal <sa...@emirates.com> wrote:
>
>  Hi,
>
>  How do i wrap list to this model.
>  As i construct this ListView component, pass the DTO list wrapped in a
>  model....
>
>  add(new ListView("id", new Model(listData))){
>  ......................
>  }
>
>  This is not helping as the component is rendered nothing shows up. I think
>  i'm missing something.
>
>  Do i need to use some other Model (A Dynamic model). Do i need to override
>  initModel()...
>
>  Am i doing it the right way?
>
>
>
>
>  igor.vaynberg wrote:
>  >
>  > read models wiki page
>  >
>  > -igor
>  >
>  >
>  > On Tue, Apr 1, 2008 at 9:59 PM, Sathish Gopal <sa...@emirates.com>
>  > wrote:
>  >>
>  >>  Hi all,
>  >>
>  >>  I'm trying to create a table using wickets repeater component ListView.
>  >> The
>  >>  problem that i face now is i have search panel where search query will
>  >> be
>  >>  entered. When the form is submitted the table needs to be populated with
>  >>  data received from the Database. The data received from the database is
>  >> a
>  >>  list of DataTransferObjects. I need to pass this List of transferObjects
>  >> to
>  >>  the ListView. But the listview expects that this object should be passed
>  >> at
>  >>  the time of creation. i.e
>  >>
>  >>  add(new ListView(&quot;rows&quot;, listData){
>  >>   public void populateItem(final ListItem item)
>  >>         {
>  >>                 final UserDetails user =
>  >> (UserDetails)item.getModelObject();
>  >>                 item.add(new Label("id", user.getId()));
>  >>         }
>  >>   });
>  >>
>  >>  I cannot pass the list of DataTransferObject until the user enters
>  >> search
>  >>  criteria and submits the form.
>  >>  Is there any better way to do this?
>  >>  --
>  >>  View this message in context:
>  >> http://www.nabble.com/Reg%3A-issue-in-using-ListView-component-tp16442209p16442209.html
>  >>  Sent from the Wicket - User mailing list archive at Nabble.com.
>  >>
>  >>
>  >>  ---------------------------------------------------------------------
>  >>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>  >>  For additional commands, e-mail: users-help@wicket.apache.org
>  >>
>  >>
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>  > For additional commands, e-mail: users-help@wicket.apache.org
>  >
>  >
>  >
>
>  --
>  View this message in context: http://www.nabble.com/Reg%3A-issue-in-using-ListView-component-tp16442209p16444480.html
>
>
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>  For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Reg: issue in using ListView component

Posted by Sathish Gopal <sa...@emirates.com>.
Hi,

How do i wrap list to this model.
As i construct this ListView component, pass the DTO list wrapped in a
model....

add(new ListView("id", new Model(listData))){
......................
}

This is not helping as the component is rendered nothing shows up. I think
i'm missing something.

Do i need to use some other Model (A Dynamic model). Do i need to override
initModel()...

Am i doing it the right way?


igor.vaynberg wrote:
> 
> read models wiki page
> 
> -igor
> 
> 
> On Tue, Apr 1, 2008 at 9:59 PM, Sathish Gopal <sa...@emirates.com>
> wrote:
>>
>>  Hi all,
>>
>>  I'm trying to create a table using wickets repeater component ListView.
>> The
>>  problem that i face now is i have search panel where search query will
>> be
>>  entered. When the form is submitted the table needs to be populated with
>>  data received from the Database. The data received from the database is
>> a
>>  list of DataTransferObjects. I need to pass this List of transferObjects
>> to
>>  the ListView. But the listview expects that this object should be passed 
>> at
>>  the time of creation. i.e
>>
>>  add(new ListView(&quot;rows&quot;, listData){
>>   public void populateItem(final ListItem item)
>>         {
>>                 final UserDetails user =
>> (UserDetails)item.getModelObject();
>>                 item.add(new Label("id", user.getId()));
>>         }
>>   });
>>
>>  I cannot pass the list of DataTransferObject until the user enters
>> search
>>  criteria and submits the form.
>>  Is there any better way to do this?
>>  --
>>  View this message in context:
>> http://www.nabble.com/Reg%3A-issue-in-using-ListView-component-tp16442209p16442209.html
>>  Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>  For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Reg%3A-issue-in-using-ListView-component-tp16442209p16444480.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Reg: issue in using ListView component

Posted by Igor Vaynberg <ig...@gmail.com>.
read models wiki page

-igor


On Tue, Apr 1, 2008 at 9:59 PM, Sathish Gopal <sa...@emirates.com> wrote:
>
>  Hi all,
>
>  I'm trying to create a table using wickets repeater component ListView. The
>  problem that i face now is i have search panel where search query will be
>  entered. When the form is submitted the table needs to be populated with
>  data received from the Database. The data received from the database is a
>  list of DataTransferObjects. I need to pass this List of transferObjects to
>  the ListView. But the listview expects that this object should be passed  at
>  the time of creation. i.e
>
>  add(new ListView(&quot;rows&quot;, listData){
>   public void populateItem(final ListItem item)
>         {
>                 final UserDetails user = (UserDetails)item.getModelObject();
>                 item.add(new Label("id", user.getId()));
>         }
>   });
>
>  I cannot pass the list of DataTransferObject until the user enters search
>  criteria and submits the form.
>  Is there any better way to do this?
>  --
>  View this message in context: http://www.nabble.com/Reg%3A-issue-in-using-ListView-component-tp16442209p16442209.html
>  Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>  For additional commands, e-mail: users-help@wicket.apache.org
>
>

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