mericson
10-17-2004, 12:21 PM
I realized that databinding could be useful for putting UI in a configuration XML, and i18n. Unfortunately this idea was short-lived when I realized that a component can have only one datapath so I can't effectively bind to two datapaths at the same time.
There seems to be a couple of work arounds within Laszlo, does these seem right?
1) populate some variables from the XML config file and use those values for the UI.
2) Store a datapath instance with config information and use xpathQuery to access the UI info.
Then I realized another approach which could be a very cool enhancement to Laszlo. Add datapath support to classes!
This way the class datapath is independent of the
instance datapath. Many of the UI appearance details and i18n could be associated with the datapath on the class. All the default attributes in the classes can be set to values from the config XML.
Now, this does introduce some additional challenges and opportunities... what does it mean to a class if the data changes? Does the class definition change? What is the effect on exisiting instances?
There seems to be a couple of work arounds within Laszlo, does these seem right?
1) populate some variables from the XML config file and use those values for the UI.
2) Store a datapath instance with config information and use xpathQuery to access the UI info.
Then I realized another approach which could be a very cool enhancement to Laszlo. Add datapath support to classes!
This way the class datapath is independent of the
instance datapath. Many of the UI appearance details and i18n could be associated with the datapath on the class. All the default attributes in the classes can be set to values from the config XML.
Now, this does introduce some additional challenges and opportunities... what does it mean to a class if the data changes? Does the class definition change? What is the effect on exisiting instances?