Migrating to 1.3 and ajax tree's

2008-09-30 Thread Alexander Anguiano
Hi,

 

I'm migrating to 1.3 and the notes recommend the new tree implementation
in the 1.3 and not the one in extension.  I have a couple of question
about this

 

1) Which Tree class do I use?  BaseTree?

2) The renderNode method is missing.  What is the equivalent in the
new Tree classes

 

Thanks.

 

 

 

 



RE: ListView and Serialization

2008-09-23 Thread Alexander Anguiano
Fyi: If figured it out, if anyone is interested.  By the way, I worked
on this for quite a while and only decided to post when I was getting no
where.

I thought I could use the models somehow, I couldn't figure out how to
use them here and I don't think it is possible.  What I did is I created
unique names for the ObjectDisplay and put them in a hash table then I
put them in the session.  I created a List of these names and pass them
to the ObjectView string. In the populateItem I looked them up from the
session.



-Original Message-
From: Alexander Anguiano [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 21, 2008 10:09 PM
To: users@wicket.apache.org
Subject: ListView and Serialization

ListView and Serialization

 

First i like to say it was the framework that I was waiting for years.
Great job guys!

 

I did buy the wicket in action book which I did find very helpful but it
didn't help me solve this problem.  I have problems with the ListView
and Serialization.  I'm using the ListView to render charts on panels.
It was easy to get it on the panels as cells in the list view but the
problem I'm having is with the serialization.  I have a complex heavy
object I don't want to serialize.  I'd like to put the object in the
session and use the model to get the data from there.

 

 

// data class - I don't want this data serialized

public class ObjectDisplay  {

  Point point = null;

  int policyID;

  ReconcileComputer reconcile = null;

  GroupScore root ;

  public ObjectDisplay() {}

}

 

// Page with serialization problem

public class DashBoardPage extends AuthenticatedWebPage {

 

 

public DashBoardPage(final PageParameters parameters) {

  super(parameters);

  ArrayListObjectDisplay [] display = aquireDispays();

 

  add(new ObjectView(object-list,display));

 

}

 

class ObjectView extends ListView {

  



 

  private static final long serialVersionUID = 1L;

 

public ObjectView(String arg0, List arg1) {

super(arg0, arg1);

 

}

 

public Panel createObject(String id, ObjectDisplay od) {

if (od.root == null) {

  ContentPanel p = new ContentPanel(id,
od.point.getTitle());

  p.add(new Label(object,No data found.));

  return p;

}



Panel panel = null;

switch (od.point.getObjectType()) { 

case RootPieChart :

  panel = new RootPieChart(id,od,false);

  break;

case RootHorizontalBarChart :

  panel = new HorizontalRootGroupChart(id,od);

  break;

case ChildVerticalBarChart :

  panel = new VerticalChildChart(id,od,gs);

  break;

case RootDrillDown :

  panel = new RootPieChart(id,od,true);

  break;

case RootRiskSummary:

  panel = new RiskPanel(id,od);

  break;  

case RootTreeView :

  panel = new ScoreCardPanel(id,od);

  break;

}

  

return panel;



}



public void populateItem(final ListItem listItem) {

final ObjectDisplay []value = (ObjectDisplay [])
listItem.getModelObject();

   

Panel panel = null;



WebMarkupContainer colspanner = new
WebMarkupContainer(colspanner);

if (value[1] == null) {

  String cs = 1;

  if (isWideLoad(value[0].point.getObjectType())) {

cs = 2;

colspanner.add(new
SimpleAttributeModifier(style,width: 100%; padding: 5px;));



  } 

  colspanner.add(new SimpleAttributeModifier(colspan,
cs));   

  listItem.add(colspanner);

  panel = createObject(object1,value[0]);

  colspanner.add(panel);

  listItem.add(new Label(object2,));

} else {

  colspanner.add(new SimpleAttributeModifier(colspan,
1));

  listItem.add(colspanner);

panel = createObject(object1,value[0]);
colspanner.add(panel);

  panel = createObject(object1,value[1]);

  listItem.add(panel);

}

   

 

}

}

 

 

}

 


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



ListView and Serialization

2008-09-21 Thread Alexander Anguiano
ListView and Serialization

 

First i like to say it was the framework that I was waiting for years.
Great job guys!

 

I did buy the wicket in action book which I did find very helpful but it
didn't help me solve this problem.  I have problems with the ListView
and Serialization.  I'm using the ListView to render charts on panels.
It was easy to get it on the panels as cells in the list view but the
problem I'm having is with the serialization.  I have a complex heavy
object I don't want to serialize.  I'd like to put the object in the
session and use the model to get the data from there.

 

 

// data class - I don't want this data serialized

public class ObjectDisplay  {

  Point point = null;

  int policyID;

  ReconcileComputer reconcile = null;

  GroupScore root ;

  public ObjectDisplay() {}

}

 

// Page with serialization problem

public class DashBoardPage extends AuthenticatedWebPage {

 

 

public DashBoardPage(final PageParameters parameters) {

  super(parameters);

  ArrayListObjectDisplay [] display = aquireDispays();

 

  add(new ObjectView(object-list,display));

 

}

 

class ObjectView extends ListView {

  



 

  private static final long serialVersionUID = 1L;

 

public ObjectView(String arg0, List arg1) {

super(arg0, arg1);

 

}

 

public Panel createObject(String id, ObjectDisplay od) {

if (od.root == null) {

  ContentPanel p = new ContentPanel(id,
od.point.getTitle());

  p.add(new Label(object,No data found.));

  return p;

}



Panel panel = null;

switch (od.point.getObjectType()) { 

case RootPieChart :

  panel = new RootPieChart(id,od,false);

  break;

case RootHorizontalBarChart :

  panel = new HorizontalRootGroupChart(id,od);

  break;

case ChildVerticalBarChart :

  panel = new VerticalChildChart(id,od,gs);

  break;

case RootDrillDown :

  panel = new RootPieChart(id,od,true);

  break;

case RootRiskSummary:

  panel = new RiskPanel(id,od);

  break;  

case RootTreeView :

  panel = new ScoreCardPanel(id,od);

  break;

}

  

return panel;



}



public void populateItem(final ListItem listItem) {

final ObjectDisplay []value = (ObjectDisplay [])
listItem.getModelObject();

   

Panel panel = null;



WebMarkupContainer colspanner = new
WebMarkupContainer(colspanner);

if (value[1] == null) {

  String cs = 1;

  if (isWideLoad(value[0].point.getObjectType())) {

cs = 2;

colspanner.add(new
SimpleAttributeModifier(style,width: 100%; padding: 5px;));



  } 

  colspanner.add(new SimpleAttributeModifier(colspan,
cs));   

  listItem.add(colspanner);

  panel = createObject(object1,value[0]);

  colspanner.add(panel);

  listItem.add(new Label(object2,));

} else {

  colspanner.add(new SimpleAttributeModifier(colspan,
1));

  listItem.add(colspanner);

panel = createObject(object1,value[0]);
colspanner.add(panel);

  panel = createObject(object1,value[1]);

  listItem.add(panel);

}

   

 

}

}

 

 

}