Focal Point
[Solved] Maintain drilldown caching

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

October 10, 2008, 04:19 PM
Dave Ayers
[Solved] Maintain drilldown caching
I have a update maintain, in a 7.6.4 environment, that is triggered from various rows in a WF report by a drilldown URL. If one clicks on the same link more then once, the data that shows in the maintain is always the same, even if it has been changed previously. This is confusing to the users that insist on doing such things.

I have added a random number, with an & var, to the maintain link, but that hasn't helped, and I realized that the random number will not change for different clicks, since it remains the same throughout the 'life' of the report page.

From what I've seen in FP posts on the cache problem, I need to have the random number applied to the link with Javascript, so that a new value is applied on each click event. BUT, I can't see a way to apply any JS to the WF drilldown link - two different worlds without an obvious bridge.

I've seen reference to setting “EXPIRE_REPORTS=1” in CGIVARS.WFS, but I doubt that that would affect the behavior of maintain.

Any wizards out there who can help me solve this problem ?

Thanks,

This message has been edited. Last edited by: Dave Ayers,


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
October 10, 2008, 05:43 PM
Tony A
Dave,

Change your onclick event process to generate the random number and pass it with the drilldown link.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
October 13, 2008, 03:18 AM
GamP
Dave,
Of course you can drilldown to a javascript, same as that you can drill down to a fex, a maintain or a url.
So, what you do is find out what parameters the maintain call needs, build the request url in your javascript, add a random number in your javascript and launch the url that you built, using the window.open method.
I'm sure I have an example somewhere of exactly how to do this, just can't find it right now.

Oh, just remembered, did this for a customer and left it there - so I don't have it at hand right now.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
October 14, 2008, 11:56 AM
Maintain Wizard
Something like this, using a timestamp added to the URL line should always ensure a new report.

var today = new Date();
var cmd = "/ibi_apps/WFServlet?IBIS_connect=on + "&" + "IBIC_server=edaserve" + "&" + "IBIAPP_app=ibisamp";
cmd = cmd + "&" + "IBIF_ex=carinst;" + "&" + "CurrentStamp=" + today.getTime();
window.open(cmd);

Mark
October 16, 2008, 10:49 PM
Dave Ayers
OK, so I figured out that I had to change the straight Focus report to a -HTMLFORM so I could include the Javascript code, and change the drilldown from a URL= to to a JAVASCRIPT=. That was what I was asking about in the original post.

Now that I put all the pieces together, and tested, something is wrong, and I can't see it...

The report runs fine, and delivers a page with the proper content and links. But when I click on a link, to start up the update maintain, it results in a javascript error: Error: Object Expected

All that appears in the JS debugger is: javascript:mntlink('32805','CWTFAPS');

The link code in the report:
TYPE=DATA, COLUMN=N4, TARGET='_blank', JAVASCRIPT=mntlink(N1 N4),$

The function in the -HTMLFORM:
<script LANGUAGE="JavaScript">
function mntlink(N1,N4) {
var today = new Date();
var murl = "/ibi_apps/WFServlet?IBIF_cmd='MNTCON RUN ibfmdlfc'" + "&" + "IBIAPP_app=ibiforecast%20baseapp";
murl = murl + "&" + "IBIS_passthru='on'" + "&" + "IBIS_connect=on" + "&" + "IBIC_server=edaserve";
murl = murl + "&" + "CustSelected=" + N1 + "&" + "MdlSelected=" + N4 + "&" + "CurrentStamp=" + today.getTime();
window.open(murl);
}


What am I missing here ???


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
October 17, 2008, 06:59 AM
Lucas
Dave,
Querystring's (everything behind the question mark) usually do not have quotes. For example the IBIF_cmd='MNTCON RUN ibfmdlfc'" portion should be IBIF_cmd=MNTCON RUN ibfmdlfc" and so forth however that should not make the function not work. I would really need to see how the function is called in the html to be able to really get to the source of the issue. The funtion itself works without error when called properly.....

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


7.6.6 Mainframe
7.6.4 Web Focus
Windows

October 17, 2008, 08:34 AM
Dave Ayers
Lucas,

Here is one of the links from the WF generated HTML:

<TD class='x28'>
<A HREF="java_script:mntlink['328305','CWTFAPS');" TARGET="_blank">CWTFAPS<A>
</TD>


Thanks,


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
October 17, 2008, 08:38 AM
Lucas
quote:
java_script


That call to the function should be......

javascript:mntlink('328305','CWTFAPS')
remove the underline and the left bracket next to the mntlink should be a "(".

But this all may be the message board messing your post up.....

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


7.6.6 Mainframe
7.6.4 Web Focus
Windows

October 17, 2008, 08:46 AM
Lucas
Also make sure that you are not including/linking a script file that also has a function called "mntlink" that would mess you up to.


7.6.6 Mainframe
7.6.4 Web Focus
Windows

October 17, 2008, 09:04 AM
Dave Ayers
Here is the link code again. I pasted it into the reply window and then edited it to add the code tags. Somehow the underscore was added to the 'javascript string and the '(' changed to a '{'... weird

Let's see if it show up correctly this time.

 <TD class='x28'>
<A HREF="javascript:mntlink('328305','CWTFAPS');" TARGET="_blank">CWTFAPS</A>
</TD>
 



Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
October 17, 2008, 09:25 AM
Lucas
Ok remove the TARGET="_blank" part. That is a problem. window.open will always open a new window and thus it has no impact, and I believe it will cause your querystring to not get passed on. Atleast that was the problem when I tested your code.


7.6.6 Mainframe
7.6.4 Web Focus
Windows

October 17, 2008, 12:38 PM
Dave Ayers
Lucas,

Yeah ! it is working now. You were right about the TARGET. I commented it out and the link worked.

I also had to remove the single quotes. A bit odd, since I had found a number of link examples by searching here in FP, and they were all different, the quotes came from one of them !?!?.

Unfortunately my 7.6.4 documentation failed to provide an example, or even syntax, for a maintain execute link Frowner

It was a long slough, but my report driven maintain now closes properly, and doesn't get caught in the cache, so it can be reentered.

Hooray, and thanks to all who helped !


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server