Thanks Ryan. That works.
Also, this is totally funny:
- Forget I've tried to solve this problem before
- Find my own question online
- Question is already answered
.... it's like time travel.
On Monday, August 20, 2012 11:24:16 PM UTC+10, RyanZA wrote:
>
> It seems to be an issue with the HTMLPanel itself - it blocks @UiField
> (provided=true) explicitly. I still have no idea why, unfortunately.
>
> Quickest workaround is to remove the (provided=true) part, and then make
> the HTMLPanel yourself explicitly, and add it to the original one.
>
> eg in your code, change:
>
> @UiField(provided = true)
> HTMLPanel pnlContent;
> to
> @UiField
> HTMLPanel pnlContent;
> and
>
> @Override
> public Widget asWidget() {
> lblName = new LabelToolItem(row.getStr());
> pnlContent = new HTMLPanel(renderer.render(row));
> return binder.createAndBindUi(this);
> }
>
> to
>
> @Override
> public Widget asWidget() {
> lblName = new LabelToolItem(row.getStr());
> HTMLPanel pnlContent_temp = new HTMLPanel(renderer.render(row));
> Widget w = binder.createAndBindUi(this);
> pnlContent.add(pnlContent_temp);
> return w;
> }
>
>
>
> On Monday, August 20, 2012 3:52:46 AM UTC+2, Peter Leong wrote:
>>
>> I'm having same problem. Did you find a solution?
>>
>> My code uses 'IsWidget', no Composite:
>> http://subversion.assembla.com/svn/freshcode_public/learn/gwt/src/main/java/biz/freshcode/learn/gwt/client/uispike/gxt/LineItem.java
>> Also, I'm using 2.5.0-rc1 because of the Maven plugin.
>>
>> Pete
>>
>> On Monday, July 23, 2012 4:48:13 AM UTC+10, RyanZA wrote:
>>>
>>> Previously in GWT 2.4 and below, this would work:
>>>
>>> UI Binder:
>>> <g:HTMLPanel ui:field="myPanel" />
>>>
>>> Code:
>>> @UiField (provided=true)
>>> HTMLPanel myPanel;
>>>
>>> myPanel = new HTMLPanel("foobar");
>>>
>>>
>>> In GWT 2.5, this now gives an error:
>>>
>>> (gwt source)
>>> // Make sure that, if there is a UiField for this panel, it isn't
>>> // (provided = true), as that isn't supported.
>>> if (uiField != null && uiField.isProvided()) {
>>> writer.die("UiField %s for HTMLPanel cannot be provided.",
>>> fieldName);
>>> }
>>>
>>>
>>> Just wondering why provided=true is no longer supported? AFAIK this was
>>> the purpose of provided=true in UiBinder?
>>>
>>> I've now changed the code to have UiBinder create an HTMLPanel for me
>>> and then add my widget to it, but this gives an extra unneeded wrapping div
>>> in my HTML...
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/e-YMXCF_okAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.