on 08-04-2011 8:33 AM
Hi,
I wanted to know hoe would you integrate an HTML page in MII and refresh it at regular intervals using AJAX.
By learning HTML, Javascript and some CSS. But it will take some time.
The transaction and query runners are key to this so as a first step it makes sense to build your own MII-Javascript library for common tasks:
-calling a transaction or query
-parsing the data and storing it in a easy way to handle inside Javascript
JQuery is a very complete and easy library that will make your life much easier.
Some aspects to get started:
$.ajax
$.Deferred
some patterns:http://shichuan.github.io/javascript-patterns/
Alternatively: contact a webdevelopper.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can call BLS transactions using the Runner service from AJAX in web page. You can call the BLS as :
http://<server>:<port>/XMII/Runner?Transaction=<Trx Path>&ParamNamex=ParamValuex
The response will be in Rowsets/Rowset/Row format XML which you can parse using XMLDOM parser in JavaScript.
Thanks,
Dipankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
If you want to refresh page on a interval, you can use javascript setTimeout function.
With Ajax you can call templates and transactions.
and you can refresh a part of your page.
Find these examples to use ajax in html page.
/people/abesh.bhattacharjee/blog/2007/03/05/ajax-xmii-illuminator-services-a-database-browser
/people/srinivaskumar.mupparshetty/blog/2011/05/25/ajax-enabled-dynamic-editable-data-grid-using-servlet-and-xsl-in-mii
Thanks
Anshul
You can also use the Illuminator-service to get your query template results in XML.
I have just implemented this with www.jquery.com AJAX techniques as a total jquery newbie.
Some code snippets to examplify some newbie way to update fields with jquery ajax which saves one iCommand:
HEAD>
<TITLE>Control Chart Status tool</TITLE>
<script type="text/javascript" src="../Jquery/jquery-1.10.1.min.js"></script>
Now, the relevant part of a function:
$(curStatus).html('loading...');
$(curCR).html('loading...');
$(curNote).html('loading...');
$(newStatusForm).show();
// Get current CC status via AJAX call:
$.ajax({
type: "GET",
url: "/XMII/Illuminator?QueryTemplate=[OURPROJECTP]%2Fq_getCCstatus&Content-Type=text%2Fxml",
dataType: "xml",
cache: false, // use jQuery feature to ensure uncached status value (adds browser cache busting parameter),
data: {
'Param.1': id
},
success: function(xml) { // results ready from lookup of current status details in CCstatus
$(xml).find('Row').each(function()
{
// Show the data
var status = $(this).find('status').text();
var statusName = $(this).find('statusName').text();
var crNum = $(this).find('CRnumber').text();
var note = $(this).find('Note').text();
var init = $(this).find('init').text();
var dateTime = $(this).find('time').text();
$(curStatus).html(status+':'+statusName);
$(curCR).html(crNum);
$(curNote).html(note);
crNumber.value=crNum;
$(curInit).html(init)
$(curDate).html(dateTime)
User | Count |
---|---|
8 | |
7 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.