tehapo / clara Goto Github PK
View Code? Open in Web Editor NEWDeclarative UI and bindings for Vaadin Framework
License: Apache License 2.0
Declarative UI and bindings for Vaadin Framework
License: Apache License 2.0
Use field's name if an @UiField
annotation doesn't have an explicit id. Currently the field is assigned only based on an explicitly given id of a component. Make this optional and if no id is given, the field's name is used as the id.
Hi! I have problem.
I have two widgets: Canvas Plus and DragDropLayouts.
My clara declaration (not full) is below.
If I use this, will throw exception.
java.lang.IllegalStateException: The given Component must be attached to a ComponentContainer.
Stack trace is below.
But, if I write with Java - it's ok. It's clara's bug, or not?
Clara declaration
<VerticalLayout xmlns="urn:import:com.vaadin.ui"
xmlns:dd="urn:import:fi.jasoft.dragdroplayouts"
xmlns:l="urn:vaadin:parent"
xmlns:can="com.alsnightsoft.vaadin.widgets.canvasplus"
sizeFull="" styleName = "main-layout">
<!-- other components -->
<dd:DDAbsoluteLayout id="workspace" l:expandRatio="1.0" width="98%" height="92%" margin="true" styleName="workspace">
<can:CanvasPlus width="400px" height="300px" cssPosition="left: 20px; top:20px;"/>
</dd:DDAbsoluteLayout>
<!-- other components -->
</VerticalLayout>
Java similar code
@UiField("workspace")
DDAbsoluteLayout ddabsLayout;
....
CanvasPlus canvas = new CanvasPlus();
canvas.setWidth("400px");
canvas.setHeight("300px");
ddabsLayout.addComponent(canvas, "left: 20px; top:20px;");
Stack trace
SEVERE:
java.lang.IllegalStateException: The given Component must be attached to a ComponentContainer.
at org.vaadin.teemu.clara.inflater.handler.LayoutAttributeHandler.assignAttributes(LayoutAttributeHandler.java:38)
at org.vaadin.teemu.clara.inflater.LayoutInflater$LayoutInflaterContentHandler.handleAttributes(LayoutInflater.java:202)
at org.vaadin.teemu.clara.inflater.LayoutInflater$LayoutInflaterContentHandler.startElement(LayoutInflater.java:147)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:379)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at org.vaadin.teemu.clara.inflater.LayoutInflater.inflate(LayoutInflater.java:72)
at org.vaadin.teemu.clara.Clara.create(Clara.java:69)
at org.vaadin.teemu.clara.Clara.create(Clara.java:117)
at from.ivan_osipov.myhomepage.MyHomePage.init(MyHomePage.java:66)
at com.vaadin.ui.UI.doInit(UI.java:641)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:217)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:74)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1406)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:305)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:172)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
at java.lang.Thread.run(Thread.java:745)
2015-02-07 09:27:00.283:WARN:oejs.ServletHandler:qtp1041326823-21:
javax.servlet.ServletException: com.vaadin.server.ServiceException: java.lang.IllegalStateException: The given Component must be attached to a ComponentContainer.
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:307)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:172)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
at java.lang.Thread.run(Thread.java:745)
Caused by:
com.vaadin.server.ServiceException: java.lang.IllegalStateException: The given Component must be attached to a ComponentContainer.
at com.vaadin.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1464)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1418)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:305)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:172)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
at java.lang.Thread.run(Thread.java:745)
Caused by:
java.lang.IllegalStateException: The given Component must be attached to a ComponentContainer.
at org.vaadin.teemu.clara.inflater.handler.LayoutAttributeHandler.assignAttributes(LayoutAttributeHandler.java:38)
at org.vaadin.teemu.clara.inflater.LayoutInflater$LayoutInflaterContentHandler.handleAttributes(LayoutInflater.java:202)
at org.vaadin.teemu.clara.inflater.LayoutInflater$LayoutInflaterContentHandler.startElement(LayoutInflater.java:147)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:379)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at org.vaadin.teemu.clara.inflater.LayoutInflater.inflate(LayoutInflater.java:72)
at org.vaadin.teemu.clara.Clara.create(Clara.java:69)
at org.vaadin.teemu.clara.Clara.create(Clara.java:117)
at from.ivan_osipov.myhomepage.MyHomePage.init(MyHomePage.java:66)
at com.vaadin.ui.UI.doInit(UI.java:641)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:217)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:74)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1406)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:305)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:172)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
at java.lang.Thread.run(Thread.java:745)
Investigate if the AttributeFilter
concept could use SAX XMLFilter
or even be completely deprecated in favor of XMLFilter
.
See http://docs.oracle.com/javase/6/docs/api/org/xml/sax/XMLFilter.html
Use com.vaadin.ui
as default namespace so that if you only use core components, you don't need to specify the namespace in XML file.
Add support for Vaadin 7. This should be a fairly minor task as Clara doesn't heavily depend on the Vaadin API (a lot of reflection is used instead of direct API calls).
Clara contains a logging.properties in the default package.
According to comments in this file it is intended to help optional configuration for development.
In practice this file is found by the application classloader exactly as it were in WEB-INF/classes, and overrides the configuration for the whole war.
Tested on Tomcat 7.0.53, and 8.0.3-beta. Just start the demo app, and you get all FINE messages from clara without any configuration.
I think it should be renamed, or moved away from default package.
Clara supports adding a Menubar, but I can't persuade it to add a MenuItem. There is not an example in the test suite.
Input:
<MenuBar id="menubar">
<MenuItem id="foo" />
</MenuBar>
provokes:
HTTP Status 500 - com.vaadin.server.ServiceException: org.vaadin.teemu.clara.inflater.LayoutInflaterException: Couldn't instantiate a component for namespace com.vaadin.ui and name MenuItem. Can't get around this by declaring <MenuBar.MenuItem id="foo" />, since MenuBar.MenuItem is an inner class, and needs a reference
like MenuBar$MenuItem, which is a illegal XML name.
In our project at Tampere University of Technology we are trying to use Clara. With Jetty and Tomcat it works perfectly, but with GoogleAppEngine we get a serialization error:
E 2013-10-09 23:33:16.720 com.vaadin.server.GAEVaadinServlet service: Not serializable! java.io.NotSerializableException: org.vaadin.teemu.clara.binder.Binder$1 at java.io.Obj
E 2013-10-09 23:33:16.720 <continued from previous message> at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:306)
We are using Vaadin 7.1.6 and our class that uses Clara is simply:
package org.vaadin.mideaas;
import org.vaadin.teemu.clara.Clara;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
@SuppressWarnings("serial")
public abstract class MideaasComponent extends CustomComponent {
private boolean loaded = false;
public MideaasComponent() {
super();
loadXml();
}
private void loadXml() {
if (!loaded) {
String cls = this.getClass().getName();
String path = cls.replace('.', '/');
String model = path + ".clara.xml";
Component c = Clara.create(getClass().getClassLoader().getResourceAsStream(model), this);
setCompositionRoot(c);
loaded = true;
}
}
}
Classloaders are restricted in OSGi environment, so changing the line
componentClass = Class.forName(qualifiedClassName);
to
componentClass =Thread.currentThread().getContextClassLoader().loadClass(qualifiedClassName);
would enable the Clara to be used in OSGi environment.
See Vaadin forum for more information: https://vaadin.com/forum#!/thread/1492517/4080396
Currently the inflate process creates a new instance of every @UiField in a controller class and populates the fields in the given controller object respectively. I'd like Clara to instantiate and populate only the fields that are null in the controller object but still include the non-null ones in the Component hierarchy.
In my case, I'm CDI-injecting a component instance in the controller like so:
@Inject
@UiField("test-component")
private TestComponent testComponent;
But I'd like Clara to include the TestComponent in my Component hierarchy even though it's instantiated outside of Clara.
Add attribute interceptors that can be used to convert attribute values. The main use case would be to provide internationalization for captions etc.
The basic idea could be something like:
public String intercept(String name, String value) {
if (value.startsWith("!{i18n:")) {
// Get translation for the value.
return getInternationalizedString(value.substring("!{i18n:".length(), value.length() - 2));
}
return value; // Leave untouched.
}
Hi,
I've been trying to add Clara to my project, and it fails when it tries to build.
It seems to try and load clara's parent-pom, and has no success:
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.vaadin.addons:clara:jar:0.2.0
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:317)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:172)
at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:419)
at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:243)
... 25 more
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact org.vaadin.addons:clara-parent:pom:0.2.0 in vaadin-addons (http://maven.vaadin.com/vaadin-addons)
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:126)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:819)
at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:670)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:308)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:232)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:308)
... 28 more
Would you be able to help, or point me in the right direction.
Hi!
Component CheckBox has property "value". She set as boxed Boolean.
CheckBox extends AbstractField, and
<CheckBox caption="Don't worry be happy" value="true"/>
throws follow exception
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
at com.vaadin.ui.CheckBox.setInternalValue(CheckBox.java:31)
at com.vaadin.ui.AbstractField.setValue(AbstractField.java:497)
at com.vaadin.ui.AbstractField.setValue(AbstractField.java:445)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.vaadin.teemu.clara.inflater.handler.AttributeHandler.invokeWithAttributeFilters(AttributeHandler.java:113)
at org.vaadin.teemu.clara.inflater.handler.AttributeHandler.assignAttributes(AttributeHandler.java:87)
at org.vaadin.teemu.clara.inflater.LayoutInflater$LayoutInflaterContentHandler.handleAttributes(LayoutInflater.java:202)
at org.vaadin.teemu.clara.inflater.LayoutInflater$LayoutInflaterContentHandler.startElement(LayoutInflater.java:145)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:356)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at org.vaadin.teemu.clara.inflater.LayoutInflater.inflate(LayoutInflater.java:72)
at org.vaadin.teemu.clara.Clara.create(Clara.java:69)
at org.vaadin.teemu.clara.Clara.create(Clara.java:117)
at from.ivan_osipov.myhomepage.MyHomePage.init(MyHomePage.java:62)
at com.vaadin.ui.UI.doInit(UI.java:641)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:217)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:74)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1406)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:305)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:172)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
at java.lang.Thread.run(Thread.java:745)
Possible API (Vaadin 7 specific): Clara.findComponentById(HasComponents c, String id)
.
Related to #9
It will be nice to have auto generated xsd attached to editor of the xml file.
Hi
I'm looking at Clara for our vaadin projects and I love it so far. But I run into a problem: We have some (abstract) classes from which we inherit. The (abstract) superclass creates its UI using clara and defines some UiFields. But the fields remain null.
Given
1.
class A {
@UiField("foo")
private Component foo;
}
2.
class B extends A {}
4. FooComponent.xml
3.
Clara.create("/FancyLayoutContainingFooComponent.xml", new B())
IS: the field foo is not initialized with an instance of a HorizontalLayout
SHOULD: the field foo should be set
Width attribute is handled wrong as width="200px"
should make a component 200 pixels wide. The setter setWidth(float)
is called instead of setWidth(String)
.
This issue was originally reported on Vaadin Forum.
hi.
at first, I cant english very well. I'm sorry.
my sugggestion is, for example, like this...
@UiDataSource("my-table")
@Inject
private MyPrivateContainer container; // not only method, but also field.
how do you think about this?
Create a proper Clara tutorial to complement the quickstart guide (of the README.md file).
Add support for setters without any parameters like setSizeFull()
. The XML syntax could be like:
<VerticalLayout sizeFull="" />
Change the namespace identifier of the URN names. Currently vaadin
is used. Change the name to package
or java
to be more descriptive about what the namespace refers to.
URN like urn:vaadin:org.vaadin.teemu.ratingstars
would turn into urn:package:org.vaadin.teemu.ratingstars
.
Return value of the XML parsing should be the root component defined in the XML file. Currently it is InflatedCustomComponent
. This means that a separate utility method (see #10) is needed to find child components by their id.
Come up with a better name for ViewInflater as the word View will have a special meaning in Vaadin 7.
<TabSheet id="tabSheet" sizeFull="">
<Label value="test" caption="Label"/>
</TabSheet>
Clara adds new tab sheet tab with label, but caption text is not set.
Hi,
How can i use this addon to place component to a AbsoluteLayout with a position.
Is there an equivalent of "addComponent(componant,"left:50px; top:50px;")" in the xml file ?
Thx
Allow embedding of HTML content in the XML layout.
One possible way to achieve this could be to parse the HTML content blocks into a separate templates creating a <div location="xyz">
for each Vaadin component inside the HTML. The created template could then be fed to a CustomLayout
and all contained Vaadin components would be added to the CustomLayout
using addComponent(component, "xyz")
method.
Just an idea at this point that could be tested out.
See an example by Matti: https://github.com/mstahv/vodatime/blob/master/assembly.xml
Automate the building and packaging of the add-on by using Ant, Gradle or Maven. Currently the project directory structure is somewhat like Maven but it's still actually not used.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.