Monday, December 21, 2009

Re: UI Binder bugs - maybe config issue on my side(?)

Hi Peter,

Would you mind zipping your project up and hosting it somewhere for me
to download?

I tried copying the pasted ui.xml and java file, but I was unable to
repro the issues you're seeing in my simple project.

Thanks,
jason

On Mon, Dec 21, 2009 at 11:16 AM, Peter <peterlovisek@gmail.com> wrote:
> Dear all,
> I'm working with UI binder and seems to me I have not completed
> successfully installation or there's something wrong in it. In code
> listed below I can see several things I could not understand:
> 1. Project is complied OK and runs. However, having java code opened I
> can see error on lines starting @UiField:
> Field label1 has no corresponding field in template file InboxB.ui.xml
> Field hp has no corresponding field in template file InboxB.ui.xml
>
> 2. Running project shows: A C C  [B]. Which is correct and second 'C'
> proves correct together-sticking of java and XML despite error in (1).
>
> 3. However, no click event is executed ever, clicking at button.
>
> This is very weird situation and might mean my installation is
> completely screwed up. However, all other stuff work, my 5 previous
> GWT project, too. Did anyone hit this situation before?
>
>
> Part of this issue has been described by someone else here:
> http://groups.google.com/group/google-web-toolkit/browse_thread/thread/899561bf5cfc7e7e/c02fc26afc8a7d20?lnk=gst&q=+no+corresponding+field+in+template+file#c02fc26afc8a7d20
>
> Regards
> Peter
>
>
> <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
> <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
>        xmlns:g="urn:import:com.google.gwt.user.client.ui">
>        <ui:style>
>                .important {
>                        font-weight: bold;
>                        cursor:pointer;
>                }
>        </ui:style>
>
>        <g:HorizontalPanel ui:field="hp">
>                <g:Label>A</g:Label>
>                <g:Label ui:field="label1" styleName="{style.important}" text="B2"></
> g:Label>
>                <g:Label>C</g:Label>
>        </g:HorizontalPanel>
> </ui:UiBinder>
>
>
> package com.xploreu.inbox.client;
>
> import com.google.gwt.core.client.GWT;
> import com.google.gwt.event.dom.client.ClickEvent;
> import com.google.gwt.event.dom.client.ClickHandler;
> import com.google.gwt.uibinder.client.UiBinder;
> import com.google.gwt.uibinder.client.UiField;
> import com.google.gwt.uibinder.client.UiHandler;
> import com.google.gwt.user.client.Window;
> import com.google.gwt.user.client.ui.Button;
> import com.google.gwt.user.client.ui.Composite;
> import com.google.gwt.user.client.ui.HorizontalPanel;
> import com.google.gwt.user.client.ui.Label;
> import com.google.gwt.user.client.ui.Widget;
>
> public class InboxB extends Composite implements ClickHandler {
>
>        private static InboxBUiBinder uiBinder = GWT.create
> (InboxBUiBinder.class);
>
>        interface InboxBUiBinder extends UiBinder<Widget, InboxB> {
>        }
>
>        @UiField Label label1;
>        @UiField HorizontalPanel hp;
>        Button b = new Button("B");
>
>        public InboxB(String firstName) {
>                initWidget(uiBinder.createAndBindUi(this));
>
>                label1.setText("C");
>                hp.add(b);
>
>                label1.addClickHandler(this);
>                b.addClickHandler(this);
>        }
>
>        @Override
>        public void onClick(ClickEvent event) {
>                Window.alert("Click");
>        }
> }
>
> --
>
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate