users@jaxb.java.net

GUI Binding

From: Randall Fidler <randall.fidler_at_testadvantage.com>
Date: Tue, 11 Feb 2003 08:43:20 -0700

Hello,

I'm trying to dynamically bind JAXB object to GUI fields so basically when I
read an XML document it generates the GUI panels, fields and lists
automatically. So far the biggest problem that I've had is running into the
scope restrictions of data fields in JAXB generated classes. While I
realize that I could edit the generated classes I would rather not have to
edit them each time I change the scheme so that option is out. To get
around the scope issue I created a class that determines the get and set
methods, the data type for a data instance, what kind of GUI component will
represent the data and registers an actionlistener with the GUI component to
update the XML object whenever a field updates. This object essentially
links a JAXB object to a GUI component.

It seems to work as it loads files fine, I can edit no problem and it
outputs my changes fine but I'm having trouble with lists. I have my schema
set to use Vectors to represent lists and it loads them fine but the
problem is that unlike non-list data, I have to dig an extra layer to get
the Vector out, which means more processing and checks, etc.

With that said, my problem is now I'm starting to wonder if there's an
easier way to do this. Does the way I've attempted to do this make sense to
anybody else or am I in the middle of nowhere?

I appreciate any feedback.

Thanks!

Randall