thanks a lot :-)
Oh yes. Sorry, old API. I think you can just use JexlInspectionResultProcessor, and insert ${...} blocks into your annotations. So like: @UiAttribute( name = HIDDEN, value = "${!this.readOnly}" ) If it helps, the SWT Address Book example uses this exact approach. Please take a look.
thanks a lot for your answer :-) We use metawidget 4.2 but in this version i cannot find the @JexlAttribute, JexlInspector. I can only find JexlInspectionResultProcessor, JexlInspectionResultProcessorConfig. Can you please look it up?
What you're asking for is an embedded expression language, which SWT doesn't provide itself. There are a number of ways you can add one. Try JexlInspector: http://blog.kennardconsulting.com/2008/07/expression-language-el-for-swing.html See also: http://metawidget.org/doc/api/org/metawidget/inspectionresultprocessor/commons/jexl/JexlInspectionResultProcessorConfig.html
Hello, First of all thank you for a great project. Now to the problem. I have a button, which i want to disable depending on the value of another element. The structure looks as following: public interface A { public static interface AA { StateEnum getState(); <- the enum value i am interested in } public static interface AB { void block(); <- Button that i have to disable. } } How can i do this? I want to make a general solution and my idea was to write an annotation with 2 values: first is the...
Hello, First of all thank you for a great project. Now to the problem. I have a button, which i want to disable depending on the value of another element. The structure looks as following: public interface A { public static interface AA { StateEnum getState(); <- the enum value i am interested in } public static interface AB { void block(); <- Button that i have to disable. } } How can i do this? I want to make a general solution and my idea was to write an annotation with 2 values: first is the...
Hello, First of all thank you for a great project. Now to the problem. I have a button, which i want to disable depending on the value of another element. The structure looks as following: interface A { interface AA { StateEnum getState(); <- the enum value i am interested in } interface AB { void block(); <- Button that i have to disable. } } How can i do this? I want to make a general solution and my idea was to write an annotation with 2 values: first is the name of the property, second is the...
Hello, First of all thank you for a great project. Now to the problem. I have a button, which i want to disable depending on the value of another element. The structure looks as following: interface A { interface AA { getState(); <- the enum value i am interested in } interface AB { block(); <- Button that i have to disable. ) } How can i do this? I want to make a general solution and my idea was to write an annotation with 2 values: first is the name of the property, second is the value. So something...
Ok, thanks for the input. FYI, I think I will try to do something like this: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) public @interface Delegate { Class<? extends Annotation> value(); } @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) @Delegate(UiAttribute.class) public @interface MyUiAttribute { String[] name(); String value(); } When I translate methods parameters to bean properties with ByteBuddy, all @MyUiAttribute annotations will be replaced...
I think having @Ui annotations on parameters would break a lot of stuff. You'll need to create your own Inspector.
In the end, what I did was to use ByteBuddy to generate a dynamic bean class from the method: each parameter of the method is translated into a bean property (getter, setter and annotations). Once the form is filled, I collect all properties into an Object[] so that I can invoke the method via reflection. The only problem is that I cannot annotate method parameters with annotations like @UiLabel, @UiRequired... as those can only be used on fields and methods (not parameters). Do you think allowing...
Yes, we have something like this (although you may need to adapt it to your needs). MetawidgetAnnotationInspector already recognizes an annotation called UiAction. Most WidgetBuilder implementations recognize UiAction and generate buttons.
Hi, Do you think it would be possible, with the current version of metawidget, to create an inspector for java.lang.reflect.Method? A form with all the method's parameters could then be generated and would be used to fill/create an Object[]. That array could then be used to call Method.invoke(target, args). Of course, all @UiXXX annotations should be allowed on ElementType.PARAMETER. Using java 8 java.lang.reflect.Parameter.getName() would also be nice. Ultimately, this could be used to generate...
The recommended approach is to write your own WidgetProcessor to 'catch' the widget as it is being constructed and modify it (by setting default button or whatever). Here's a similar example you should be able to adapt: http://blog.kennardconsulting.com/2012/06/swingmetawidget-limiting-length-of.html
Hello, I'm a newbie to metawidget. Thank you very much for this great tool! I'm workiing with SwingMetaWidget. I can't figure out how to make a button (defined via a UiAction annotation) to be the dafault button (i.e. activated when user presses Enter on the keyboard). I know I have to use getRootPane().setDefaultButton(...), but I can't get a reference to the generated buttons. Using buttonsMetawidget.getComponent("ok") does not work because buttons are embedded in a Facet. Thank you for any clue...
Richard ,thanks a lot for your tips.
Some tips: First, bind the Metawidget value to a Map Remove all Inspectors except XmlSchemaInspector (since you are using an XML Schema as your source of truth). At the moment, PropertyTypeInspector is probably stopping you since your value is empty. Debug XmlSchemaInspector and make sure 'inspect' is being called. Debug what it is returning (the inspection result) You will need to create your own version of org.metawidget.faces.component.widgetprocessor.StandardBindingProcessor that outputs JSF...
Hello, I worked on it but i can't gener the ui from my data(xsd) . in my project, i have a xsd file note.xsd <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="note"> <xs:complexType> <xs:sequence> <xs:element type="xs:string" name="to"/> <xs:element type="xs:string" name="from"/> <xs:element type="xs:string" name="heading"/> <xs:element type="xs:string" name="body"/> </xs:sequence> </xs:complexType> </xs:element>...
Richard: Thank you so much for you help. I am going to work on it ,and i hope it will secceed. regards, JINBO
In JSF, setPath is handled by JSF's normal value binding. Are you meaning to instantiate the JSF Metawidget programmatically? You wouldn't normally do 'new HtmlMetawidget' in Java code. Rather, you would use... <m:metawidget value="#{foo.bar}" config="myConfig"/> ...just like a regular JSF Facelets (or JSP) tag. And therefore 'foo.bar' is the path. And you would configure your Metawidget through an XML config file (myConfig), not through Java code. You can still opt to use the XSD Inspector in this...
Hello I started using Metawidget recently and I am having problems about how to use xmlschema and to show the table in the Webpage like this : final SwingMetawidget metawidget = new SwingMetawidget(); metawidget.setInspector( new XmlSchemaInspector( new XmlSchemaInspectorConfig().setInputStream( new SimpleResourceResolver().openResource( "org/metawidget/inspector/xsd/root/summary.xsd" ) ) ) ); metawidget.addInspectionResultProcessor( new XmlSchemaToJavaTypeMappingProcessor<SwingMetawidget>() ); metawidget.setPath("channelType");...
Can you send example code to support@metawidget.org?
I'm using Swing. The problem I have right now is, as soon as I switch to the TabbedLayout as it is in the example, all @Action buttons disappear from my UI. Is there a way to fix that? When I used the simple config such as mWidget.setConfig(xmlDocument);, then it works fine. With the CompisiteInspector, the tabs are fine, but all my buttons go away.
Thank you so much. I got it working with that reply!
Thanks for your interest in Metawidget. To attach an ActionListener, add a custom WidgetProcessor. Here are some helpful links: http://blog.kennardconsulting.com/2012/06/swingmetawidget-limiting-length-of.html http://metawidget.org/doc/reference/en/html/ch02s05.html Quite how you decide whether to attach an ActionListener is up to you. It could be as crude as just checking attributes.name or you could create your own custom annotation (and then a custom Inspector) and then look for that. Here's an...
Hi Everybody! I started using Metawidget (with Java) recently and I am having problems figuring out how to write my own ActionListeners for the autocreated fields. Can anyone give me some hints, tips or examples? Do I need to write my own annotation for that? Thank you for your help in advance!
Please e-mail me at support@metawidget.org
Hi, While I was searching for ASP.NET version of MataWidget, I found a message from...
np .. Sorted out my issues anyway... Just used SImpleLayout.. worked ok now. Appreciate...
I will try to get a blog post written in a couple of days.
Okay I've put some bare-boned API docs up here: http://metawidget.sourceforge.ne...
My apologies: you're right - documentation is poor in this area. Your help would...
Looks like I do get table headers.. but the table construction isn't quite right...
Lookslike I do get table headers.. but the table construction isn't quite right imho......
Checking out metawidget. Basic examples work ok -- focusing on a JavaScript implementation....
Can you please create a new forum post for each new topic? It helps people who are...
Hi, What would be a good way of adding custom validations on inputs that are added...
Please, Can you send me a example?
Dear Richard, I have just tried your revision and it works great ! Thank you very...
Thanks for your interest in Metawidget, and apologies for the delay in coming back...
Dear Metawidget users, I wonder whether you could change the code block near 163th...
Dear Metawidget users, I wonder whether you could change the code block near 163th...
Dear Metawidget users, I wonder whether you could change the code (near 163th line)...
Dear Metawidget users, As suggested in the links below, and demonstrated by the code...
Dear Metawidget users, As shown below by "POJOWithEnum.java" and "POJOWithEnumMain_BeanBindingDirectly.java",...
Dear Metawidget users, As shown below by "POJOWithEnum.java" and "POJOWithEnumMain_BeanBindingDirectly.java",...
Dear Metawidget users, I am puzzled about how to use Metawidget to auto-generate...
Dear Metawidget users, I am puzzled about how to use Metawidget to auto-generate...
Dear Metawidget users, I am puzzled about how to use Metawidget to auto-generate...
Okay. I understand. Thanks a lot.
The idea here is you would use multiple Metawidgets on a page, either side-by-side...
I see. Thanks a lot for your prompt responses. It really helps a lot. I have couple...
It was defined in the js file for the example. All the code you need is in the example....
Thanks for the example. It really helped. I have a related question. In the example,...
Blogged a complete example for you here: http://blog.kennardconsulting.com/2016/...
Hi, I am still learning metawidgets. I have a situation where I need to disable or...
Metawidget should certainly be able to help! You will need to experiment a bit. But...
Perhaps, but the problem I face is that I set the attribute based on a custom property...
I think that's purely an Angular concern? See this StackOverflow question: http:...
I append a widget processor that adds an ng-change to a widget per your advice of...
That file relies on metawidget-core.min.js. Make sure you're always loading that...
Happy to help. The best place to ask questions is this forum. My http://blog.kennardconsulting.com...
metawidget-jqueryui.min.js?bust09102015=9102015:15 gives the following error sometimes...
Awesome! works for me! Thanks. But I searched so much on the internet and did not...
You could try overriding the standard HtmlWidgetBuilder. It has a number of method...
Summary table itself. But I want child properties to come out as columns
Summary table only. But I want child properties to come out as columns
Are we still talking about a summary table? Or now we're into a detail screen?
Great! I corrected my code after going through your detailed answer. One new scenario...
Sure! There are a bunch of white papers and case studies at the bottom of this page:...
Do you know of any companies which use Metawidget in production?
Do you know of any companies which use Metawidget in production?
Hi Kennard thanks for patiently answering my question in detail with code :) That...
Hi Kennard thanks for patiently answering my question in detail with code :) That...
Hi Vishal, Thanks for you interest in Metawidget. I have blogged a detailed answer...
Hi Vishal, Thanks for you interest in Metawidget. I have blogged a detailed answer...
I am using metawidget with angularJS. I have a Collection of items which metaiwdget...
I am using metawidget with angularJS. I have a Collection of items which metaiwdget...
I am new to metawidget. Very excited using this with angularJS and producing UIs...
I am new to metawidget. Very excited using this with angularJS and producing UIs...
I am new to metawidget. Very excited using this with angularJS and producing UIs...
I am new to metawidget. I could render my "Viewing single item page" successfully....
I am new to metawidget. I could render my "Viewing signle item page" successfully....
I am new to metawidget. I could reneder my "Viewing signle item page" successfully....
:-) Sure. Thanks!
Metawidget does not take sides :) I would encourage you to compare and contrast the...
Hi Kennard, Thanks a lot for the example. I have a choice of Javascript or AngularJS...
Thanks for your interest in Metawidget! Simple static lookups can be done with an...
Hi, I am very new to metawidget. I am exploring it to come up with a generic UI deisgn...
Wonderful, I'll continue doing testing with your suggestions. Thanks, you rock!
The example I sent can easily be modified to assign different sections to different...
Kennard, Thanks a lot for the comments, I've based on the "1.2 Part 1" examples to...
There are a few different (and conflicting) points I need to make here: You have...
Hi Kennard, At the beginning I put section attributes on some fields but noticed...
Can you send a small example project to support@metawidget.org? At a guess, though:...
Hello guys, I'm testing metawidget by creating a demo but having some issues with...
That is indeed a strange error! It suggests the inspection of your custom object...
I was trying to do my first steps using metawidget by going thorugh the tutorial...
I was trying to do my first steps using metawidget by going thorugh the tutorial...
No worries!