Checkbox caption into a form

Hello all,

I am trying to add a checkbox into a form which i have done successfully but can anyone tell
me about checkbox caption that if i can change its position from right to left.

As its not proper when we add a checkbox into a form with caption on right while rest are on left.
Any help will do better.

anyone with any possible nearby solution???

You can use a HorizontalLayout or GridLayout, remove the Caption from the Checkbox and use a external Label to display the text instead of setCaption().

Well, won’t work that easy due to the FormLayout. It would place the HorizontalLayout in the “right” column instead of aligning it with the other captions. Only solution I currently can think of is a complete custom Layout for the Form, for example GridLayout.

I also thought it was the only option for that. Thanks for the reply.

Alternatively, you could try to create an Html template in order to set you captions and fields as you want. Above all, if you have so many fields within the form,a custom layout is better than grid (according to me). :slight_smile:

I’ve also created a solution for this, called
FormCheckBox
. It is an extension of CheckBox which delegates caption handling (unlike normal CheckBox). You can use it exactly like a normal CheckBox.

Auke,
when trying to compile widgetset with your add on I get following error:

Loading inherited module 'cz.pse.cp.widgetset.CPWidgetset' [ERROR] Line 31: Unexpected exception while processing element 'inherits' java.lang.NullPointerException at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:324) at com.google.gwt.dev.cfg.ModuleDefSchema$BodySchema.__inherits_begin(ModuleDefSchema.java:502) at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:230) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.startElement(ReflectiveParser.java:294) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:347) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$200(ReflectiveParser.java:68) at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:418) at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:374) at com.google.gwt.dev.cfg.ModuleDefLoader.load(ModuleDefLoader.java:288) at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:231) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromResources(ModuleDefLoader.java:160) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:135) at com.google.gwt.dev.Compiler.run(Compiler.java:130) at com.google.gwt.dev.Compiler$1.run(Compiler.java:100) at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55) at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50) at com.google.gwt.dev.Compiler.main(Compiler.java:107) at com.vaadin.tools.WidgetsetCompiler$1.run(WidgetsetCompiler.java:80) at java.lang.Thread.run(Thread.java:724) [ERROR] Failure while parsing XML com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.util.xml.DefaultSchema.onHandlerException(DefaultSchema.java:58) at com.google.gwt.dev.util.xml.Schema.onHandlerException(Schema.java:66) at com.google.gwt.dev.util.xml.Schema.onHandlerException(Schema.java:66) at com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:240) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.startElement(ReflectiveParser.java:294) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:347) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$200(ReflectiveParser.java:68) at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:418) at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:374) at com.google.gwt.dev.cfg.ModuleDefLoader.load(ModuleDefLoader.java:288) at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:231) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromResources(ModuleDefLoader.java:160) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:135) at com.google.gwt.dev.Compiler.run(Compiler.java:130) at com.google.gwt.dev.Compiler$1.run(Compiler.java:100) at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55) at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50) at com.google.gwt.dev.Compiler.main(Compiler.java:107) at com.vaadin.tools.WidgetsetCompiler$1.run(WidgetsetCompiler.java:80) at java.lang.Thread.run(Thread.java:724) [ERROR] Unexpected error while processing XML com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:371) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$200(ReflectiveParser.java:68) at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:418) at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:374) at com.google.gwt.dev.cfg.ModuleDefLoader.load(ModuleDefLoader.java:288) at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:231) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromResources(ModuleDefLoader.java:160) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:135) at com.google.gwt.dev.Compiler.run(Compiler.java:130) at com.google.gwt.dev.Compiler$1.run(Compiler.java:100) at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55) at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50) at com.google.gwt.dev.Compiler.main(Compiler.java:107) at com.vaadin.tools.WidgetsetCompiler$1.run(WidgetsetCompiler.java:80) at java.lang.Thread.run(Thread.java:724) Widgetset compilation failed Don’t you know where the problem can be?

Hmm, when I use my project I can compile the widgetset, but using the jar I get the same error.

Thanks for pointing this out, I’ll look into it!

I’ve fixed the issue and uploaded version 1.0.1.

Thank you. Now wiidgetset compiles without error.