Re: DataView or GridView with two columns by item

2011-10-26 Thread Tito
Thank you Igor!
I forgot that. It works ok!

Tito

2011/10/25 Igor Vaynberg igor.vaynb...@gmail.com

 you never say item.add(contentRow, detailsRow);

 and you dont need to override newItem() at all

 -igor

 On Tue, Oct 25, 2011 at 8:30 AM, Tito njyt...@gmail.com wrote:
  I thought that I had to create Items on newItem method.
  Anyway, I tried this but it doesn't work. Perhaps I'm doing something
 wrong,
  this is my test:
 
  @Override
   protected void populateItem(ItemDedication item) {
  DateFormat formatter = new SimpleDateFormat(hh:mm);
   final Dedication dedication = item.getModelObject();
  ItemDedication contentRow = new OddEvenItemDedication(content,
  item.getIndex(), item.getModel());
   ItemDedication detailsRow = new OddEvenItemDedication(details,
  item.getIndex(), item.getModel());
  contentRow.add(new Label(timeFrom,
   formatter.format(dedication.getTimeFrom(;
   contentRow.add(new Label(timeTo,
   formatter.format(dedication.getTimeTo(;
  contentRow.add(new Label(hours, dedication.getHours().toString()));
   contentRow.add(new Label(task, dedication.getTask().getName()));
  contentRow.add(new Label(accounts, getAccounts(dedication)));
   detailsRow.add(new TextAreaString(serviceStatus, new
  PropertyModelString(item.getModel(), serviceStatus)));
   }
 
  @Override
  protected ItemDedication newItem(String id, int index,
 IModelDedication
  model) {
   return new ItemDedication(id, index, model);
  }
 
  And html:
 
  wicket:container wicket:id=dedications
  tr wicket:id=content
   tdspan wicket:id=hours[horas]/span/td
  tdspan wicket:id=timeFrom[hora desde]/span]/td
   tdspan wicket:id=timeTo[hora hasta]/span]/td
  tdspan wicket:id=task[tarea]/span/td
   tdspan wicket:id=accounts[cuentas]/span/td
  /tr
   tr wicket:id=details
  td colspan=5
   input wicket:id=serviceStatus /
  /td
  /tr
   /wicket:container
 
 
  2011/10/25 Igor Vaynberg igor.vaynb...@gmail.com
 
  populateitem(item) {
   OddEvenItem tr1=new OddEvenItem(tr1, item.getindex(),
 item.getmodel());
   OddEvenItem tr2=new OddEvenItem(tr1, item.getindex(),
 item.getmodel());
   item.add(tr1, tr2);
 
   tr1.add(...);
   tr2.add(...);
  }
 
  -igor
 
 
  On Tue, Oct 25, 2011 at 7:37 AM, Tito njyt...@gmail.com wrote:
   Yes I tried but the problem is I can't get MarkupContainer to add the
   AttributeModifierBehavior.
   I don't know how to get a container that represents tr tag.
  
   2011/10/25 Josh Kamau joshnet2...@gmail.com
  
   Have you tried using attributeModifiers or attributeAppenders to add
 or
   modify a css class?
  
   Josh
  
  
   On Tue, Oct 25, 2011 at 4:21 PM, Tito njyt...@gmail.com wrote:
  
Yes, but I think this is not the problem.
I have not problems with wicket:container, my problem is that I
 can't
modify
class attribute of tr to add Odd or Even.
   
Tito
   
2011/10/25 Josh Kamau joshnet2...@gmail.com
   
 You can always use component#renderBodyOnly(true) method to
 ensure
  that
the
 containers markup is not rendered.

 Josh.

 On Tue, Oct 25, 2011 at 2:33 PM, Tito njyt...@gmail.com wrote:

  Hi,
 
  Wicket container works ok!
  But making trs webmarkupcontainers doesn't allow me to populate
  items
of
  the
  table because it change hierarchy of components, and I can't
 get
  WebMarkupContainers from Item.
 
  I mean, before I had:
 
  wicket:container wicket:id=dedications
  tr
   tdspan wicket:id=hours[horas]/span/td
  tdspan wicket:id=timeFrom[hora desde]/span]/td
   tdspan wicket:id=timeTo[hora hasta]/span]/td
  tdspan wicket:id=task[tarea]/span/td
   tdspan wicket:id=accounts[cuentas]/span/td
  /tr
   tr
  td colspan=5
  input wicket:id=serviceStatus /
   /td
  /tr
  /wicket:container
 
  And I populated items in this way:
 
  @Override
  protected void populateItem(ItemDedication item) {
   DateFormat formatter = new SimpleDateFormat(hh:mm);
  final Dedication dedication = item.getModelObject();
   item.add(new Label(timeFrom,
   formatter.format(dedication.getTimeFrom(;
  item.add(new Label(timeTo,
 formatter.format(dedication.getTimeTo(;
   item.add(new Label(hours,
 dedication.getHours().toString()));
  item.add(new Label(task, dedication.getTask().getName()));
   item.add(new Label(accounts, getAccounts(dedication)));
  item.add(new TextAreaString(serviceStatus, new
  PropertyModelString(item.getModel(), serviceStatus)));
   }
 
 
  But now if I do this in order to add Odd, Even classes:
 
  wicket:container wicket:id=dedications
   tr wicket:id=content
  tdspan wicket:id=hours[horas]/span/td
   tdspan wicket:id=timeFrom[hora desde]/span]/td
  tdspan wicket:id=timeTo[hora hasta]/span]/td
   tdspan wicket:id=task[tarea]/span/td
  tdspan wicket:id=accounts[cuentas]/span/td
   /tr
  tr wicket:id=details
  

Re: DataView or GridView with two columns by item

2011-10-25 Thread Tito
Hi,

Wicket container works ok!
But making trs webmarkupcontainers doesn't allow me to populate items of the
table because it change hierarchy of components, and I can't get
WebMarkupContainers from Item.

I mean, before I had:

wicket:container wicket:id=dedications
tr
 tdspan wicket:id=hours[horas]/span/td
tdspan wicket:id=timeFrom[hora desde]/span]/td
 tdspan wicket:id=timeTo[hora hasta]/span]/td
tdspan wicket:id=task[tarea]/span/td
 tdspan wicket:id=accounts[cuentas]/span/td
/tr
 tr
td colspan=5
input wicket:id=serviceStatus /
 /td
/tr
/wicket:container

And I populated items in this way:

@Override
protected void populateItem(ItemDedication item) {
 DateFormat formatter = new SimpleDateFormat(hh:mm);
final Dedication dedication = item.getModelObject();
 item.add(new Label(timeFrom,
 formatter.format(dedication.getTimeFrom(;
item.add(new Label(timeTo,  formatter.format(dedication.getTimeTo(;
 item.add(new Label(hours, dedication.getHours().toString()));
item.add(new Label(task, dedication.getTask().getName()));
 item.add(new Label(accounts, getAccounts(dedication)));
item.add(new TextAreaString(serviceStatus, new
PropertyModelString(item.getModel(), serviceStatus)));
 }


But now if I do this in order to add Odd, Even classes:

wicket:container wicket:id=dedications
 tr wicket:id=content
tdspan wicket:id=hours[horas]/span/td
 tdspan wicket:id=timeFrom[hora desde]/span]/td
tdspan wicket:id=timeTo[hora hasta]/span]/td
 tdspan wicket:id=task[tarea]/span/td
tdspan wicket:id=accounts[cuentas]/span/td
 /tr
tr wicket:id=details
td colspan=5
 input wicket:id=serviceStatus /
/td
/tr
 /wicket:container

I don't know how to populate items.

Thanks for helping!

Tito

2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com

 On Mon, Oct 24, 2011 at 9:31 AM, Tito njyt...@gmail.com wrote:
  I'm sorry, you are right!
  I said columns but I meant Rows!
 
  What is the java component for wicket container?

 no need for a java component, wicket:container is an auto tag like
 wicket:message

  How do you suggest to add Odd, Even classes?

 you can make trs webmarkupcontainers that add the correct class

 -igor

 
  Thank you!
 
  2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com
 
  ahhh.
 
  so you want two *rows* not two *columns* per item, attach the repeater
  to a wicket:container tag like so:
 
  wicket:container wicket:id=repeater
  trtd.../tr
  trtd/tr
  /wicket:container
 
  you will have to rig up odd/even yourself
 
  -igor
 
  On Mon, Oct 24, 2011 at 9:10 AM, Tito njyt...@gmail.com wrote:
   Hi Igor this is what i'm doing:
  
   .java
  
   public DedicationsReportPanel(String id, IModelUsers user, final
   IModelDate dayOfReport) {
   super(id);
  
   add(new DataViewDedication(dedications, new
   DedicationDataProvider(dedicationService,
  user.getObject().getUserName())) {
  
   @Override
   protected void populateItem(ItemDedication item) {
DateFormat formatter = new SimpleDateFormat(hh:mm);
   final Dedication dedication = item.getModelObject();
item.add(new Label(timeFrom,
formatter.format(dedication.getTimeFrom(;
   item.add(new Label(timeTo,
  formatter.format(dedication.getTimeTo(;
item.add(new Label(hours, dedication.getHours().toString()));
   item.add(new Label(task, dedication.getTask().getName()));
item.add(new Label(accounts, getAccounts(dedication)));
   item.add(new TextAreaString(serviceStatus, new
   PropertyModelString(item.getModel(), serviceStatus)));
}
  
   @Override
   protected ItemDedication newItem(String id, int index,
  IModelDedication
   model) {
OddEvenItemDedication item = new OddEvenItemDedication(id, index,
   model);
   return item;
}
   });
   }
  
   .html
  
   html
   xmlns:wicket=
  http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd
   
   head/head
   body
   wicket:panel
   table cellspacing=0 class=listado
tr
   thFecha/th
   thHoras/th
thTarea/th
   thServicios/th
   thAcciones/th
/tr
   div wicket:id=dedications
   tr
tdspan wicket:id=hours[horas]/span/td
   tdspan wicket:id=timeFrom[hora desde]/span]/td
tdspan wicket:id=timeTo[hora hasta]/span]/td
   tdspan wicket:id=task[tarea]/span/td
tdspan wicket:id=accounts[cuentas]/span/td
   /tr
tr
   td colspan=5
   input wicket:id=serviceStatus /
/td
   /tr
   /div
/table
   /wicket:panel
   /body
   /html
  
   I'm using a div to group two columns. The problem is that this not a
  valid
   html, and I can't get Odd, Even class in rows. I think it is because
 div
  is
   repeated instead of tr.
  
   What i'm expecting in the final html is something like this:
  
   table cellspacing=0 class=listado
tr
   thFecha/th
   thHoras/th
thTarea/th
   thServicios/th
   thAcciones/th
/tr
   tr class=Even
   tdspanhours 1/span/td
tdspantime from 1/span]/td
   tdspantime to 1/span]/td
tdspantask 1/span/td
   tdspanaccounts 1/span/td
/tr
   tr class=Even
   td colspan=5
input wicket:id=serviceStatus /
   

Re: DataView or GridView with two columns by item

2011-10-25 Thread Josh Kamau
You can always use component#renderBodyOnly(true) method to ensure that the
containers markup is not rendered.

Josh.

On Tue, Oct 25, 2011 at 2:33 PM, Tito njyt...@gmail.com wrote:

 Hi,

 Wicket container works ok!
 But making trs webmarkupcontainers doesn't allow me to populate items of
 the
 table because it change hierarchy of components, and I can't get
 WebMarkupContainers from Item.

 I mean, before I had:

 wicket:container wicket:id=dedications
 tr
  tdspan wicket:id=hours[horas]/span/td
 tdspan wicket:id=timeFrom[hora desde]/span]/td
  tdspan wicket:id=timeTo[hora hasta]/span]/td
 tdspan wicket:id=task[tarea]/span/td
  tdspan wicket:id=accounts[cuentas]/span/td
 /tr
  tr
 td colspan=5
 input wicket:id=serviceStatus /
  /td
 /tr
 /wicket:container

 And I populated items in this way:

 @Override
 protected void populateItem(ItemDedication item) {
  DateFormat formatter = new SimpleDateFormat(hh:mm);
 final Dedication dedication = item.getModelObject();
  item.add(new Label(timeFrom,
  formatter.format(dedication.getTimeFrom(;
 item.add(new Label(timeTo,  formatter.format(dedication.getTimeTo(;
  item.add(new Label(hours, dedication.getHours().toString()));
 item.add(new Label(task, dedication.getTask().getName()));
  item.add(new Label(accounts, getAccounts(dedication)));
 item.add(new TextAreaString(serviceStatus, new
 PropertyModelString(item.getModel(), serviceStatus)));
  }


 But now if I do this in order to add Odd, Even classes:

 wicket:container wicket:id=dedications
  tr wicket:id=content
 tdspan wicket:id=hours[horas]/span/td
  tdspan wicket:id=timeFrom[hora desde]/span]/td
 tdspan wicket:id=timeTo[hora hasta]/span]/td
  tdspan wicket:id=task[tarea]/span/td
 tdspan wicket:id=accounts[cuentas]/span/td
  /tr
 tr wicket:id=details
 td colspan=5
  input wicket:id=serviceStatus /
 /td
 /tr
  /wicket:container

 I don't know how to populate items.

 Thanks for helping!

 Tito

 2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com

  On Mon, Oct 24, 2011 at 9:31 AM, Tito njyt...@gmail.com wrote:
   I'm sorry, you are right!
   I said columns but I meant Rows!
  
   What is the java component for wicket container?
 
  no need for a java component, wicket:container is an auto tag like
  wicket:message
 
   How do you suggest to add Odd, Even classes?
 
  you can make trs webmarkupcontainers that add the correct class
 
  -igor
 
  
   Thank you!
  
   2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com
  
   ahhh.
  
   so you want two *rows* not two *columns* per item, attach the repeater
   to a wicket:container tag like so:
  
   wicket:container wicket:id=repeater
   trtd.../tr
   trtd/tr
   /wicket:container
  
   you will have to rig up odd/even yourself
  
   -igor
  
   On Mon, Oct 24, 2011 at 9:10 AM, Tito njyt...@gmail.com wrote:
Hi Igor this is what i'm doing:
   
.java
   
public DedicationsReportPanel(String id, IModelUsers user, final
IModelDate dayOfReport) {
super(id);
   
add(new DataViewDedication(dedications, new
DedicationDataProvider(dedicationService,
   user.getObject().getUserName())) {
   
@Override
protected void populateItem(ItemDedication item) {
 DateFormat formatter = new SimpleDateFormat(hh:mm);
final Dedication dedication = item.getModelObject();
 item.add(new Label(timeFrom,
 formatter.format(dedication.getTimeFrom(;
item.add(new Label(timeTo,
   formatter.format(dedication.getTimeTo(;
 item.add(new Label(hours, dedication.getHours().toString()));
item.add(new Label(task, dedication.getTask().getName()));
 item.add(new Label(accounts, getAccounts(dedication)));
item.add(new TextAreaString(serviceStatus, new
PropertyModelString(item.getModel(), serviceStatus)));
 }
   
@Override
protected ItemDedication newItem(String id, int index,
   IModelDedication
model) {
 OddEvenItemDedication item = new OddEvenItemDedication(id,
 index,
model);
return item;
 }
});
}
   
.html
   
html
xmlns:wicket=
   http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd

head/head
body
wicket:panel
table cellspacing=0 class=listado
 tr
thFecha/th
thHoras/th
 thTarea/th
thServicios/th
thAcciones/th
 /tr
div wicket:id=dedications
tr
 tdspan wicket:id=hours[horas]/span/td
tdspan wicket:id=timeFrom[hora desde]/span]/td
 tdspan wicket:id=timeTo[hora hasta]/span]/td
tdspan wicket:id=task[tarea]/span/td
 tdspan wicket:id=accounts[cuentas]/span/td
/tr
 tr
td colspan=5
input wicket:id=serviceStatus /
 /td
/tr
/div
 /table
/wicket:panel
/body
/html
   
I'm using a div to group two columns. The problem is that this not a
   valid
html, and I can't get Odd, Even class in rows. I think it is because
  div
   is
repeated instead of tr.
   
What i'm expecting in the final html is something like this:
   
table 

Re: DataView or GridView with two columns by item

2011-10-25 Thread Tito
Yes, but I think this is not the problem.
I have not problems with wicket:container, my problem is that I can't modify
class attribute of tr to add Odd or Even.

Tito

2011/10/25 Josh Kamau joshnet2...@gmail.com

 You can always use component#renderBodyOnly(true) method to ensure that the
 containers markup is not rendered.

 Josh.

 On Tue, Oct 25, 2011 at 2:33 PM, Tito njyt...@gmail.com wrote:

  Hi,
 
  Wicket container works ok!
  But making trs webmarkupcontainers doesn't allow me to populate items of
  the
  table because it change hierarchy of components, and I can't get
  WebMarkupContainers from Item.
 
  I mean, before I had:
 
  wicket:container wicket:id=dedications
  tr
   tdspan wicket:id=hours[horas]/span/td
  tdspan wicket:id=timeFrom[hora desde]/span]/td
   tdspan wicket:id=timeTo[hora hasta]/span]/td
  tdspan wicket:id=task[tarea]/span/td
   tdspan wicket:id=accounts[cuentas]/span/td
  /tr
   tr
  td colspan=5
  input wicket:id=serviceStatus /
   /td
  /tr
  /wicket:container
 
  And I populated items in this way:
 
  @Override
  protected void populateItem(ItemDedication item) {
   DateFormat formatter = new SimpleDateFormat(hh:mm);
  final Dedication dedication = item.getModelObject();
   item.add(new Label(timeFrom,
   formatter.format(dedication.getTimeFrom(;
  item.add(new Label(timeTo,  formatter.format(dedication.getTimeTo(;
   item.add(new Label(hours, dedication.getHours().toString()));
  item.add(new Label(task, dedication.getTask().getName()));
   item.add(new Label(accounts, getAccounts(dedication)));
  item.add(new TextAreaString(serviceStatus, new
  PropertyModelString(item.getModel(), serviceStatus)));
   }
 
 
  But now if I do this in order to add Odd, Even classes:
 
  wicket:container wicket:id=dedications
   tr wicket:id=content
  tdspan wicket:id=hours[horas]/span/td
   tdspan wicket:id=timeFrom[hora desde]/span]/td
  tdspan wicket:id=timeTo[hora hasta]/span]/td
   tdspan wicket:id=task[tarea]/span/td
  tdspan wicket:id=accounts[cuentas]/span/td
   /tr
  tr wicket:id=details
  td colspan=5
   input wicket:id=serviceStatus /
  /td
  /tr
   /wicket:container
 
  I don't know how to populate items.
 
  Thanks for helping!
 
  Tito
 
  2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com
 
   On Mon, Oct 24, 2011 at 9:31 AM, Tito njyt...@gmail.com wrote:
I'm sorry, you are right!
I said columns but I meant Rows!
   
What is the java component for wicket container?
  
   no need for a java component, wicket:container is an auto tag like
   wicket:message
  
How do you suggest to add Odd, Even classes?
  
   you can make trs webmarkupcontainers that add the correct class
  
   -igor
  
   
Thank you!
   
2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com
   
ahhh.
   
so you want two *rows* not two *columns* per item, attach the
 repeater
to a wicket:container tag like so:
   
wicket:container wicket:id=repeater
trtd.../tr
trtd/tr
/wicket:container
   
you will have to rig up odd/even yourself
   
-igor
   
On Mon, Oct 24, 2011 at 9:10 AM, Tito njyt...@gmail.com wrote:
 Hi Igor this is what i'm doing:

 .java

 public DedicationsReportPanel(String id, IModelUsers user, final
 IModelDate dayOfReport) {
 super(id);

 add(new DataViewDedication(dedications, new
 DedicationDataProvider(dedicationService,
user.getObject().getUserName())) {

 @Override
 protected void populateItem(ItemDedication item) {
  DateFormat formatter = new SimpleDateFormat(hh:mm);
 final Dedication dedication = item.getModelObject();
  item.add(new Label(timeFrom,
  formatter.format(dedication.getTimeFrom(;
 item.add(new Label(timeTo,
formatter.format(dedication.getTimeTo(;
  item.add(new Label(hours, dedication.getHours().toString()));
 item.add(new Label(task, dedication.getTask().getName()));
  item.add(new Label(accounts, getAccounts(dedication)));
 item.add(new TextAreaString(serviceStatus, new
 PropertyModelString(item.getModel(), serviceStatus)));
  }

 @Override
 protected ItemDedication newItem(String id, int index,
IModelDedication
 model) {
  OddEvenItemDedication item = new OddEvenItemDedication(id,
  index,
 model);
 return item;
  }
 });
 }

 .html

 html
 xmlns:wicket=
http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd
 
 head/head
 body
 wicket:panel
 table cellspacing=0 class=listado
  tr
 thFecha/th
 thHoras/th
  thTarea/th
 thServicios/th
 thAcciones/th
  /tr
 div wicket:id=dedications
 tr
  tdspan wicket:id=hours[horas]/span/td
 tdspan wicket:id=timeFrom[hora desde]/span]/td
  tdspan wicket:id=timeTo[hora hasta]/span]/td
 tdspan wicket:id=task[tarea]/span/td
  tdspan wicket:id=accounts[cuentas]/span/td
 /tr
  tr
 td colspan=5
 

Re: DataView or GridView with two columns by item

2011-10-25 Thread Josh Kamau
Have you tried using attributeModifiers or attributeAppenders to add or
modify a css class?

Josh


On Tue, Oct 25, 2011 at 4:21 PM, Tito njyt...@gmail.com wrote:

 Yes, but I think this is not the problem.
 I have not problems with wicket:container, my problem is that I can't
 modify
 class attribute of tr to add Odd or Even.

 Tito

 2011/10/25 Josh Kamau joshnet2...@gmail.com

  You can always use component#renderBodyOnly(true) method to ensure that
 the
  containers markup is not rendered.
 
  Josh.
 
  On Tue, Oct 25, 2011 at 2:33 PM, Tito njyt...@gmail.com wrote:
 
   Hi,
  
   Wicket container works ok!
   But making trs webmarkupcontainers doesn't allow me to populate items
 of
   the
   table because it change hierarchy of components, and I can't get
   WebMarkupContainers from Item.
  
   I mean, before I had:
  
   wicket:container wicket:id=dedications
   tr
tdspan wicket:id=hours[horas]/span/td
   tdspan wicket:id=timeFrom[hora desde]/span]/td
tdspan wicket:id=timeTo[hora hasta]/span]/td
   tdspan wicket:id=task[tarea]/span/td
tdspan wicket:id=accounts[cuentas]/span/td
   /tr
tr
   td colspan=5
   input wicket:id=serviceStatus /
/td
   /tr
   /wicket:container
  
   And I populated items in this way:
  
   @Override
   protected void populateItem(ItemDedication item) {
DateFormat formatter = new SimpleDateFormat(hh:mm);
   final Dedication dedication = item.getModelObject();
item.add(new Label(timeFrom,
formatter.format(dedication.getTimeFrom(;
   item.add(new Label(timeTo,
  formatter.format(dedication.getTimeTo(;
item.add(new Label(hours, dedication.getHours().toString()));
   item.add(new Label(task, dedication.getTask().getName()));
item.add(new Label(accounts, getAccounts(dedication)));
   item.add(new TextAreaString(serviceStatus, new
   PropertyModelString(item.getModel(), serviceStatus)));
}
  
  
   But now if I do this in order to add Odd, Even classes:
  
   wicket:container wicket:id=dedications
tr wicket:id=content
   tdspan wicket:id=hours[horas]/span/td
tdspan wicket:id=timeFrom[hora desde]/span]/td
   tdspan wicket:id=timeTo[hora hasta]/span]/td
tdspan wicket:id=task[tarea]/span/td
   tdspan wicket:id=accounts[cuentas]/span/td
/tr
   tr wicket:id=details
   td colspan=5
input wicket:id=serviceStatus /
   /td
   /tr
/wicket:container
  
   I don't know how to populate items.
  
   Thanks for helping!
  
   Tito
  
   2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com
  
On Mon, Oct 24, 2011 at 9:31 AM, Tito njyt...@gmail.com wrote:
 I'm sorry, you are right!
 I said columns but I meant Rows!

 What is the java component for wicket container?
   
no need for a java component, wicket:container is an auto tag like
wicket:message
   
 How do you suggest to add Odd, Even classes?
   
you can make trs webmarkupcontainers that add the correct class
   
-igor
   

 Thank you!

 2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com

 ahhh.

 so you want two *rows* not two *columns* per item, attach the
  repeater
 to a wicket:container tag like so:

 wicket:container wicket:id=repeater
 trtd.../tr
 trtd/tr
 /wicket:container

 you will have to rig up odd/even yourself

 -igor

 On Mon, Oct 24, 2011 at 9:10 AM, Tito njyt...@gmail.com wrote:
  Hi Igor this is what i'm doing:
 
  .java
 
  public DedicationsReportPanel(String id, IModelUsers user,
 final
  IModelDate dayOfReport) {
  super(id);
 
  add(new DataViewDedication(dedications, new
  DedicationDataProvider(dedicationService,
 user.getObject().getUserName())) {
 
  @Override
  protected void populateItem(ItemDedication item) {
   DateFormat formatter = new SimpleDateFormat(hh:mm);
  final Dedication dedication = item.getModelObject();
   item.add(new Label(timeFrom,
   formatter.format(dedication.getTimeFrom(;
  item.add(new Label(timeTo,
 formatter.format(dedication.getTimeTo(;
   item.add(new Label(hours, dedication.getHours().toString()));
  item.add(new Label(task, dedication.getTask().getName()));
   item.add(new Label(accounts, getAccounts(dedication)));
  item.add(new TextAreaString(serviceStatus, new
  PropertyModelString(item.getModel(), serviceStatus)));
   }
 
  @Override
  protected ItemDedication newItem(String id, int index,
 IModelDedication
  model) {
   OddEvenItemDedication item = new OddEvenItemDedication(id,
   index,
  model);
  return item;
   }
  });
  }
 
  .html
 
  html
  xmlns:wicket=
 http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd
  
  head/head
  body
  wicket:panel
  table cellspacing=0 class=listado
   tr
  thFecha/th
  thHoras/th
   thTarea/th
  thServicios/th
  

Re: DataView or GridView with two columns by item

2011-10-25 Thread Tito
Yes I tried but the problem is I can't get MarkupContainer to add the
AttributeModifierBehavior.
I don't know how to get a container that represents tr tag.

2011/10/25 Josh Kamau joshnet2...@gmail.com

 Have you tried using attributeModifiers or attributeAppenders to add or
 modify a css class?

 Josh


 On Tue, Oct 25, 2011 at 4:21 PM, Tito njyt...@gmail.com wrote:

  Yes, but I think this is not the problem.
  I have not problems with wicket:container, my problem is that I can't
  modify
  class attribute of tr to add Odd or Even.
 
  Tito
 
  2011/10/25 Josh Kamau joshnet2...@gmail.com
 
   You can always use component#renderBodyOnly(true) method to ensure that
  the
   containers markup is not rendered.
  
   Josh.
  
   On Tue, Oct 25, 2011 at 2:33 PM, Tito njyt...@gmail.com wrote:
  
Hi,
   
Wicket container works ok!
But making trs webmarkupcontainers doesn't allow me to populate items
  of
the
table because it change hierarchy of components, and I can't get
WebMarkupContainers from Item.
   
I mean, before I had:
   
wicket:container wicket:id=dedications
tr
 tdspan wicket:id=hours[horas]/span/td
tdspan wicket:id=timeFrom[hora desde]/span]/td
 tdspan wicket:id=timeTo[hora hasta]/span]/td
tdspan wicket:id=task[tarea]/span/td
 tdspan wicket:id=accounts[cuentas]/span/td
/tr
 tr
td colspan=5
input wicket:id=serviceStatus /
 /td
/tr
/wicket:container
   
And I populated items in this way:
   
@Override
protected void populateItem(ItemDedication item) {
 DateFormat formatter = new SimpleDateFormat(hh:mm);
final Dedication dedication = item.getModelObject();
 item.add(new Label(timeFrom,
 formatter.format(dedication.getTimeFrom(;
item.add(new Label(timeTo,
   formatter.format(dedication.getTimeTo(;
 item.add(new Label(hours, dedication.getHours().toString()));
item.add(new Label(task, dedication.getTask().getName()));
 item.add(new Label(accounts, getAccounts(dedication)));
item.add(new TextAreaString(serviceStatus, new
PropertyModelString(item.getModel(), serviceStatus)));
 }
   
   
But now if I do this in order to add Odd, Even classes:
   
wicket:container wicket:id=dedications
 tr wicket:id=content
tdspan wicket:id=hours[horas]/span/td
 tdspan wicket:id=timeFrom[hora desde]/span]/td
tdspan wicket:id=timeTo[hora hasta]/span]/td
 tdspan wicket:id=task[tarea]/span/td
tdspan wicket:id=accounts[cuentas]/span/td
 /tr
tr wicket:id=details
td colspan=5
 input wicket:id=serviceStatus /
/td
/tr
 /wicket:container
   
I don't know how to populate items.
   
Thanks for helping!
   
Tito
   
2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com
   
 On Mon, Oct 24, 2011 at 9:31 AM, Tito njyt...@gmail.com wrote:
  I'm sorry, you are right!
  I said columns but I meant Rows!
 
  What is the java component for wicket container?

 no need for a java component, wicket:container is an auto tag like
 wicket:message

  How do you suggest to add Odd, Even classes?

 you can make trs webmarkupcontainers that add the correct class

 -igor

 
  Thank you!
 
  2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com
 
  ahhh.
 
  so you want two *rows* not two *columns* per item, attach the
   repeater
  to a wicket:container tag like so:
 
  wicket:container wicket:id=repeater
  trtd.../tr
  trtd/tr
  /wicket:container
 
  you will have to rig up odd/even yourself
 
  -igor
 
  On Mon, Oct 24, 2011 at 9:10 AM, Tito njyt...@gmail.com
 wrote:
   Hi Igor this is what i'm doing:
  
   .java
  
   public DedicationsReportPanel(String id, IModelUsers user,
  final
   IModelDate dayOfReport) {
   super(id);
  
   add(new DataViewDedication(dedications, new
   DedicationDataProvider(dedicationService,
  user.getObject().getUserName())) {
  
   @Override
   protected void populateItem(ItemDedication item) {
DateFormat formatter = new SimpleDateFormat(hh:mm);
   final Dedication dedication = item.getModelObject();
item.add(new Label(timeFrom,
formatter.format(dedication.getTimeFrom(;
   item.add(new Label(timeTo,
  formatter.format(dedication.getTimeTo(;
item.add(new Label(hours,
 dedication.getHours().toString()));
   item.add(new Label(task, dedication.getTask().getName()));
item.add(new Label(accounts, getAccounts(dedication)));
   item.add(new TextAreaString(serviceStatus, new
   PropertyModelString(item.getModel(), serviceStatus)));
}
  
   @Override
   protected ItemDedication newItem(String id, int index,
  IModelDedication
   model) {
OddEvenItemDedication item = new
 OddEvenItemDedication(id,
index,

Re: DataView or GridView with two columns by item

2011-10-25 Thread Igor Vaynberg
populateitem(item) {
  OddEvenItem tr1=new OddEvenItem(tr1, item.getindex(), item.getmodel());
  OddEvenItem tr2=new OddEvenItem(tr1, item.getindex(), item.getmodel());
  item.add(tr1, tr2);

  tr1.add(...);
  tr2.add(...);
}

-igor


On Tue, Oct 25, 2011 at 7:37 AM, Tito njyt...@gmail.com wrote:
 Yes I tried but the problem is I can't get MarkupContainer to add the
 AttributeModifierBehavior.
 I don't know how to get a container that represents tr tag.

 2011/10/25 Josh Kamau joshnet2...@gmail.com

 Have you tried using attributeModifiers or attributeAppenders to add or
 modify a css class?

 Josh


 On Tue, Oct 25, 2011 at 4:21 PM, Tito njyt...@gmail.com wrote:

  Yes, but I think this is not the problem.
  I have not problems with wicket:container, my problem is that I can't
  modify
  class attribute of tr to add Odd or Even.
 
  Tito
 
  2011/10/25 Josh Kamau joshnet2...@gmail.com
 
   You can always use component#renderBodyOnly(true) method to ensure that
  the
   containers markup is not rendered.
  
   Josh.
  
   On Tue, Oct 25, 2011 at 2:33 PM, Tito njyt...@gmail.com wrote:
  
Hi,
   
Wicket container works ok!
But making trs webmarkupcontainers doesn't allow me to populate items
  of
the
table because it change hierarchy of components, and I can't get
WebMarkupContainers from Item.
   
I mean, before I had:
   
wicket:container wicket:id=dedications
tr
 tdspan wicket:id=hours[horas]/span/td
tdspan wicket:id=timeFrom[hora desde]/span]/td
 tdspan wicket:id=timeTo[hora hasta]/span]/td
tdspan wicket:id=task[tarea]/span/td
 tdspan wicket:id=accounts[cuentas]/span/td
/tr
 tr
td colspan=5
input wicket:id=serviceStatus /
 /td
/tr
/wicket:container
   
And I populated items in this way:
   
@Override
protected void populateItem(ItemDedication item) {
 DateFormat formatter = new SimpleDateFormat(hh:mm);
final Dedication dedication = item.getModelObject();
 item.add(new Label(timeFrom,
 formatter.format(dedication.getTimeFrom(;
item.add(new Label(timeTo,
   formatter.format(dedication.getTimeTo(;
 item.add(new Label(hours, dedication.getHours().toString()));
item.add(new Label(task, dedication.getTask().getName()));
 item.add(new Label(accounts, getAccounts(dedication)));
item.add(new TextAreaString(serviceStatus, new
PropertyModelString(item.getModel(), serviceStatus)));
 }
   
   
But now if I do this in order to add Odd, Even classes:
   
wicket:container wicket:id=dedications
 tr wicket:id=content
tdspan wicket:id=hours[horas]/span/td
 tdspan wicket:id=timeFrom[hora desde]/span]/td
tdspan wicket:id=timeTo[hora hasta]/span]/td
 tdspan wicket:id=task[tarea]/span/td
tdspan wicket:id=accounts[cuentas]/span/td
 /tr
tr wicket:id=details
td colspan=5
 input wicket:id=serviceStatus /
/td
/tr
 /wicket:container
   
I don't know how to populate items.
   
Thanks for helping!
   
Tito
   
2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com
   
 On Mon, Oct 24, 2011 at 9:31 AM, Tito njyt...@gmail.com wrote:
  I'm sorry, you are right!
  I said columns but I meant Rows!
 
  What is the java component for wicket container?

 no need for a java component, wicket:container is an auto tag like
 wicket:message

  How do you suggest to add Odd, Even classes?

 you can make trs webmarkupcontainers that add the correct class

 -igor

 
  Thank you!
 
  2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com
 
  ahhh.
 
  so you want two *rows* not two *columns* per item, attach the
   repeater
  to a wicket:container tag like so:
 
  wicket:container wicket:id=repeater
  trtd.../tr
  trtd/tr
  /wicket:container
 
  you will have to rig up odd/even yourself
 
  -igor
 
  On Mon, Oct 24, 2011 at 9:10 AM, Tito njyt...@gmail.com
 wrote:
   Hi Igor this is what i'm doing:
  
   .java
  
   public DedicationsReportPanel(String id, IModelUsers user,
  final
   IModelDate dayOfReport) {
   super(id);
  
   add(new DataViewDedication(dedications, new
   DedicationDataProvider(dedicationService,
  user.getObject().getUserName())) {
  
   @Override
   protected void populateItem(ItemDedication item) {
    DateFormat formatter = new SimpleDateFormat(hh:mm);
   final Dedication dedication = item.getModelObject();
    item.add(new Label(timeFrom,
    formatter.format(dedication.getTimeFrom(;
   item.add(new Label(timeTo,
  formatter.format(dedication.getTimeTo(;
    item.add(new Label(hours,
 dedication.getHours().toString()));
   item.add(new Label(task, dedication.getTask().getName()));
    item.add(new Label(accounts, getAccounts(dedication)));
   item.add(new 

Re: DataView or GridView with two columns by item

2011-10-25 Thread Tito
I thought that I had to create Items on newItem method.
Anyway, I tried this but it doesn't work. Perhaps I'm doing something wrong,
this is my test:

@Override
 protected void populateItem(ItemDedication item) {
DateFormat formatter = new SimpleDateFormat(hh:mm);
 final Dedication dedication = item.getModelObject();
ItemDedication contentRow = new OddEvenItemDedication(content,
item.getIndex(), item.getModel());
 ItemDedication detailsRow = new OddEvenItemDedication(details,
item.getIndex(), item.getModel());
contentRow.add(new Label(timeFrom,
 formatter.format(dedication.getTimeFrom(;
 contentRow.add(new Label(timeTo,
 formatter.format(dedication.getTimeTo(;
contentRow.add(new Label(hours, dedication.getHours().toString()));
 contentRow.add(new Label(task, dedication.getTask().getName()));
contentRow.add(new Label(accounts, getAccounts(dedication)));
 detailsRow.add(new TextAreaString(serviceStatus, new
PropertyModelString(item.getModel(), serviceStatus)));
 }

@Override
protected ItemDedication newItem(String id, int index, IModelDedication
model) {
 return new ItemDedication(id, index, model);
}

And html:

wicket:container wicket:id=dedications
tr wicket:id=content
 tdspan wicket:id=hours[horas]/span/td
tdspan wicket:id=timeFrom[hora desde]/span]/td
 tdspan wicket:id=timeTo[hora hasta]/span]/td
tdspan wicket:id=task[tarea]/span/td
 tdspan wicket:id=accounts[cuentas]/span/td
/tr
 tr wicket:id=details
td colspan=5
 input wicket:id=serviceStatus /
/td
/tr
 /wicket:container


2011/10/25 Igor Vaynberg igor.vaynb...@gmail.com

 populateitem(item) {
  OddEvenItem tr1=new OddEvenItem(tr1, item.getindex(), item.getmodel());
  OddEvenItem tr2=new OddEvenItem(tr1, item.getindex(), item.getmodel());
  item.add(tr1, tr2);

  tr1.add(...);
  tr2.add(...);
 }

 -igor


 On Tue, Oct 25, 2011 at 7:37 AM, Tito njyt...@gmail.com wrote:
  Yes I tried but the problem is I can't get MarkupContainer to add the
  AttributeModifierBehavior.
  I don't know how to get a container that represents tr tag.
 
  2011/10/25 Josh Kamau joshnet2...@gmail.com
 
  Have you tried using attributeModifiers or attributeAppenders to add or
  modify a css class?
 
  Josh
 
 
  On Tue, Oct 25, 2011 at 4:21 PM, Tito njyt...@gmail.com wrote:
 
   Yes, but I think this is not the problem.
   I have not problems with wicket:container, my problem is that I can't
   modify
   class attribute of tr to add Odd or Even.
  
   Tito
  
   2011/10/25 Josh Kamau joshnet2...@gmail.com
  
You can always use component#renderBodyOnly(true) method to ensure
 that
   the
containers markup is not rendered.
   
Josh.
   
On Tue, Oct 25, 2011 at 2:33 PM, Tito njyt...@gmail.com wrote:
   
 Hi,

 Wicket container works ok!
 But making trs webmarkupcontainers doesn't allow me to populate
 items
   of
 the
 table because it change hierarchy of components, and I can't get
 WebMarkupContainers from Item.

 I mean, before I had:

 wicket:container wicket:id=dedications
 tr
  tdspan wicket:id=hours[horas]/span/td
 tdspan wicket:id=timeFrom[hora desde]/span]/td
  tdspan wicket:id=timeTo[hora hasta]/span]/td
 tdspan wicket:id=task[tarea]/span/td
  tdspan wicket:id=accounts[cuentas]/span/td
 /tr
  tr
 td colspan=5
 input wicket:id=serviceStatus /
  /td
 /tr
 /wicket:container

 And I populated items in this way:

 @Override
 protected void populateItem(ItemDedication item) {
  DateFormat formatter = new SimpleDateFormat(hh:mm);
 final Dedication dedication = item.getModelObject();
  item.add(new Label(timeFrom,
  formatter.format(dedication.getTimeFrom(;
 item.add(new Label(timeTo,
formatter.format(dedication.getTimeTo(;
  item.add(new Label(hours, dedication.getHours().toString()));
 item.add(new Label(task, dedication.getTask().getName()));
  item.add(new Label(accounts, getAccounts(dedication)));
 item.add(new TextAreaString(serviceStatus, new
 PropertyModelString(item.getModel(), serviceStatus)));
  }


 But now if I do this in order to add Odd, Even classes:

 wicket:container wicket:id=dedications
  tr wicket:id=content
 tdspan wicket:id=hours[horas]/span/td
  tdspan wicket:id=timeFrom[hora desde]/span]/td
 tdspan wicket:id=timeTo[hora hasta]/span]/td
  tdspan wicket:id=task[tarea]/span/td
 tdspan wicket:id=accounts[cuentas]/span/td
  /tr
 tr wicket:id=details
 td colspan=5
  input wicket:id=serviceStatus /
 /td
 /tr
  /wicket:container

 I don't know how to populate items.

 Thanks for helping!

 Tito

 2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com

  On Mon, Oct 24, 2011 at 9:31 AM, Tito njyt...@gmail.com
 wrote:
   I'm sorry, you are right!
   I said columns but I meant Rows!
  
   What is the java component for wicket container?
 
  no 

Re: DataView or GridView with two columns by item

2011-10-25 Thread Igor Vaynberg
you never say item.add(contentRow, detailsRow);

and you dont need to override newItem() at all

-igor

On Tue, Oct 25, 2011 at 8:30 AM, Tito njyt...@gmail.com wrote:
 I thought that I had to create Items on newItem method.
 Anyway, I tried this but it doesn't work. Perhaps I'm doing something wrong,
 this is my test:

 @Override
  protected void populateItem(ItemDedication item) {
 DateFormat formatter = new SimpleDateFormat(hh:mm);
  final Dedication dedication = item.getModelObject();
 ItemDedication contentRow = new OddEvenItemDedication(content,
 item.getIndex(), item.getModel());
  ItemDedication detailsRow = new OddEvenItemDedication(details,
 item.getIndex(), item.getModel());
 contentRow.add(new Label(timeFrom,
  formatter.format(dedication.getTimeFrom(;
  contentRow.add(new Label(timeTo,
  formatter.format(dedication.getTimeTo(;
 contentRow.add(new Label(hours, dedication.getHours().toString()));
  contentRow.add(new Label(task, dedication.getTask().getName()));
 contentRow.add(new Label(accounts, getAccounts(dedication)));
  detailsRow.add(new TextAreaString(serviceStatus, new
 PropertyModelString(item.getModel(), serviceStatus)));
  }

 @Override
 protected ItemDedication newItem(String id, int index, IModelDedication
 model) {
  return new ItemDedication(id, index, model);
 }

 And html:

 wicket:container wicket:id=dedications
 tr wicket:id=content
  tdspan wicket:id=hours[horas]/span/td
 tdspan wicket:id=timeFrom[hora desde]/span]/td
  tdspan wicket:id=timeTo[hora hasta]/span]/td
 tdspan wicket:id=task[tarea]/span/td
  tdspan wicket:id=accounts[cuentas]/span/td
 /tr
  tr wicket:id=details
 td colspan=5
  input wicket:id=serviceStatus /
 /td
 /tr
  /wicket:container


 2011/10/25 Igor Vaynberg igor.vaynb...@gmail.com

 populateitem(item) {
  OddEvenItem tr1=new OddEvenItem(tr1, item.getindex(), item.getmodel());
  OddEvenItem tr2=new OddEvenItem(tr1, item.getindex(), item.getmodel());
  item.add(tr1, tr2);

  tr1.add(...);
  tr2.add(...);
 }

 -igor


 On Tue, Oct 25, 2011 at 7:37 AM, Tito njyt...@gmail.com wrote:
  Yes I tried but the problem is I can't get MarkupContainer to add the
  AttributeModifierBehavior.
  I don't know how to get a container that represents tr tag.
 
  2011/10/25 Josh Kamau joshnet2...@gmail.com
 
  Have you tried using attributeModifiers or attributeAppenders to add or
  modify a css class?
 
  Josh
 
 
  On Tue, Oct 25, 2011 at 4:21 PM, Tito njyt...@gmail.com wrote:
 
   Yes, but I think this is not the problem.
   I have not problems with wicket:container, my problem is that I can't
   modify
   class attribute of tr to add Odd or Even.
  
   Tito
  
   2011/10/25 Josh Kamau joshnet2...@gmail.com
  
You can always use component#renderBodyOnly(true) method to ensure
 that
   the
containers markup is not rendered.
   
Josh.
   
On Tue, Oct 25, 2011 at 2:33 PM, Tito njyt...@gmail.com wrote:
   
 Hi,

 Wicket container works ok!
 But making trs webmarkupcontainers doesn't allow me to populate
 items
   of
 the
 table because it change hierarchy of components, and I can't get
 WebMarkupContainers from Item.

 I mean, before I had:

 wicket:container wicket:id=dedications
 tr
  tdspan wicket:id=hours[horas]/span/td
 tdspan wicket:id=timeFrom[hora desde]/span]/td
  tdspan wicket:id=timeTo[hora hasta]/span]/td
 tdspan wicket:id=task[tarea]/span/td
  tdspan wicket:id=accounts[cuentas]/span/td
 /tr
  tr
 td colspan=5
 input wicket:id=serviceStatus /
  /td
 /tr
 /wicket:container

 And I populated items in this way:

 @Override
 protected void populateItem(ItemDedication item) {
  DateFormat formatter = new SimpleDateFormat(hh:mm);
 final Dedication dedication = item.getModelObject();
  item.add(new Label(timeFrom,
  formatter.format(dedication.getTimeFrom(;
 item.add(new Label(timeTo,
    formatter.format(dedication.getTimeTo(;
  item.add(new Label(hours, dedication.getHours().toString()));
 item.add(new Label(task, dedication.getTask().getName()));
  item.add(new Label(accounts, getAccounts(dedication)));
 item.add(new TextAreaString(serviceStatus, new
 PropertyModelString(item.getModel(), serviceStatus)));
  }


 But now if I do this in order to add Odd, Even classes:

 wicket:container wicket:id=dedications
  tr wicket:id=content
 tdspan wicket:id=hours[horas]/span/td
  tdspan wicket:id=timeFrom[hora desde]/span]/td
 tdspan wicket:id=timeTo[hora hasta]/span]/td
  tdspan wicket:id=task[tarea]/span/td
 tdspan wicket:id=accounts[cuentas]/span/td
  /tr
 tr wicket:id=details
 td colspan=5
  input wicket:id=serviceStatus /
 /td
 /tr
  /wicket:container

 I don't know how to populate items.

 Thanks for helping!

 Tito

 2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com

  On 

DataView or GridView with two columns by item

2011-10-24 Thread Tito
Hi,

I'm trying to make a table with two columns by item. I mean, my item have to
generate two columns.
The first have attributes of the object, the second have another attribute
with details.

I can't do this. I made tests with DataView and GridView. I don't know what
is the best component. Could you give me an idea of how to do something like
this?

Thanks in advance.

Tito


Re: DataView or GridView with two columns by item

2011-10-24 Thread Igor Vaynberg
dataview/listview/datatable should all work just fine, post your code.

-igor

On Mon, Oct 24, 2011 at 5:06 AM, Tito njyt...@gmail.com wrote:
 Hi,

 I'm trying to make a table with two columns by item. I mean, my item have to
 generate two columns.
 The first have attributes of the object, the second have another attribute
 with details.

 I can't do this. I made tests with DataView and GridView. I don't know what
 is the best component. Could you give me an idea of how to do something like
 this?

 Thanks in advance.

 Tito


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



Re: DataView or GridView with two columns by item

2011-10-24 Thread Tito
Hi Igor this is what i'm doing:

.java

public DedicationsReportPanel(String id, IModelUsers user, final
IModelDate dayOfReport) {
super(id);

add(new DataViewDedication(dedications, new
DedicationDataProvider(dedicationService, user.getObject().getUserName())) {

@Override
protected void populateItem(ItemDedication item) {
 DateFormat formatter = new SimpleDateFormat(hh:mm);
final Dedication dedication = item.getModelObject();
 item.add(new Label(timeFrom,
 formatter.format(dedication.getTimeFrom(;
item.add(new Label(timeTo,  formatter.format(dedication.getTimeTo(;
 item.add(new Label(hours, dedication.getHours().toString()));
item.add(new Label(task, dedication.getTask().getName()));
 item.add(new Label(accounts, getAccounts(dedication)));
item.add(new TextAreaString(serviceStatus, new
PropertyModelString(item.getModel(), serviceStatus)));
 }

@Override
protected ItemDedication newItem(String id, int index, IModelDedication
model) {
 OddEvenItemDedication item = new OddEvenItemDedication(id, index,
model);
return item;
 }
});
}

.html

html
xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd

head/head
body
wicket:panel
table cellspacing=0 class=listado
 tr
thFecha/th
thHoras/th
 thTarea/th
thServicios/th
thAcciones/th
 /tr
div wicket:id=dedications
tr
 tdspan wicket:id=hours[horas]/span/td
tdspan wicket:id=timeFrom[hora desde]/span]/td
 tdspan wicket:id=timeTo[hora hasta]/span]/td
tdspan wicket:id=task[tarea]/span/td
 tdspan wicket:id=accounts[cuentas]/span/td
/tr
 tr
td colspan=5
input wicket:id=serviceStatus /
 /td
/tr
/div
 /table
/wicket:panel
/body
/html

I'm using a div to group two columns. The problem is that this not a valid
html, and I can't get Odd, Even class in rows. I think it is because div is
repeated instead of tr.

What i'm expecting in the final html is something like this:

table cellspacing=0 class=listado
 tr
thFecha/th
thHoras/th
 thTarea/th
thServicios/th
thAcciones/th
 /tr
tr class=Even
tdspanhours 1/span/td
 tdspantime from 1/span]/td
tdspantime to 1/span]/td
 tdspantask 1/span/td
tdspanaccounts 1/span/td
 /tr
tr class=Even
td colspan=5
 input wicket:id=serviceStatus /
/td
/tr
 tr class=Odd
tdspanhours 2/span/td
 tdspantime from 2/span]/td
tdspantime to 2/span]/td
 tdspantask 2/span/td
tdspanaccounts 2/span/td
 /tr
tr class=Odd
td colspan=5
 input wicket:id=serviceStatus /
/td
/tr
 /table


Thanks!


2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com

 dataview/listview/datatable should all work just fine, post your code.

 -igor

 On Mon, Oct 24, 2011 at 5:06 AM, Tito njyt...@gmail.com wrote:
  Hi,
 
  I'm trying to make a table with two columns by item. I mean, my item have
 to
  generate two columns.
  The first have attributes of the object, the second have another
 attribute
  with details.
 
  I can't do this. I made tests with DataView and GridView. I don't know
 what
  is the best component. Could you give me an idea of how to do something
 like
  this?
 
  Thanks in advance.
 
  Tito
 

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




Re: DataView or GridView with two columns by item

2011-10-24 Thread Igor Vaynberg
ahhh.

so you want two *rows* not two *columns* per item, attach the repeater
to a wicket:container tag like so:

wicket:container wicket:id=repeater
trtd.../tr
trtd/tr
/wicket:container

you will have to rig up odd/even yourself

-igor

On Mon, Oct 24, 2011 at 9:10 AM, Tito njyt...@gmail.com wrote:
 Hi Igor this is what i'm doing:

 .java

 public DedicationsReportPanel(String id, IModelUsers user, final
 IModelDate dayOfReport) {
 super(id);

 add(new DataViewDedication(dedications, new
 DedicationDataProvider(dedicationService, user.getObject().getUserName())) {

 @Override
 protected void populateItem(ItemDedication item) {
  DateFormat formatter = new SimpleDateFormat(hh:mm);
 final Dedication dedication = item.getModelObject();
  item.add(new Label(timeFrom,
  formatter.format(dedication.getTimeFrom(;
 item.add(new Label(timeTo,  formatter.format(dedication.getTimeTo(;
  item.add(new Label(hours, dedication.getHours().toString()));
 item.add(new Label(task, dedication.getTask().getName()));
  item.add(new Label(accounts, getAccounts(dedication)));
 item.add(new TextAreaString(serviceStatus, new
 PropertyModelString(item.getModel(), serviceStatus)));
  }

 @Override
 protected ItemDedication newItem(String id, int index, IModelDedication
 model) {
  OddEvenItemDedication item = new OddEvenItemDedication(id, index,
 model);
 return item;
  }
 });
 }

 .html

 html
 xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd
 
 head/head
 body
 wicket:panel
 table cellspacing=0 class=listado
  tr
 thFecha/th
 thHoras/th
  thTarea/th
 thServicios/th
 thAcciones/th
  /tr
 div wicket:id=dedications
 tr
  tdspan wicket:id=hours[horas]/span/td
 tdspan wicket:id=timeFrom[hora desde]/span]/td
  tdspan wicket:id=timeTo[hora hasta]/span]/td
 tdspan wicket:id=task[tarea]/span/td
  tdspan wicket:id=accounts[cuentas]/span/td
 /tr
  tr
 td colspan=5
 input wicket:id=serviceStatus /
  /td
 /tr
 /div
  /table
 /wicket:panel
 /body
 /html

 I'm using a div to group two columns. The problem is that this not a valid
 html, and I can't get Odd, Even class in rows. I think it is because div is
 repeated instead of tr.

 What i'm expecting in the final html is something like this:

 table cellspacing=0 class=listado
  tr
 thFecha/th
 thHoras/th
  thTarea/th
 thServicios/th
 thAcciones/th
  /tr
 tr class=Even
 tdspanhours 1/span/td
  tdspantime from 1/span]/td
 tdspantime to 1/span]/td
  tdspantask 1/span/td
 tdspanaccounts 1/span/td
  /tr
 tr class=Even
 td colspan=5
  input wicket:id=serviceStatus /
 /td
 /tr
  tr class=Odd
 tdspanhours 2/span/td
  tdspantime from 2/span]/td
 tdspantime to 2/span]/td
  tdspantask 2/span/td
 tdspanaccounts 2/span/td
  /tr
 tr class=Odd
 td colspan=5
  input wicket:id=serviceStatus /
 /td
 /tr
  /table


 Thanks!


 2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com

 dataview/listview/datatable should all work just fine, post your code.

 -igor

 On Mon, Oct 24, 2011 at 5:06 AM, Tito njyt...@gmail.com wrote:
  Hi,
 
  I'm trying to make a table with two columns by item. I mean, my item have
 to
  generate two columns.
  The first have attributes of the object, the second have another
 attribute
  with details.
 
  I can't do this. I made tests with DataView and GridView. I don't know
 what
  is the best component. Could you give me an idea of how to do something
 like
  this?
 
  Thanks in advance.
 
  Tito
 

 -
 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



Re: DataView or GridView with two columns by item

2011-10-24 Thread Tito
I'm sorry, you are right!
I said columns but I meant Rows!

What is the java component for wicket container?
How do you suggest to add Odd, Even classes?

Thank you!

2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com

 ahhh.

 so you want two *rows* not two *columns* per item, attach the repeater
 to a wicket:container tag like so:

 wicket:container wicket:id=repeater
 trtd.../tr
 trtd/tr
 /wicket:container

 you will have to rig up odd/even yourself

 -igor

 On Mon, Oct 24, 2011 at 9:10 AM, Tito njyt...@gmail.com wrote:
  Hi Igor this is what i'm doing:
 
  .java
 
  public DedicationsReportPanel(String id, IModelUsers user, final
  IModelDate dayOfReport) {
  super(id);
 
  add(new DataViewDedication(dedications, new
  DedicationDataProvider(dedicationService,
 user.getObject().getUserName())) {
 
  @Override
  protected void populateItem(ItemDedication item) {
   DateFormat formatter = new SimpleDateFormat(hh:mm);
  final Dedication dedication = item.getModelObject();
   item.add(new Label(timeFrom,
   formatter.format(dedication.getTimeFrom(;
  item.add(new Label(timeTo,  formatter.format(dedication.getTimeTo(;
   item.add(new Label(hours, dedication.getHours().toString()));
  item.add(new Label(task, dedication.getTask().getName()));
   item.add(new Label(accounts, getAccounts(dedication)));
  item.add(new TextAreaString(serviceStatus, new
  PropertyModelString(item.getModel(), serviceStatus)));
   }
 
  @Override
  protected ItemDedication newItem(String id, int index,
 IModelDedication
  model) {
   OddEvenItemDedication item = new OddEvenItemDedication(id, index,
  model);
  return item;
   }
  });
  }
 
  .html
 
  html
  xmlns:wicket=
 http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd
  
  head/head
  body
  wicket:panel
  table cellspacing=0 class=listado
   tr
  thFecha/th
  thHoras/th
   thTarea/th
  thServicios/th
  thAcciones/th
   /tr
  div wicket:id=dedications
  tr
   tdspan wicket:id=hours[horas]/span/td
  tdspan wicket:id=timeFrom[hora desde]/span]/td
   tdspan wicket:id=timeTo[hora hasta]/span]/td
  tdspan wicket:id=task[tarea]/span/td
   tdspan wicket:id=accounts[cuentas]/span/td
  /tr
   tr
  td colspan=5
  input wicket:id=serviceStatus /
   /td
  /tr
  /div
   /table
  /wicket:panel
  /body
  /html
 
  I'm using a div to group two columns. The problem is that this not a
 valid
  html, and I can't get Odd, Even class in rows. I think it is because div
 is
  repeated instead of tr.
 
  What i'm expecting in the final html is something like this:
 
  table cellspacing=0 class=listado
   tr
  thFecha/th
  thHoras/th
   thTarea/th
  thServicios/th
  thAcciones/th
   /tr
  tr class=Even
  tdspanhours 1/span/td
   tdspantime from 1/span]/td
  tdspantime to 1/span]/td
   tdspantask 1/span/td
  tdspanaccounts 1/span/td
   /tr
  tr class=Even
  td colspan=5
   input wicket:id=serviceStatus /
  /td
  /tr
   tr class=Odd
  tdspanhours 2/span/td
   tdspantime from 2/span]/td
  tdspantime to 2/span]/td
   tdspantask 2/span/td
  tdspanaccounts 2/span/td
   /tr
  tr class=Odd
  td colspan=5
   input wicket:id=serviceStatus /
  /td
  /tr
   /table
 
 
  Thanks!
 
 
  2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com
 
  dataview/listview/datatable should all work just fine, post your code.
 
  -igor
 
  On Mon, Oct 24, 2011 at 5:06 AM, Tito njyt...@gmail.com wrote:
   Hi,
  
   I'm trying to make a table with two columns by item. I mean, my item
 have
  to
   generate two columns.
   The first have attributes of the object, the second have another
  attribute
   with details.
  
   I can't do this. I made tests with DataView and GridView. I don't know
  what
   is the best component. Could you give me an idea of how to do
 something
  like
   this?
  
   Thanks in advance.
  
   Tito
  
 
  -
  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




Re: DataView or GridView with two columns by item

2011-10-24 Thread Igor Vaynberg
On Mon, Oct 24, 2011 at 9:31 AM, Tito njyt...@gmail.com wrote:
 I'm sorry, you are right!
 I said columns but I meant Rows!

 What is the java component for wicket container?

no need for a java component, wicket:container is an auto tag like
wicket:message

 How do you suggest to add Odd, Even classes?

you can make trs webmarkupcontainers that add the correct class

-igor


 Thank you!

 2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com

 ahhh.

 so you want two *rows* not two *columns* per item, attach the repeater
 to a wicket:container tag like so:

 wicket:container wicket:id=repeater
 trtd.../tr
 trtd/tr
 /wicket:container

 you will have to rig up odd/even yourself

 -igor

 On Mon, Oct 24, 2011 at 9:10 AM, Tito njyt...@gmail.com wrote:
  Hi Igor this is what i'm doing:
 
  .java
 
  public DedicationsReportPanel(String id, IModelUsers user, final
  IModelDate dayOfReport) {
  super(id);
 
  add(new DataViewDedication(dedications, new
  DedicationDataProvider(dedicationService,
 user.getObject().getUserName())) {
 
  @Override
  protected void populateItem(ItemDedication item) {
   DateFormat formatter = new SimpleDateFormat(hh:mm);
  final Dedication dedication = item.getModelObject();
   item.add(new Label(timeFrom,
   formatter.format(dedication.getTimeFrom(;
  item.add(new Label(timeTo,  formatter.format(dedication.getTimeTo(;
   item.add(new Label(hours, dedication.getHours().toString()));
  item.add(new Label(task, dedication.getTask().getName()));
   item.add(new Label(accounts, getAccounts(dedication)));
  item.add(new TextAreaString(serviceStatus, new
  PropertyModelString(item.getModel(), serviceStatus)));
   }
 
  @Override
  protected ItemDedication newItem(String id, int index,
 IModelDedication
  model) {
   OddEvenItemDedication item = new OddEvenItemDedication(id, index,
  model);
  return item;
   }
  });
  }
 
  .html
 
  html
  xmlns:wicket=
 http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd
  
  head/head
  body
  wicket:panel
  table cellspacing=0 class=listado
   tr
  thFecha/th
  thHoras/th
   thTarea/th
  thServicios/th
  thAcciones/th
   /tr
  div wicket:id=dedications
  tr
   tdspan wicket:id=hours[horas]/span/td
  tdspan wicket:id=timeFrom[hora desde]/span]/td
   tdspan wicket:id=timeTo[hora hasta]/span]/td
  tdspan wicket:id=task[tarea]/span/td
   tdspan wicket:id=accounts[cuentas]/span/td
  /tr
   tr
  td colspan=5
  input wicket:id=serviceStatus /
   /td
  /tr
  /div
   /table
  /wicket:panel
  /body
  /html
 
  I'm using a div to group two columns. The problem is that this not a
 valid
  html, and I can't get Odd, Even class in rows. I think it is because div
 is
  repeated instead of tr.
 
  What i'm expecting in the final html is something like this:
 
  table cellspacing=0 class=listado
   tr
  thFecha/th
  thHoras/th
   thTarea/th
  thServicios/th
  thAcciones/th
   /tr
  tr class=Even
  tdspanhours 1/span/td
   tdspantime from 1/span]/td
  tdspantime to 1/span]/td
   tdspantask 1/span/td
  tdspanaccounts 1/span/td
   /tr
  tr class=Even
  td colspan=5
   input wicket:id=serviceStatus /
  /td
  /tr
   tr class=Odd
  tdspanhours 2/span/td
   tdspantime from 2/span]/td
  tdspantime to 2/span]/td
   tdspantask 2/span/td
  tdspanaccounts 2/span/td
   /tr
  tr class=Odd
  td colspan=5
   input wicket:id=serviceStatus /
  /td
  /tr
   /table
 
 
  Thanks!
 
 
  2011/10/24 Igor Vaynberg igor.vaynb...@gmail.com
 
  dataview/listview/datatable should all work just fine, post your code.
 
  -igor
 
  On Mon, Oct 24, 2011 at 5:06 AM, Tito njyt...@gmail.com wrote:
   Hi,
  
   I'm trying to make a table with two columns by item. I mean, my item
 have
  to
   generate two columns.
   The first have attributes of the object, the second have another
  attribute
   with details.
  
   I can't do this. I made tests with DataView and GridView. I don't know
  what
   is the best component. Could you give me an idea of how to do
 something
  like
   this?
  
   Thanks in advance.
  
   Tito
  
 
  -
  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




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