Re: Repeater component with dynamic column list

2009-03-26 Thread rora

 
%-O
I've spent a lot of time trying to figure out what's wrong with code and
markup but didn't notice this typo.

Thanks Martijn



You might want to spell wicket correctly in your markup. wikcet is not
the valid xmlns prefix :)

Martijn

-- 
View this message in context: 
http://www.nabble.com/Repeater-component-with-dynamic-column-list-tp22700806p22717153.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Repeater component with dynamic column list

2009-03-26 Thread Martijn Dashorst
anel
> {
>    public EntryDataPanel(String id, ArrayList entries)
>    {
>        super (id);
>
>        RepeatingView heading = new RepeatingView("heading");
>        for (FieldData fd : entries.get(0).entryFields)
>        {
>            heading.add(new Label(heading.newChildId(), fd.fieldLabel));
>        }
>        add(heading);
>        RepeatingView row = new RepeatingView("row");
>        add(row);
>        for (EntryData ed : entries)
>        {
>           WebMarkupContainer r = new WebMarkupContainer(row.newChildId());
>           RepeatingView cell = new RepeatingView("cell");
>           row.add(r);
>           r.add(cell);
>           cell.add(new Label(cell.newChildId(), ed.entryID));
>           for (FieldData fd : ed.entryFields)
>           {
>                cell.add(new Label(cell.newChildId(), fd.fieldValue));
>           }
>        }
>    }
> }
>
> I don't really know which component I am missing in the markup.
> I would be very grateful if you could help me once again, please.
> Regards
> R
>
>
>
>
>
> Janos Cserep-2 wrote:
>>
>>
>> I would use a custom panel component which would have the following
>> markup:
>> 
>>    Entry Id
>>   
>>   
>> 
>> 
>>   > for (FieldData fd : entries.get(0).entryFields) {
>>   heading.add(new Label(heading.newChildId(), fd.fieldLabel));
>> }
>> add(heading);
>> RepeatingView row = new RepeatingView("row");
>> add(row);
>> for (EntyData ed : entries) {
>>    WebMarkupContainer r = new WebMarkupContainer(row.newChildId());
>>    RepeatingView cell = new RepeatingView('cell");
>>    row.add(r);
>>    r.add(cell);
>>    cell.add(new Label(cell.newChildId(), ed.entryId));
>>    for (FieldData fd : ed.entryFields) {
>>      cell.add(new Label(cell.newChildId(), fd.fieldValue));
>>    }
>> }
>>
>> You need the WebMarkupContainer because it will get the same markup that
>> the
>> "row" repeatingview gets.
>>
>> This is quite basic, there is some room for optimization but I hope you
>> get
>> it.
>>
>> Janos
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Repeater-component-with-dynamic-column-list-tp22700806p22709785.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.5 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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



Re: Repeater component with dynamic column list

2009-03-25 Thread rora
  cell.add(new Label(cell.newChildId(), fd.fieldValue));
   }
}
}
}

I don't really know which component I am missing in the markup.
I would be very grateful if you could help me once again, please.
Regards
R





Janos Cserep-2 wrote:
> 
> 
> I would use a custom panel component which would have the following
> markup:
> 
>Entry Id
>   
>   
> 
> 
>for (FieldData fd : entries.get(0).entryFields) {
>   heading.add(new Label(heading.newChildId(), fd.fieldLabel));
> }
> add(heading);
> RepeatingView row = new RepeatingView("row");
> add(row);
> for (EntyData ed : entries) {
>WebMarkupContainer r = new WebMarkupContainer(row.newChildId());
>RepeatingView cell = new RepeatingView('cell");
>row.add(r);
>r.add(cell);
>cell.add(new Label(cell.newChildId(), ed.entryId));
>for (FieldData fd : ed.entryFields) {
>  cell.add(new Label(cell.newChildId(), fd.fieldValue));
>}
> }
> 
> You need the WebMarkupContainer because it will get the same markup that
> the
> "row" repeatingview gets.
> 
> This is quite basic, there is some room for optimization but I hope you
> get
> it.
> 
> Janos
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Repeater-component-with-dynamic-column-list-tp22700806p22709785.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Repeater component with dynamic column list

2009-03-25 Thread Cserep Janos
>
> I would like to know if it would be possible at all to use one of the
> repeater control family member to display such data structure. I'll
> appreciate any help and sample code.
>

I would use a custom panel component which would have the following markup:

   Entry Id
  
  


  

Re: Repeater component with dynamic column list

2009-03-25 Thread Jonas
We've created a grid with dynamic columns similar to
org.apache.wicket.extensions.markup.html.repeater.data.grid.AbstractDataGridView,
except, of course, that the cell populators (the columns) don't come from
a fixed array, but from a (dynamic) list.

On Wed, Mar 25, 2009 at 1:35 PM, rora  wrote:
>
> Hello,
> my goal is to display a table with dynamic number of columns (and of course
> rows) based on my EntryData class.
>
> ArrayList entries = ...;
>
> public class EntryData implements Serializable
> {
>    private String                     entryID;
>    private ArrayList entryFields;
> [...]
> }
>
> where
>
> public class FieldData implements Serializable
> {
>    private int       fieldId;
>    private String   fieldLabel;
>    private String   fieldValue;
> [...]
> }
>
> I would like to have a table presenting entryID and values of all the fields
> for each entry on the list.
>
> Entry ID              | entryFields[0].fieldLabel                 | ... |
> entryFields[x].fieldLabel
> 
> entries[0].entryID | entries[0].entryFields[0].fieldValue  | ... |
> entries[0].entryFields[x].fieldValue
> ...
> entries[y].entryID | entries[y].entryFields[x].fieldValue  | ... |
> entries[y].entryFields[x].fieldValue
>
> I am not really experienced in Wicket and tried to find some Repeater class
> example to use it as a base for building my own solution. Unfortunately I
> didn't find anything that suits my needs.
> I would like to know if it would be possible at all to use one of the
> repeater control family member to display such data structure. I'll
> appreciate any help and sample code.
>
> Kind regards
> R
> --
> View this message in context: 
> http://www.nabble.com/Repeater-component-with-dynamic-column-list-tp22700806p22700806.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> 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



Repeater component with dynamic column list

2009-03-25 Thread rora

Hello,
my goal is to display a table with dynamic number of columns (and of course
rows) based on my EntryData class.

ArrayList entries = ...;

public class EntryData implements Serializable
{
private String entryID;
private ArrayList entryFields;
[...]
}

where

public class FieldData implements Serializable
{
private int   fieldId;
private String   fieldLabel;
private String   fieldValue;
[...]
}

I would like to have a table presenting entryID and values of all the fields
for each entry on the list.

Entry ID  | entryFields[0].fieldLabel | ... |
entryFields[x].fieldLabel

entries[0].entryID | entries[0].entryFields[0].fieldValue  | ... |
entries[0].entryFields[x].fieldValue
...
entries[y].entryID | entries[y].entryFields[x].fieldValue  | ... |
entries[y].entryFields[x].fieldValue

I am not really experienced in Wicket and tried to find some Repeater class
example to use it as a base for building my own solution. Unfortunately I
didn't find anything that suits my needs.
I would like to know if it would be possible at all to use one of the
repeater control family member to display such data structure. I'll
appreciate any help and sample code.

Kind regards
R
-- 
View this message in context: 
http://www.nabble.com/Repeater-component-with-dynamic-column-list-tp22700806p22700806.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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