Hi!
How can I preload HTTP dataset's data before any operations on LZX page?
request="true" doesn't help :(
I very need some help!
I am making app with ability to automatically change language for entire app.
The problem I am facing now is that I can't request locale name from HTTP URL
resource before laszlo will initialize everything on page. Here is what I
mean:
I have
<dataset name="userSettingsDataset" request="true" type="http"
src="/common/userSettings"/>
and
<datapointer name="localeDatapointer"
datapath="userSettingsDataset:/userSettings[1]/[EMAIL
PROTECTED]'language']"></datapointer>
Then I have a function which I use for getting strings from xml resources:
// dataset is xml file with message strings, pathEnd is idPath for
string
function getMessageText(dataset, pathEnd) {
var localeName = localeDatapointer.getNodeAttribute("value");
var pathString = dataset.getAttribute("name") + ":/" + localeName +
pathEnd;
var tempDp = dataset.getPointer();
tempDp.setXPath(pathString);
return tempDp.getNodeText(); // here it sends correct message
text
}
Example of xml file with messages strings:
<en_US>
<startup_title>Welcome!</startup_title>
</en_US>
Everything here works fine. But the problem is when I want to set text to
<text/> element on this page, I do it this way:
<text resize="true" text="${getMessageText(moduleMessages,
'/startup_title[1]')}"/>
The PROBLEM is that userSettingsDataset is not initialized yet, and don't
have locale name, and use "underfined" instead.
Thank you in advance!
--
С уважением,
Alexey mailto:[EMAIL PROTECTED]
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user