Ex-Forms and Ant Propeties
  Posted November 02, 2002    PermaLink    Comments (0)  

After getting a better feel of XForms I have decided to roll my own form pages rather than using an existing XML format. I initially didn't want to create yet another xml to widget mapping, but nothing quite matches what I need. I even took a look at jelly-swing but there is way to much binding to the swing architecture when you consider that a console mode and non-swing GUI are in the initial design premise. So I am going to roll my own. Case and point, how does one make a checkbox show up with XForms? You do either (a) <input ... /> that is bound to an xsd:boolean value in the model, (b) <select appearance='full'> with one <item/> child. Both are counter-intuiotive to me and I would rather have one <checkbox /> element. I will use some ideas from XForms: like the nested label and help elements though.

That was Problem #1. Problem #3 was roller eating my post because of session expiration. But problem #2 is how to handle ant properites. Anyone who has done much with a ant build.xml knows that the variables ant users are set conter to the typical programming: the first setting of the variable sticks and later sets are totally ignored. This actually makes sense when put in context of a user-overridden values on the command line. But when taken in context of a "back" button in a wizard a first-set-win policy demolishes the concept of going back and changing values. There are two tasks, ant and antcall, that break that rule, and wizard will have to be another one. Overcoming the rules isn't that much of a problem with the ant APIs.

The true problem comes in unsetting the properties, there is no way via the APIs. You can get a Propeties object but that is just a copy, not the local value. So you cannot un-set a value. But the if and unless atributes go by whether the property is set or not set. I considered making some of my elements sensitive to true/false values, but the target would not be sensitive. This would make using properties to drive the dependent component installs impossible, which was the whole point to me of using ant to do the installs: to declaritively determiine the needed dependencies. But it's not insurmountable. The magic of introspection allows me to forcably introspect the values and change them. For anyone who thinks that RTTI is wrong, add me to your list of violaters.

Trackback URL
  TrackBack URL for this entry:
Post Comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Remember me?

Email Address: