Clara - Declarative UI and Bindings for Vaadin Framework

Thanks for the feedback and for reporting this issue.

I created issue
#22
in GitHub and will look into this when I work on the next release of Clara.

Hi,

is there a way to set a custom TableFieldFactory using your XML syntax? How would I do it in a controller? Something like this?

final Table table = (Table) Clara.findComponentById(content, "myTable");
table.setTableFieldFactory(new CustomTableFieldFactory());

Unfortunately there is no way to set a custom
TableFieldFactory
in the XML. The code snippet you posted should work, but as another option you could also use the
@UiField(“myTable”)
annotation on an instance variable instead of
Clara.findComponentById
.

Best regards,
Teemu

Hiii

For my app, the users(admin) would be creating their own forms and I create the clara layout xml based on the admin placing of the components in the workbench. I use the generated xml to pass it to clara to generate the components needed when a normal user logs in. Essentialy the admin has the rights to create a lot of forms on the fly in runtime, For those components in the XML for which the id is defined and the corresponding annotation is there, the call backs work but what about those omponents which I add in the xml layout and the id is not defined as an annotation in the controller class.Is there some function in the controller which would catch all possbile events and I in the controller I have some common function where I decide which function to call from where,
Fo eg, I want to dynamically assign a new action for a new button I add in the template, but I might not be having an annotation defined, The intention is that I wanna allow the users to create is own forms on the fly in runtime and also define the actions to be performed at the backend

Regards
Kartik

Hi,

Thanks for the very good work. It was quite easy for me to switch to Clara for some existing test components. I prefer the clear XML structure of the component tree.

Perhaps you can even improve the Clara experience:
Since there is no XSD, yet, I had some typing errors for the XML attribute names and sometimes I did not know, if there exists a matching setter in Java (e.g. clickShortcut=“ENTER” does not call setClickShortcut(int keyCode, int… modifiers) because the parameter count is not 0 or 1).

These errors are not signalled by Clara and I had to manually verify the result in the browser (AttributeHandler.assignAttributes simply ignores attributes when no setter is found). Is there a way to set be more strict, when attributes are assigned? (An XSD would be even more helpful, of course.)

Best regards,
Winfried

Hi,

I have created a maven plugin to generate xml schemas for clara.

https://github.com/kumm/claraxsd-maven-plugin

Feedback is welcome.

Awesome! This sounds really good. I will definitely give this plugin a try.

Many Thanks! It worked for me in Eclipse.

To add the generated ‘catalog.xml’:
Preferences > XML > XML Catalog > User Specified Entries > Add > Next Catalog

To make schema validation work in my XML files, I had to replace “clara:” with “file:”. E.g.
xsi:schemaLocation=“urn:import:com.vaadin.ui file://myproject/com.vaadin.ui.xsd”

Thanks for the eclipse info.
Eclipse maybe check the protocol in the url. And well… “clara://” is not valid. yet :wink:
Can you try with “http://”?
For example generate with: ‘-D baseSystemId=“http://myproject/clara/”’
I think it would be less confusing than “file://”.
If it works, I will change the default protocol in systemID to http.

Yes, “http://” works.

In my “catalog.xml” the attribute “xml:base” has an absolute URL (starting with “file:///C:/”). Since I want to check-in this file (my schema will not change to often), it won’t work for others. Eclipse still works fine, if I remove this attribute completely. Does this work in Netbeans, too?

Yes, it works in Netbeans too.
As i understand no xml:base property means all filenames given in uri are relative to catalog.xml. I think I can remove it safely, just giving a quick try to IntelliJ IDEA.

Can I set the icon of a component with Clara?

My current workaround is:
Clara.findComponentById(getCompositionRoot(), “newButton”).setIcon(new ThemeResource(“img/Create.png”));

Better would be (or something similar):

Clara 1.1.0 release is now available in the Vaadin Directory and of course also through the Maven repository. This release includes following bugfixes.

  • Fixed captions for TabSheet (issue #25).
  • Removed logging.properties from the package (issue #26)
  • Fixed @UiField binding of superclass fields (issue #27).

Big thanks for all the feedback and contributions! In case you find some issues with the new release, please let me know.

Thanks for the very good work.
We prefer a clear xml structure for defining a user interface rather than programming it.
Now I want to define an entire table based on Clara.
The table itself can be declared using <Table id=”tbl_product” newItemAllowed…./>
I addition to that I would like to describe the column within that table in a similar way.
Maybe I have overlooked something in the examples / documentation or xsd.
How can I declare the columns within a table using clara?

Thanks Birte

is it possible to use html in vaadin clara?? because i want to design the double header table etc

Unfortunately no, in the current version you cannot mix Vaadin components with HTML tags. This could be a nice feature in future versions.

Hi, great work for start :).

Have you ever considered implementing some mechanism which would generate the Java UiHandlers from the XML file and keep them in sync. In most cases we dont use clara because we have to copy the same thing in two files (java and XML). And is there any plans to define table components (columns) within clara.

Keep up the good work.

How to use the custom component in clara.Since i used customComponent tag but its not supporting.suppose if my custom table is “FreezeTable”, in java I will use that as FreezeTable ft=new FreezeTable() but using clara how can I?

You need to define a namespace to import your component and then use the class name as an element in your XML. Something like this should work:

<VerticalLayout xmlns:m="urn:import:com.yourcompany.app">
    <m:FreezeTable />
</VerticalLayout>

Thanks teemu.Its working. But i have another doubt.Currently we are accessing the xml file from src/main/resources. Does the xml file will work from src/main/java folder.I want to make it access from src/main/java. i tried but i got this exception only java.net.MalformedURLException.Please resolve my issue.thanks in advance