Is this 
<http://www.gwtproject.org/doc/latest/DevGuideUiBinder.html#Hello_Widget_World> 
not enough? Buried too deep? Lacking examples and/or a step-by-step?

In order to use a set of widgets in a ui.xml template file, you need to tie 
their package to an XML namespace prefix. That’s what’s happening in this 
attribute of the 
root <ui:uibinder> element: xmlns:g='urn:import:com.google.gwt.user.client.ui'. 
This says that every class in the com.google.gwt.user.client.ui package can 
be used as an element with prefix g and a tag name matching its Java class 
name, like <g:ListBox>.

See how the g:ListBox element has a visibleItemCount='1' attribute? That 
becomes a call to ListBox#setVisibleItemCount(int) 
<http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/ui/ListBox.html#setVisibleItemCount-int->.
 
Every one of the widget’s methods that follow JavaBean-style conventions 
for setting a property can be used this way.

On Thursday, October 21, 2021 at 6:32:24 AM UTC+2 [email protected] wrote:

> Hey, hey, hey,
>
> I'm one of us Javascript-deaf. With GWT I'm back to my a screen-a-day in 
> pure Java. Just loving it.
>
> Still, would GWT team be accepting of some PRs to update Javadocs? Took me 
> a day of Googling to figure out how to make use of custom widgets in UI 
> Binder templates.
>
> Slava
>
>
> On Wednesday, October 20, 2021 at 7:15:59 PM UTC-7 Craig Mitchell wrote:
>
>> GWT does many great things.  Implementation of lists and tables wasn't 
>> one of them (IMHO).
>>
>> If GWT 3 ever comes out.  It will be great to have separation of this 
>> stuff.
>>
>> However, to answer your question, yes, it would make sense, I just don't 
>> know what the likelihood of a 2.9.1 release is.
>> On Tuesday, 19 October 2021 at 2:36:28 pm UTC+11 [email protected] wrote:
>>
>>> Folks, 
>>>
>>> Just following up on what turned to be my own blunder. Using 
>>> ListDataProvider doesn't work when the CellTable is created using pageSize 
>>> = 0. 
>>>
>>> super(0, resources, keyProvider);
>>>
>>> It still works when using setRowCount(); setRowData();.
>>>
>>> So I fixed it for the time being by setting a meaningfully large 
>>> pageSize.
>>>
>>> Here is the question: would it make sense to add a bit more to the 
>>> Javadoc for pageSize. Or maybe checking for 0 and throwing 
>>> IllegalArgumentException?
>>>
>>> On Friday, September 24, 2021 at 4:44:10 PM UTC-7 Slava Imeshev wrote:
>>>
>>>> So, I'm following basic examples, and I just cannot get it to work. The 
>>>> populate() method below using ListDataProvider leaves the table empty. 
>>>> populateWorking() works. Any hints?
>>>>
>>>> public class GapAnalysisListTable extends CellTable<GapAnalysisVO> {
>>>>
>>>> public GapAnalysisListTable() {
>>>>
>>>> // Create a data provider.
>>>> dataProvider = new ListDataProvider<>(GapAnalysisVO::getId);
>>>>
>>>> // Connect the table to the data provider.
>>>> dataProvider.addDataDisplay(this);
>>>> }
>>>>
>>>> public void populate(final GapAnalysisVO[] gapAnalysisVOList) {
>>>>
>>>> final List<GapAnalysisVO> list = dataProvider.getList();
>>>> list.addAll(Arrays.asList(gapAnalysisVOList));
>>>> dataProvider.refresh();
>>>> }
>>>>
>>>> public void populateWorks(final GapAnalysisVO[] gapAnalysisVOList) {
>>>>
>>>> setRowCount(gapAnalysisVOList.length);
>>>> setRowData(Arrays.asList(gapAnalysisVOList));
>>>> }
>>>> }
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/e015c9dd-d133-40e7-baed-5e52ba96c99dn%40googlegroups.com.

Reply via email to