-
1. Re: @Table annotation not present in 3.0-SNAPSHOT
csa May 8, 2014 12:05 PM (in response to vwjugow)Hi Victor,
@Table is present in the 3.0-SNAPSHOT.jar. You can see for yourself:
@OrderedList, @UnorderedList, @Table never had any semantics on types. That's why this was removed. These annotations are designed to be used on injection sites (fields, parameters, methods).
Cheers,
Christian
-
2. Re: Re: @Table annotation not present in 3.0-SNAPSHOT
vwjugow May 9, 2014 12:21 AM (in response to csa)Hi Christian, yeah I think my IDE hadn't refresh correctly or maybe I was trying to annotate a type. Thanks!
Anyways, I've been playing a little bit with ListWidget. I need to constantly update it by adding/removing rows, and I couldn't find a method to just add a row/item. So I tried to use setItems(list) or setValue(list) but it was kind of slow, because it re-creates the whole widget. Is there a way to just add a row ?
In case there isn't I copied your ListWidget class and added a method for this:
public void addItem(M item){ this.items.add(item); }
So the add method calls the overriden onItemAdded method which actually only adds a row instead of recreating the whole thing. Does this looks good to you?
-
3. Re: Re: @Table annotation not present in 3.0-SNAPSHOT
vwjugow May 12, 2014 9:46 AM (in response to csa)Hi csa, I'm trying to use the \@ table annotation. Currently I get the <table> element rendered, but I want that each row is rendered as a <tr> and not a <div>. This is what I'm doing now:
@DataField @Inject @Table private ListWidget<TradeOrder, TradeOrderItemWidget> complaints;
The TradeOrderItemWidget.html file
<tr id="root"> <td style="display: inline-block" data-field="symbol"></td> <td style="display: inline-block" data-field="volume"></td> <td style="display: inline-block" data-field="orderOpenPrice"></td> <td style="display: inline-block" data-field="slippage"></td> <td style="display: inline-block" data-field="comment"></td> </tr>
And I'm getting:
00:05:26.872 [ERROR] 10:08:24 SEVERE [AbstractCreationalContext] error initializing bean: app.client.local.TradeOrderItemWidget
java.lang.IllegalArgumentException: Root Element to visit must not be null.
Whole stack trace: http://pastebin.com/MrsdQ4mU
When I had div's elements instead of the tr, and td it worked, but obviously it rendered divs.
-
4. Re: @Table annotation not present in 3.0-SNAPSHOT
csa May 12, 2014 11:11 AM (in response to vwjugow)Hi,
Here's an example using tr and td:
You will want the root element to be a <table> or <tbody> because the ListWidget will add multiple rows (trs).
Cheers,
Christian
-
5. Re: @Table annotation not present in 3.0-SNAPSHOT
vwjugow May 12, 2014 3:34 PM (in response to csa)Awesome, works like a charm, thank you so much