ianpullinger
07-18-2005, 01:08 AM
I am looking for the best way of setting the text attribute of components at runtime. I am building an application that will allow the user to select a language (both at startup and runtime), which will dynamically load a dataset over http that includes the XML file containing the necessary GUI labels. i.e. for an 'en' language ...
<?xml version="1.0" encoding="UTF-8"?>
<LabelData>
<lang>EN</lang>
<tab1>News</tab1>
<tab2>Sport</tab2>
</LabelData>
I am having trouble easily setting the text attribute of components. Ideally, the following code fragments would work.
<button text="dsLabels:/LabelData/tab1/text()" />
OR ...
<button>
<text datapath="dsLabels:/LabelData/tab1/text()" />
</button>
However, both of these example just display the text in the parent view over the top of the button, and NOT actually in the button! As there could potentially be hundreds of GUI components that will require updating, I am looking for an efficient method and one that will not bloat the application with unneccessary code.
Any help would be appreciated,
Ian
<?xml version="1.0" encoding="UTF-8"?>
<LabelData>
<lang>EN</lang>
<tab1>News</tab1>
<tab2>Sport</tab2>
</LabelData>
I am having trouble easily setting the text attribute of components. Ideally, the following code fragments would work.
<button text="dsLabels:/LabelData/tab1/text()" />
OR ...
<button>
<text datapath="dsLabels:/LabelData/tab1/text()" />
</button>
However, both of these example just display the text in the parent view over the top of the button, and NOT actually in the button! As there could potentially be hundreds of GUI components that will require updating, I am looking for an efficient method and one that will not bloat the application with unneccessary code.
Any help would be appreciated,
Ian