Skip to main content

Bind to javabeans from XML?

6 replies [Last post]
jtr
Offline
Joined: 2003-06-10

I've looked though the XML form examples, and now I'm trying to bind to a javabean so I can pull values from it. It seems that I want to do something like this:
...
but after trolling around in the xsds and element handlers, I can't figure out where I'm supposed to register this bean so it becomes visible as a source, or what sort of protocol to use.

It seems the examples either use values from a file or from a row in a tabularFormData (which of course uses a file as a source).

Is it in fact possible to bind to anything other than tabular data in a file now?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rbair
Offline
Joined: 2003-07-08

> I originally was planning to use the XML as a UI
> description language (much like JSF tags) for some
> simple dialogs. But I'm starting to get a clue that
> the XML side isn't quite as flushed out as the java
> side.

Ya, my general feeling has been that if we had the xml layer done but not the swingx layer, then it doesn't do anybody any good. So I've been focusing exclusively on the swingx layer to try to stablize it as soon as possible.

Richard

Anonymous

I can't help you with XML bean mapping, but IFAIK you can't map beans with existing model, since you have to use reflection to read bean properties.
I am using custom BeanModel to display POJO bean values (Hibernate pojo).
If it helps, I can share my model.

jtr
Offline
Joined: 2003-06-10

Thanks, but I'll just muddle along. :)

I originally was planning to use the XML as a UI description language (much like JSF tags) for some simple dialogs. But I'm starting to get a clue that the XML side isn't quite as flushed out as the java side. That leaves me with either:

- describing the UI in XML but realizing, searching out the created form, and binding it in my own java code, or
- just doing everything in java

The Draft JDNC Roadmap has "configuration of client UI with support for binding UI components to application data models" under Declarative Definition (XML). That's probably what missing.

Anonymous

I been facing the same problem some time ago.
But AFAIK UI in XML is not mature enough to be used with business applications, so I decide to go to "just doing everything in java".
I am using UI designer from IntelliJ IDEA. But data binding is by hand.

jtr
Offline
Joined: 2003-06-10

I've poked around in the xsds some more and found that jdnc-data-module-1.xsd declares what look like the following element heirarchy:



which might get me further but I'm no expert at reading these xsds so I'm muddling along. What I'm really looking for is something like this (modified from jdnc_markup/.../test3.xml):























with the myjavabean a bean which I instantiated. I'm using EL syntax, only because that's what I'm used to nowadays.

rbair
Offline
Joined: 2003-07-08

Hey,

I hate to leave you hanging. Honestly, I think Ramesh is the most qualified to answer your XML related questions. I haven't even looked at the markup stuff yet because I've been so occupied with the swingx layer. Sorry I couldn't be of more help :(

Richard