if you do not need to hold on to the data structure between requests
then there is no need to keep any references to it in the components
themselves. pass it into the constructor, create whatever components
you need to represent it in the ui and throw it away. you may have to
create wrappers around parts of it for some components, i suppose, but
you should be able to getaway without keeping a reference to it in
most cases.

a simplified example may be

class mypanel extends panel {
  public mypanel (string id, nonserializable data) {
     add(new label("name", data.getname()));
     add(new label("author", data.getauthor()));

     // instead of using a listview for repeaters use repeatingview
which lets you construct a repeater without a backing model
     repeatingview rows=new repeatingview();
     add(rows);
     for (change:data.getchanges()) {
       webmarkupcontainer row=new webmarkupcontainer(rows.newchildid());
       rows.add(row);
       row.add(new label("author", change.getauthor());
       row.add(new changesetpanel("changeset", change));
     }
  }
}


-igor

On Sat, Oct 10, 2009 at 9:35 AM, Ceki Gulcu <c...@qos.ch> wrote:
>
>
> Igor Vaynberg wrote:
>>
>> in other words, if you were building this app using jsps or servlets
>> how would you carry over this data structure between requests?
>
> No, I actually would not carry the data between requests. When the
> page is requested, I would run my test suite to compute the
> results. Serving the test results from a previous test run is useless
> and is likely to be misleading..
>
> Following Eelco's suggestion, I've set all the fields in my panel
> (DescriptionPanel) to transient. However, in one case the panel
> creates a ListView which references non-serializable data items. Thus I
> started creating a parallel and serializable data class hierarchy for
> presenting my results, which I am actually quite happy about. However,
> I also wish I knew a simpler solution if the same question arose in a
> different context where duplicating the class hierarchy would be
> inappropriate.
>
>> -igor
>
> --
> Ceki Gülcü
> Logback: The reliable, generic, fast and flexible logging framework for
> Java.
> http://logback.qos.ch
>
> ---------------------------------------------------------------------
> 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

Reply via email to