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] Performance problems using ajax

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Performance problems using ajax
 Login/Join
 
Guru
posted
We're initially loading 14 listboxes when we open an app. It works fine, except that it takes forever. It feels like all the 14 xmlHttp requests slows it down. Is it possible to run just one request and let WF take care of different entry points in the fex etc.?

Tia
Håkan

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


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
Virtuoso
posted Hide Post
I don't know where the doc is for this, but you can create a fex that contains the output for all of the drop/list boxes. I've only ever done this for chained values, but it reduced the time to load significantly.

If someone else here cannot provide a doc link, then call CSS in NY.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Platinum Member
posted Hide Post
Try using insynchronized ajax call instead of synchronized. In that way the server can process multiple ajax calls in the same time.


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
 
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005Report This Post
Expert
posted Hide Post
Stockholm,
yes you can produce one big array with all of your dropdowns, but its big, and loads all into the users browser.
TonyA and I were going to do a prez at Summit about this...but the powers that be nixed us !
Here's an example; you can try it.
you write 1 fex, and use the same fex for each of your dropdowns,
TABLE FILE MYDIMENSIONS
SUM       BUSINESS
          CORPORATION
	 DIVISION
	 DEPARTMENT
	 PROGRAM
BY BU_ID
BY CORP_ID
BY DIV_ID
BY DEPT_ID
BY PROG_ID
ON TABLE PCHOLD FORMAT XML
END

where the BY Fields are the parameter values and the Display fields are the pretty names.
Imagine a giant Javascript array.
Let us know how you make out.
-Happy Holiday
-s

ps: leave cacheruntimedata=1 for all the parms in your launch page.

pps: the benefit of this big array is that its omni-directional.

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




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
Guru
posted Hide Post
susannah,
I like your solution.

Tia,

Here is another option:

Are you doing the AJAX calls yourself? Are you chaining the dropdowns? Do you use 'ALL' as one of the select items?

You can do the AJAX calls yourself and it's MUCH faster. If you chain the lists then you have to do the chaining yourself which is a challenge.

You can mix different ways to retreive the data using WF for the smaller lists with or without chaining and direct AJAX for the larger lists.

If you use 'ALL' and the lists are chained then you can show the 'ALL' option when the page first displays without populating the list and then retreive each individual list if/when the user clicks on it's dropdown arrow.

Search in this forum for AJAX. There are a lot of good examples.

Good luck.



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
 
Posts: 274 | Location: Boston/New England | Registered: February 12, 2006Report This Post
Expert
posted Hide Post
If you are writing your own, you can extract multiple lists in one call and return them, then let the js pull out each list from the XML.

The secret is to create an XML document that has multiple parts.

All I did for prep is to append all XML documents, remove the xml wrappers and fxf tags, change the target property (for ident purposes), and add a new xml wrapper and FXF tag.

The script then reads the document, checks the target, which corresponds to the control, and loads the info.


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Guru
posted Hide Post
Yes, I'm doing the AJAX calls myself, since it's much faster, but not fast enough.

Waz, are you willing to share the code for that?

Tia
Håkan


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
Expert
posted Hide Post
Håkan

Here is the simplified extract portion of the code.

FILEDEF COUNTRY DISK _p_list.xml (APPEND

-RUN

TABLE FILE CAR
PRINT COUNTRY     AS 'CODE'
      COUNTRY     AS 'DESC'
ON TABLE HOLD AS COUNTRY FORMAT XML
END

-RUN

FILEDEF COUNTRY CLEAR
FILEDEF CAR DISK _p_list.xml (APPEND

-RUN

TABLE FILE CAR
PRINT CAR         AS 'CODE'
      CAR         AS 'DESC'
ON TABLE HOLD AS CAR FORMAT XML
END

-RUN

FILEDEF CAR CLEAR
FILEDEF MODEL DISK _p_list.xml (APPEND

-RUN

TABLE FILE CAR
PRINT MODEL       AS 'CODE'
      MODEL       AS 'DESC'
ON TABLE HOLD AS MODEL FORMAT XML
END

-RUN

FILEDEF MODEL CLEAR
FILEDEF _P_LIST DISK _p_list.xml

-RUN

-SET &Multi_Count = 3 ;
-SET &P_MULTI_NAME= 'COUNTRY|CAR|MODEL' ;

-* Write out a master to read the _P_LIST list
EX -LINES 4 EDAPUT MASTER,_P_LIST,CV,FILE
FILENAME=_P_LIST, SUFFIX=FIX,$
SEGNAME=_P_LIST, $
  FIELD=XMLLINE ,ALIAS=  ,A500 ,A500 ,$

-RUN

DEFINE  FILE _P_LIST
 LINE/I9    = LAST LINE + 1 ;
 XML_TAG/A1 = IF EDIT(XMLLINE,'99999') EQ '<?xml' THEN 'Y' ELSE 'N' ;
 FXF_TAG/A1 = IF EDIT(XMLLINE,'9999')  EQ '<fxf' OR EDIT(XMLLINE,'99999') EQ '</fxf' THEN 'Y' ELSE 'N' ;
 Filter/A4  = IF (XML_TAG EQ 'Y')
              OR (FXF_TAG EQ 'Y')
              THEN 'N'
              ELSE 'Y' ;
END

TABLE   FILE _P_LIST
 PRINT  
        XMLLINE

 WHERE  TOTAL Filter EQ 'Y'

 ON     TABLE SAVE AS _P_XML
 ON     TABLE SET HOLDLIST PRINTONLY

END

-RUN

SET HTMLFORMTYPE = XML

-HTMLFORM BEGIN
<?xml  version="1.0" encoding="ISO-8859-1"?>
<fxf  version="1.0" data="hold">
!IBI.FIL._P_XML;
</fxf>
-HTMLFORM BEGIN


The js code will take a little time to sanitise.


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
The js call uses ibi's xmlhttp js library.

	var ibihttp = new ibihttpxml(_Action,null);
	var leftHtml = null;
	ibihttp.openFromForm(document.forms.Get_List);
	var selctDocs = ibihttp.selectNodes("//fxf/report");
	if (selctDocs.length>0) {
		for (var _c1=0;_c1<selctDocs.length;_c1++) {
			var _targt = ibihttp.selectNodesFromNode(selctDocs[_c1],'target') ;
			if (_targt.length>0) {
				var _SelList = document.getElementById(_targt[0].getAttribute("destination")) ;
				var selctTable = ibihttp.selectNodesFromNode(selctDocs[_c1],'table') ;
				if (selctTable.length > 0) {
					var selctNodes = ibihttp.selectNodesFromNode(selctTable[0],'tr') ;
					if (selctNodes.length>0) {
						for (var _c2=0;_c2<selctNodes.length;_c2++) {
							var _Kids = selctNodes[_c2].childNodes ;
							var _Opt = document.createElement("OPTION") ;
							_SelList.add(_Opt) ;
							_Opt.innerText = _Kids[1].nodeTypedValue ;
							_Opt.value     = _Kids[0].nodeTypedValue ;
						}
					}
					_SelList.disabled = false ;
					_SelList.selectedIndex = 0 ;
				}
			}
		}
	}


The _Action variable is the call to WF, the target relates to the select object, and the select object has been preprocessed to clear out what is there.


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Guru
posted Hide Post
Thanks Waz, I'll give it a try.

Håkan


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report 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] Performance problems using ajax

Copyright © 1996-2020 Information Builders