Re: addressing xul elements in java code
Eitan Suez <[email protected]>
| Newsgroups | gmane.comp.java.luxor-xul.user |
|---|---|
| Message-ID | <[email protected]> |
hi, one observation i've made, that has nothing to do with luxor, is that xul does not address the issue of data binding between a ui and a model (say in xml). i think xul is really cool but agree with you that a solution that does not include a data binding framework between a ui and one's model is somewhat incomplete. well, it just leaves more work for the developer (especially in your case where you have lots of forms). anyhow, i don't think this speaks badly of xul. i find xul terrific, but it's not meant to be a framework or solution for building web apps. it only defines the syntax for one important aspect of a system - how to describe its ui. a framework that does address data binding without even having to specify a mapping (relies on conventions) is naked objects. i've seen other frameworks (in webobjects for example) where a binding file is defined that binds model to gui, which was terrific. why it's not pervasive is a good question. / eitan On Friday, Feb 28, 2003, at 10:57 US/Central, Tzanko Stefanov wrote: > Hi folks, > > I have few questions regarding Luxor and XUL > I am working on a java client that will communicate with a server. For > now the server will send the response as XML - later I might change to > way client and server communicate. But this is not important. > So I have the response from the server which should fill the values of > the form components. The user basicaly intaracts with different forms, > submits the request to the server based on his selection from these > forms and then he gets either the same form but with different content > of the textinputs and drop-down lists or a new form. > Because I have quite many forms and the content of the server response > could change I thought that using smth like XML to discribe the forms > is a good idea. I stumbled upon Luxor and looked at the doc on the web > site and the calculator sample api. Here are few things that I have > problem with: > 1) When you display the value in display input text you address the > display component in yor java code. > JTextField jdisplay = (JTextField) _display.getJComponent(); > jdisplay.setHorizontalAlignment(JTextField.RIGHT); > setValue(String.valueOf((double) 0)); > The hole idea of having things in an XML for me is that the programing > implemenation is not aware of what are the form components. It is > rather the xml element definition and the engine to be responsible for > invoking the objects that will produce the values for the graphical > component. > 2) The same thing with the button. You address all the buttons in > CalsForm. > new EnterDigit(logic, "0"); > If tomorrow I remove a button from the XML or add new one, I have to > recompile my CalcForm class. The advantage of having things defined in > meta data is that your immplemetation is not aware of what is in that > XML as long as it has means to handle the components. > > I am not criticizing here. XUL and Luxor spare you from working > directly with Swing. I am just exposing my point of view looking for > solution to my problem. If you could recommend me what to do I will > appreciate it a lot. Maybe Luxor and XUL are not good for me? 10x > guys. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf