Good Morning ( if it applies :) )
I'm trying to create a system that would send specific server side messages to the browser client (using modals)PHP/MYSQL
, i have tried several examples here in the forum but it appears they are not compatible with the current Backbase version.
What i need is a div or something that would load the messages from the server(xi:include) and refresh at every 60 secs for example.
It would then place the object loaded "modal" in front of all the objects already present.
Thanks for your time
António

Hi medilogics_sa,
7 August, 2008 - 20:58 — RusHi António,
First of all download last available version of Backbase engine. Secondly using xi:include not good idea if you are really going to make all that you describe. Use this code to implement your functionality:
<div id="receiverElement"></div>
...
<script type="text/backbase+xml">
// Setting up the interval 60000ms (60 sec)
setInterval(function() {
bb.command.load('server_script.php', 'GET', null, null, null, null, function(oRequest, oData) {
var oReceiver = document.getElementById('receiverElement');
oReceiver.innerHTML = bb.xml.serialize(oData);
});
}, 60000);
</script>
Let me know if you need any additional help.
Sorry but..
8 August, 2008 - 15:53 — medilogics_saHi Rus
I'm unable to run your example is simple prints out the code into the screen
<html style="height: 100%;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<link rel="Fav ICON" href="favicon.ico">
<script type="text/javascript" src="ajax_2/engine/boot.js"></script>
<link rel="stylesheet" type="text/css" href="css/layout.css" />
</head>
<body style="height: 100%;">
<script xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:b="http://www.backbase.com/2006/btl"
xmlns:e="http://www.backbase.com/2006/xel"
xmlns:c="http://www.backbase.com/2006/command"
xmlns:bf="http://www.backbase.com/2007/forms" type="application/backbase+xml">
<xi:include href="ajax_2/bindings/config.xml" />
<div id="receiverElement"></div>
// Setting up the interval 60000ms (60 sec)
setInterval(function() {
bb.command.load('teste.php', 'GET', null, null, null, null, function(oRequest, oData) {
var oReceiver = document.getElementById('receiverElement');
oReceiver.innerHTML = bb.xml.serialize(oData);
});
}, 60000);
</script>
</body>
</html>
if i run like this
// Setting up the interval 60000ms (60 sec)
setInterval(function() {
bb.command.load('teste.php', 'GET', null, null, null, null, function(oRequest, oData) {
var oReceiver = document.getElementById('receiverElement');
oReceiver.innerHTML = bb.xml.serialize(oData);
});
},6000);
</script>
the error output
GENERIC: XML Parsing Error: mismatched tag. Expected: . Location: Line Number 16, Column 3: Text:
also FYI the content of teste.php
xmlns:e=\"http://www.backbase.com/2006/xel\"
xmlns:c=\"http://www.backbase.com/2006/command\" type=\"application/backbase+xml\">
<e:handler event=\"construct\" type=\"application/xml\">
<c:hide with=\"id('load_msg')\"/>
<c:alert select=\"'Teesting !'\" />
</e:handler>
</div>
I hope this helps sorry for all the trouble !