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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Render HTML on return from Ajax

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Render HTML on return from Ajax
 Login/Join
 
Member
posted
This looks easy, but it took me days to find, namely how to force Ajax data (HTML) to be rendered by the browser.


I used Ajax to fill a DIV on a 'click', which then ran a simple print xxxx as '' ON TABLE PCHOLD.
Where xxxx is formatted html that contains an entire select list one row for each "option"..., first and last rows had the leading "html"... and trailing "/html" making it a complete 'thing'. When I then did the ajax:

var _procedure = "mainparm"; (the fex to execute)
(elem being a .fex name passed from the click)


$.ajax({
type : "GET",
async :false,
url : _url + _procedure + "&"+"rnd=" + Math.random(),
data :{ "PARMRPT": elem , "PARMNO": 'SETPARM1' },
dataType: "text",
success : function(_data1) {
$(#parms).append(_data1);
}
})

What I got in the DIV id="parms" was the actual HTML text. The browser had not 'rendered' it.

Solution is: $("#parms").append($(_data1).text());

Why this works (and the other does not) is a good question.

I used async because I am appending more 'select' types via ajax to the DIV, and they were not staying in sequence.

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8
Windows, All Outputs
 
Posts: 12 | Registered: December 01, 2015Report This Post
Expert
posted Hide Post
Neal, welcome to the forum.

As you will notice, the HTML code you posted was rendered (or there was an attempt to render) as HTML. To avoid this, use the </> button to generate
[code]
[/code]
tags and put your code between them. You should be able to correct your first post by clicking on the edit button at the bottom right. Let's see your handiwork!


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
Member
posted Hide Post
Thanks Francis. Old coder, hmm. I may have you beat. Started with Focus at United Airlines, Focus in Beta that is. What year was that? I forget.

Neal


WebFOCUS 8
Windows, All Outputs
 
Posts: 12 | Registered: December 01, 2015Report This Post
Platinum Member
posted Hide Post
Neal,
Are you trying to populate a select box with data from a fex? Try this:

 
function doUpdateSelect() {
		$.ajax({
		type: "POST",
		  dataType: "text" ,
		  url: "/ibi_apps/WFServlet.ibfs?IBIF_webapp=/ibi_apps&|&|IBIMR_drill=IBFS,RUNFEX,IBIF_ex,true"  ,
		  data: {
			IBIF_ex: "full repository path of the fex"
			 }
	})
  .done(function( msg ) {
	$('#some select box').html(msg) ;
  	});
}

 


Or are you trying to render a report in an iframe using ajax?


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
 
Posts: 141 | Location: Mclean, VA | Registered: December 04, 2012Report This Post
Master
posted Hide Post
@Tim P. - Thanks for the nice example of loading a control, from a fex call, via Ajax.

I've done this type of thing too, and it works great.

You mention rendering a report, in an iframe, via Ajax.

This I hadn't been able to get to work; I seemed to have issues getting a hold of the src attribute of the iframe.

I use the location.replace(url) method, instead of Ajax, to load the report.

If by chance you have a way to load an iframe via Ajax, I'd love to see a code snippet.

(I realize you might mentioned report->iframe via Ajax, for clarification purposes as well.)

This message has been edited. Last edited by: David Briars,




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
 
Posts: 822 | Registered: April 23, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Render HTML on return from Ajax

Copyright © 1996-2020 Information Builders