Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Disabling links
 Login/Join
 
Platinum Member
posted
I am trying to either refresh a page or turn off a link automatically once it is clicked.

I know Web Focus won't return anything to the browser until the request is completed, but can I refresh that page or gray out that link that was pushed?

This is not in HTML.

Web Focus:
DEV: v5.3
UAT: v5.3
PROD: v5.3


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
 
Posts: 178 | Registered: May 11, 2005Report This Post
Expert
posted Hide Post
If it's not in HTML, what is it in? Can it be controlled by JavaScript? If so, you could use JS to disable the link.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
It's FOCUS code... basically a drilldown menu item in the stylesheet.

Can I use JS to disable a link created by:

TYPE=DATA,COLUMN=VALIDATE, FOCEXEC=validate_file(parameters etc...), $

?

Thanks for the response.


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
 
Posts: 178 | Registered: May 11, 2005Report This Post
Expert
posted Hide Post
you can change the link's color once its been clicked using style commands in the -HTMLFORM surrounding the output
a:hover and a:visited and a:active...
or you can have your drilldown refer to a fex that launches a refresh page...a temporary page launched with 0 milliseconds refresh time .. and the refresh page it goes to is the actual drilldown fex your user would be wanting.
This would prevent your end user from clicking again and again on the same link.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
slfmr,

Not sure if this is exactly possible with your scenario, but you could set the tags HREF property to javascript:void(); when clicked. Of course, to do this the tag would have to have a name attribute so that you can identify it. You can't do this directly using WF code so you'd have to resort to using an HTMTABLE output and including some javascript in the body.

You need the javascript in the body and not the head as the main HTMLTABLE will not have been interpreted when the javascript is run, as in my example below the javascript is not contained in a function.

Anyway, this works (in 7.1.3) by changing the links href attribute -

-* File disable_link.fex
-DEFAULT &Country = 'FOC_NONE'
-SET &JS_Var = '"'|&Country||'"';
TABLE FILE CAR
SUM RCOST
    DCOST
 BY COUNTRY
 BY CAR
 BY MODEL
ON TABLE HOLD AS MYREP FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
  TYPE=DATA, COLUMN=COUNTRY, FOCEXEC=disable_link.fex(Country=COUNTRY), name=COUNTRY, $
ENDSTYLE
END

-HTMLFORM BEGIN
<html>
<head>
<title>Disable Link</title>
</head>
<body>
!IBI.FIL.MYREP;
<script language=javascript>

  var JS_Var = !IBI.AMP.JS_Var; ;
  Atags = document.getElementsByTagName("a");
//  alert(Atags.length+" links");
  for (x = 0; x < Atags.length; x++) {
    Aname=Atags[x].innerHTML;
    Atags[x].name = Aname;
    if (JS_Var!="FOC_NONE" && JS_Var==Aname) {
//      alert("You clicked "+JS_Var);
      Atags[x].href="javascript:void()";
    }
  }

</script>
</body>
</html>
-HTMLFORM END


T

edited to remove the &variable in the javascript and replace it with the !IBI.AMP.xxx alternative

This message has been edited. Last edited by: Tony A,



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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Hi Tony, I tried your suggestion and the link is not voiding out. When I click on it and it starts running, if I click on it again, I can see on my server that another agent starts running. Perhaps I am not doing this right.

I will keep working with it.

Susannah,

Can you elaborate a little more on your idea. More specifically the launch page that is to go to a refresh page. I tried to have it go to a page that gives a message and then executes the intended file, but it will not do anything until the full action is complete, so the button is still visible for users to click.

Thank you both for responding!


Dev, SIT, UAT, Production:7.6.6
Dev Sandbox:7.6.11

Dev Studio - 7.6.6
 
Posts: 178 | Registered: May 11, 2005Report This Post
Expert
posted Hide Post
slfmr,

It is likely that your page is refreshing from cache only. Try pressing ctrl and F5 to force a refresh.

Once you have clicked a link, hovering over it should show on the status bar that the HREF attached to that link has been changed to "javascript:void()".

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
.... for an addition to the HTMLFORM to force refresh on load, try adding a random number value to an input control like this -
-HTMLFORM BEGIN
<html>
<head>
<title>Disable Link</title>
</head>
<body>
!IBI.FIL.MYREP;
<input id="IBIMR_random" type="hidden">
#######################################
<script language=javascript>

  var JS_Var = !IBI.AMP.JS_Var;;
  Atags = document.getElementsByTagName("a");
//  alert(Atags.length+" links");
  for (x = 0; x < Atags.length; x++) {
    Aname=Atags[x].innerHTML;
    Atags[x].name = Aname;
    if (JS_Var!="FOC_NONE" && JS_Var==Aname) {
//      alert("You clicked "+JS_Var);
      Atags[x].href="javascript:void(0)";
    }
  }
  document.getElementById("IBIMR_Random").value = Math.floor(Math.random()*10000);
  ################################################################################
</script>
</body>
</html>
-HTMLFORM END


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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
sure, here's a sample:

-HTMLFORM BEGIN
<html>
<head>
<META HTTP-EQUIV="Refresh" 
CONTENT="0 ;
URL=http://grwf01/cgi-bin/ibi_cgi/webapi.dll?IBIF_ex=fexname&|PARM1=VALUE1&|PARM2=VALUE2">
</head> 
 
<body    TOPMARGIN="0">
<table width="100%"  
style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0" >
<tr height="300">
   <td valign="middle" align="center">
 
<i>
<font >I'm thinking .....</font></i> 
</div>
<br />
  
</TD></TR>
</table>
</body>
</html>
-HTMLFORM END


see the CONTENT=0 bit? that makes the lag time between this page and the redirected page zero.
so this 'im thinking' page will stay alive until the real fex finishes...
i got this technique from ruben rivera at ibi spain, right here on 'the Point'...




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders