cancel
Showing results for 
Search instead for 
Did you mean: 

Integrating Ajax in MII

Former Member
0 Kudos

Hi,

I wanted to know hoe would you integrate an HTML page in MII and refresh it at regular intervals using AJAX.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

former_member4529
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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)