Focal Point
[CLOSED] Trigger a control reload when using RIA theme

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3747017826

February 12, 2013, 05:30 PM
Moogle
[CLOSED] Trigger a control reload when using RIA theme
Hi Team,

I have text box that is dynamically loaded from a stored procedure. The stored procedure was created as a master file, so I was able to load the text box dynamically using the HTML composer GUI. The stored procedure returns a number that increments each time it is run. Next, I have a button where I've defined an onclick event that does this:

UpdateData();

This reloads the page, and that is enough to increment the counter in my text box. I end up with a button next to a text box, and every time the button is pressed, the text box increments. Now that I've built this POC, I want to integrate it into a production launch page.

My launch page has a RIA theme applied, which I understand invokes the Bindows framework. I really love the look of the Ocean Rounded theme, and have used it on all my launch pages to date. What I didn't anticipate is that I've inadvertently lost the ability to use the UpdateData() function, and I have traced it back to turning on a RIA theme. Hmm. My theory is that Bindows has replaced the javascript library files that contain UpdateData().

I grabbed the Bindows manual, and poked through it, and learned enough to know that I have a lot to learn.

In the meantime, while I continue to research, perhaps someone already has an answer for me. I'm looking for some javascript code that will reload / refresh a specific control. It will have to be RIA theme compatible, which I'm pretty sure means it needs to use a function within Bindows.

Cheers,

Joey

This message has been edited. Last edited by: Kerry,


-WebFOCUS 8.2.01 on Windows
February 12, 2013, 05:39 PM
Waz
How was your UpdateData function being called ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 12, 2013, 06:01 PM
Moogle
Hi Waz,

I drag and dropped a button, clicked the events tab, drilled into onclick, and typed UpdateDate(); in the function that was created.

Thank you for your interest in my issue.

Cheers,

Joey
February 12, 2013, 06:20 PM
Waz
I'm intrieged as to why the onclick event had been changed or has your JS lib been removed ?

Is there a Js error ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 12, 2013, 06:43 PM
Moogle
Hi Waz,

There's no js error, it simply does not do anything when UpdateData(); is called post Bindows enablement.

I did a side by side code compare of before RIA and after. Here's the changes:

Before RIA:
function window_onload() {
 
UpdateData();
 
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
}
//End function window_onload  


After RIA:
  
//Begin function window_onload
function window_onload() {
 
UpdateData();
 
removeStyleFromMainCSS();
application.addEventListener('resourcesready', onBindowsReady);
application.start('/ibi_apps/bindows/', '/ibi_html/javaassist/ibi/html/js/Inline.xml');
 
 
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
}
//End function window_onload


So, the HTML composer invokes UpdateData(); before turning on the Bindows framework.

Next, there's some changes right before the BODY tag.

Before RIA:
  
 
<SCRIPT for=window type=text/javascript eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>



After RIA:
 
<SCRIPT for=window type=text/javascript eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
 
<SCRIPT id=IBI_BIAPP_JS type=text/javascript src="/ibi_apps/bindows/js/application.js"></SCRIPT>
<LINK id=IBI_BIMAIN_CSS rel=stylesheet type=text/css href="/ibi_apps/bindows/css/bimain.css">
<SCRIPT id=IBI_BindowsReady type=text/javascript>
function onBindowsReady() {
firstTimeBindowsSettings();
document.body.setAttribute('id', 'bodyElement');
var ic = new IbInlineComponent('bodyElement');
application.getWindow().add( ic );
var dataIsland = document.getElementById('bindows_dataIsland');
if(!dataIsland) return;
var ctrls = null;
if(dataIsland.XMLDocument)
  ctrls = dataIsland.XMLDocument.documentElement.selectSingleNode('//Ctrls');
else
{
  var xmlDom = new DOMParser().parseFromString(dataIsland.innerHTML, 'text/xml');
  var nodes = xmlDom.evaluate('//Ctrls', xmlDom, null, 0, null);
  if(nodes)
    ctrls = nodes.iterateNext();
}
application._xmlResourceParser = new BiXmlResourceParser;
application._xmlResourceParser.setRootNode( ctrls );
application._xmlResourceParser.processChildNodes( ic, ctrls );
finishFirstTime();
};
</SCRIPT>
  


I see that the Bindows functions are very different than the old style js libraries.

The rest of the code seems to be the same, after a cursory glance.

I am sure, absolutely sure, that there's some bindows function that will selectively reload my text box, if only I knew what it was.

Cheers,

Joey

This message has been edited. Last edited by: Moogle,
February 12, 2013, 06:55 PM
Waz
I don't have experience with bindows.

But I would have thought that your call would still work, as it is first in the onload call.

Unless one of the bindows setups kill it off.

Perhaps there is a bindows forum that could give you pointers on how to integrate your js call.

This message has been edited. Last edited by: Waz,


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 14, 2013, 04:44 PM
Lisa Scipio
Hi Moogle,
Calling UpdateData() is not a recommended practice as this is not exposed in our API and as a result, future changes by our Developers may cause your work on the non-RIA page to stop working.
Please open a case with CSS and we will look into providing a solution for your issue.

Best Regards,


Lisa Scipio
Product Manager
Information Builders, Inc.
February 19, 2013, 04:37 PM
Moogle
Thank you, Lisa. I'll open a case.

Cheers,

Joey
February 20, 2013, 09:13 AM
Geoff Fish
You might try deleting the item entirely and recreating it. Sometimes i find that works best (and quicker) with the RIA themes

Geoffrey


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML