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");
}
}
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
> --
>
> 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-we...@googlegroups.com.
> To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>
>
>
ns.blucina.net/lovisek/tmp/XploreU-inbox.zip
I also deployed the project here:
http://ns.blucina.net/lovisek/tmp/xu/XploreU_inbox.html
As you can see, onClick handler is never fired despite it should be
triggered after clicking on button and bold C label.
Regards
Peter
On Dec 21, 6:59 pm, Jason Parekh <jasonpar...@gmail.com> wrote:
> 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 <peterlovi...@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/threa...
On Dec 22, 10:42 am, Peter <peterlovi...@gmail.com> wrote:
> Sure, thanks for helping hand. Zipped project is here:
>
> ns.blucina.net/lovisek/tmp/XploreU-inbox.zip
>
> I also deployed the project here:http://ns.blucina.net/lovisek/tmp/xu/XploreU_inbox.html
>
> As you can see, onClick handler is never fired despite it should be
> triggered after clicking on button and bold C label.
You're not attaching your *widget* to the document, only its
*element*, so events are not sunk:
Document.get().getBody().appendChild(b.getElement());
Use a RootPanel or RootLayoutPanel to add widgets to the page. That's
"GWT 101".
Also, would you mind downloading a fresh copy of Eclipse (with a new
workspace) for testing purposes? I imported your project, and the
@UiFields are not marked as errors for me. If a fresh Eclipse works,
it'll help in debugging whether it's a system configuration issue or
an Eclipse configuration issue.
Thanks,
jason
Thank you guys very much for help.
Regards
Peter
On Dec 22, 5:43 pm, Jason Parekh <jasonpar...@gmail.com> wrote:
> Peter,
>
> Also, would you mind downloading a fresh copy of Eclipse (with a new
> workspace) for testing purposes? I imported your project, and the
> @UiFields are not marked as errors for me. If a fresh Eclipse works,
> it'll help in debugging whether it's a system configuration issue or
> an Eclipse configuration issue.
>
> Thanks,
> jason
>
What I did to solve this problem is to copy the old ".metadata" folder
in the eclipse workspace folder.
And viola..., everything is working again...
Hope this info help.
My project has the file layout below:
1. java source path: src/main/java
2. package layout:
- aaa.projectname
- aaa.projectname.modulename
-- contains modulename.gwt.xml
- aaa.projectname.modulename.client
-- contains *.java and *.ui.xml
3. war directory, as default, is war/
I use springsource STS 2.3.0 based on Eclipse 3.5.1, Google Plugin for
Eclipse 3.5 1.3.0.v201003161223, Google App Engine Java SDK 1.3.1
1.3.1.v201002101412, Google Web Toolkit SDK 2.0.3 2.0.3.v201002191036,
and m2eclilpse 0.9.8. My project uses m2eclipse (or maven2) to manage
the dependencies.
I tried all the workarounds mentioned above but in vain. However,
following Google Web application wizard provided by GEP, thus having a
standard project file layout, works perfectly. Currently in my case I
have to disable the @uifield errors/warning report in the preference
dialog.
Any GWT team guys please check on this. Thanks a lot.