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     [CASE OPENED] Dev Studio HTML Composer: How to pass a variable to a Dynamic Procedure

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CASE OPENED] Dev Studio HTML Composer: How to pass a variable to a Dynamic Procedure
 Login/Join
 
Expert
posted
Dev Studio HTML Composer.

Report Parameter assigned to a drop-down select list, filled by calling a Dynamic Procedure.

How do you pass a variable to that procedure?

The code that we're not supposed to look at or question:
<SELECT language=javascript id=combobox1 style="Z-INDEX: 3; LEFT: 10px; WIDTH: 250px; POSITION: absolute; TOP: 100px" tabIndex=3
 onchange=combobox1_onchange(this) name=combobox1 sourcetype="typeFex" datatype="1" datasource="app/extract1.fex"
 IBIMR_domain="a2a2b0b0/a2a2b0b0.htm" IBIMR_folder="#onetwothreez" ibiapp_app cacheruntimedata="0"></SELECT>

Please don't tell me I have to create a cookie to solve this problem - this should be achievable from the GUI.

Thanks very much.

This message has been edited. Last edited by: Francis Mariani,


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
Guru
posted Hide Post
 

<SELECT id=listbox1 style="Z-INDEX: 1; LEFT: 270px; WIDTH: 250px; POSITION: absolute; TOP: 110px" tabIndex=1 size=3 name=COU newchainnumber="0" cacheruntimedata="0" inchainindex="1" chainnumber="0" ibiapp_app="SESSION baseapp" ibic_server sourcetype="typeFex" datatype="1" datafield displayfield datasource="country.fex">
</SELECT>


<SELECT id=listbox2 style="Z-INDEX: 2; LEFT: 270px; WIDTH: 250px; POSITION: absolute; TOP: 200px" tabIndex=2 size=3 name=CAR newchainnumber="0" cacheruntimedata="0" inchainindex="2" chainnumber="0" ibiapp_app="SESSION baseapp" ibic_server sourcetype="typeFex" datatype="1" datafield displayfield datasource="car.fex">
</SELECT>


Chaining. And your FEX should look like,

  TABLE FILE CAR
BY COUNTRY
ON TABLE PCHOLD FORMAT XML
END



TABLE FILE CAR
BY CAR
WHERE COUNTRY EQ '&COU'
ON TABLE PCHOLD FORMAT XML
END




The variable passing and Filtering will happen automatically, if you add the controls in Chain.


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Report This Post
Expert
posted Hide Post
Ramkumar,

Thanks, but I do not want to chain two controls. I have a hidden control that I want to pass to the dynamically executed fex.


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
Virtuoso
posted Hide Post
Chaining them is the right solution though:
<INPUT id=Seats tabIndex=1 type=hidden value=4 persistentuniqueid="compUid_2" name="Seats"> 
<SELECT id=Car tabIndex=2 persistentuniqueid="compUid_3" name="Car"></SELECT>   


With the accompanying XML like:
<xml id=focus_xmlelement>
<script type="text/xml">
	<rootxmlnode top="50" left="10" width="150" height="130">
		<variables></variables>
		<input_controls>
			<input_control bindcontrolid="compUid_2" elementtype="26" name="Seats" id="Seats"
 multiple="0" top="20" left="140" width="60" height="20" inbinding="1" onetimepopulated="1">
				<link linktype="default"></link></input_control>
			<input_control bindcontrolid="compUid_3" elementtype="8" name="Car" id="Car"
 multiple="0" top="15" left="295" width="60" height="20" inbinding="1" onetimepopulated="0">
				<link linktype="default" from="compUid_2">
					<condition default="1" name="Default" whattodowithcontrol="0"
 valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0"
 resolveparameterfq="CAR.BODY.SEATS" resolveparameter="SEATS">
						<data_info sourcetype="typeMaster" datatype="1"
 selectedvalue="" displayfield="CAR.COMP.CAR" ibiformat="A16" dfformat="A16" datafield="CAR.COMP.CAR"
 modifiedrequest="0" ibiapp_app="alban general ibisamp tibs baseapp" datasource="car.mas">
<![CDATA[TABLE FILE car
SUM FST.CAR.COMP.CAR
 BY CAR.COMP.CAR
-*insert_filters_here
ON TABLE PCHOLD FORMAT XML
END
]]></data_info></condition></link></input_control></input_controls>
		<other_bound_objects></other_bound_objects>
		<requests></requests></rootxmlnode></script>
</xml>


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
Can you indicate to me how I click on a hidden control to chain it to the visible control?

Also, I've never seen xml like this - where is this located? Not on the launch screen, which is made up of HTML, JS and CSS.


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
Virtuoso
posted Hide Post
Ah sorry, you're using WF 7.6.8. I was sure you were on 7.6.11, which uses the new approach with AJAX javascript calls to chain elements. I recall you were complaining about the same issue (HTML composer "upgrading" pages without asking) that I've been struggling with.

That version has a seperate Parameters tab in the composer where you do the chaining, so it doesn't matter whether a control is visible or not.

With your version, what you probably can do is create the hidden field as a text-field initially, chain it to the combobox, and then change the type-attribute of the text-field to 'hidden'.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
OK, I'll give the hidden/not hidden a try, thanks.

Meanwhile, I've taken a peek at v7.6.11 and I just can't get my head around that new Parameters tab.


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
Virtuoso
posted Hide Post
I think the best way to view the new parameters tab is as a view on the data-flow from the form to the next fex. There's no layout information in it.

Basically you have the hexagons that depict form controls (by name, so it's advisable to enter a name for your form controls in the Design tab) and ovals that depict parameters.
If a parameter (oval) is connected to a form control (hexagon), then it's a bound parameter, if its not, then it is unbound and ends up in the 'unbound' box.

You can have form-controls that call a so called embedded procedure, which is a simple version of a TABLE FILE query. Don't try to be smart there, the system can't handle that well. If you need smart, use an external procedure instead or prepare a hold file before including the form and use that in the embedded procedure.

You can create new parameters using the right mouse button, while you can create new form elements in the Design tab.

You can chain form controls by selecting two form elements (first source, then target) and clicking the 'link' button in the toolbar.

Another thing worth knowing is that you can click the arrows connecting form controls and parameters as well as links between form controls, to set various properties. For example, which field a set of chained form-elements is filtered on.

It's really fairly intuitive once you're used to it (well, it is to me!), and quite powerful at the same time.

There are a few limitations though. For example, you can't set dynamic defaults (the current date in a calendar field, for example) using the GUI, and you can't set defaults for chained controls, because the values in their form-element depend on what their parent is set to. For our own use I created a set of Javascript libraries to handle that.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
Wow! Thanks for taking the time to explain in such detail. I'll keep a copy of this posting for when we upgrade.


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
Master
posted Hide Post
Wep,
What are your experiences in doing the chaining? It seems to me that when I have 2 parent fields and a child (child value depends on *BOTH* parent values), the chaining properties seem to reflect only one of the combinations' values. I.e. Both parents resolve a different parameter, but when clicking the properties of both, they don't change. Making me think that only one of these is supported.

- ABT

I've gotten this to work once in Dev, but am having a heck of a time recreating it in Prod.


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Report This Post
Virtuoso
posted Hide Post
I haven't had any need to chain multiple input controls to one target control yet, but I understand the use-cases for such. Doing such would allow to apply multiple WHERE conditions to the query in the target control, useful enough! It seems bugged though...

To elaborate, I created a test-case using the CAR database, connecting a dropdown with COUNTRY to CAR as well as one with SEATS. If you click the arrows linking either COUNTRY to CAR or SEATS to CAR, they both filter on the same field! That's not right... Changing the field that one of them filters on changes the other as well. That's obviously not what was intended.

Did you open a case with IBI for this yet?
I could post my HTML file here, but the generated content rather obfuscates the issue, it's probably easier to see what's going wrong if someone tries to recreate the problem from scratch.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
Actually, my one set of chained drop-down list boxes works. I never thought I'd have to resort to chaining to pass a variable to fex that loads only one drop-down list boxe.


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
Master
posted Hide Post
Apologies to Francis for hijacking his thread, but carrying on seems to be on-topic...

quote:
To elaborate, I created a test-case using the CAR database, connecting a dropdown with COUNTRY to CAR as well as one with SEATS. If you click the arrows linking either COUNTRY to CAR or SEATS to CAR, they both filter on the same field! That's not right... Changing the field that one of them filters on changes the other as well. That's obviously not what was intended.


Here are some more findings I have. The chained drop-downs seem to be aware of other variables in the environment. That is, in the FEX driving the first drop-down (one of the parents, we'll call her 'MOM', I do something similar to:
TABLE FILE CAR
PRINT
COUNTRY AS 'COUNTRY'
ON TABLE PCHOLD FORMAT XML
END


In my Child FEX (chained to 'MOM'), I am able to reference the field produced from MOM without specifying it.

TABLE FILE CAR
PRINT
MODEL AS 'MODEL'

WHERE COUNTRY EQ '&COUNTRY';
ON TABLE PCHOLD FORMAT XML
END


In my case, the other parent (umm, 'DAD' I guess) holds hardcoded values and I have to use the 'fills parameter' option to associate it, since I cannot specify in the fex the value/field being passed.

Secondly, in DAD, I HAVE to make sure he is marked as the Default Link (right-click chain between hardcoded Parent and Child, check 'Default link')

I am still wrestling with this, hope my finding help someone (they are inching me closer).

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Report This Post
Master
posted Hide Post
Got it.

Here's my notes on making this work:

!!! Order of operations is important !!!
1. Go to the location you intend to be the final home of your application. If you intend to use a Dev or Test system to model, be aware that you will most likely have to completely rebuild it in your Production system.
2. Create a new HTML file and (on the Design tab) build controls on screen (drop-downs, etc). Must name them and give them a unique ID.
3. Add a 'Submit' button. 'Create Hyperlink' and point to the destination FEX. This references the report parameter fields needed to populate/associate for report run.
4. After completing the step above, delete all the form controls it added on the Design tab, leaving only the Submit button.
5. On the 'Parameters' tab, associate the controls to the unbound report parameters. Do this by dragging the hexagon HTML field control to the oval report parameter control (an arrow should form between).
6. For Dynamic Controls, do the following:
6a. Beginning at the logical 'Top-most' control, on the Parameters tab, left-click the corresponding hexagon. A pop-up appears.
6b. Select 'Dynamic', 'External Procedure'.
6c. Click the elipsis to find the procedure in the list.
Now would be a good time to ensure your FEXes run and produce the intended outputs.
!!! ON TABLE PCHOLD FORMAT XML
!!! DO NOT use an 'AS NAME' in your data pull (FIELDNAME AS 'ANOTHERNAME' does not work as intended, at least for me, even with SET ASNAMES=ON (or OFF)).

7. For Chained Controls, do the following:
!!! Ensure your dynamic FEXs to build the drop-downs USE THE SAME VARIABLE NAMES between each. If the second depends on a field called 'OrgEntityName' to come from the first, make sure the first holds a value called 'OrgEntityName'. Do not do "AS 'OrgEntityName'", see comment above.
!!! When these variables are present in the environment, they seem to be automatically picked up for use/inclusion'. For this purpose, try not to have the same variable value floating around too often.

7a. If your chained control is 1 --> 1 (parent --> Child), fill in the Dynamic population properties for the parent only. Make sure the Value and Display fields are filled in properly.
7b. Drag the Parent hexagon to the Child, so a line is formed between. Click on this line and a Properties box will show. Repeat the step above to fill in the Dynamic field properties for the child. For the 'Resolves Parameter' field, associate the name of the field from the first hold file that the Child WHERE statement is looking for.


7c. If your chained control is a 2 --> 1 (Parent, Parent --> Child), fill in the Dynamic population properties for the parents only. Make sure the Value and Display fields are filled in properly for both.
7d. DO NOT DRAG the Parent hexagon to the Child as in other steps. Instead, click the one parent and CTRL + Click the child so that both are highlighted.
7e. Find the 'Add to Current Chain' icon (looks like a chain link with a yellow plus sign) and click it to form a connection between the two. Fill in as stated in 7b. Repeat same steps for other parent and child. This should allow you to seperate the 'Resolves Parameter' values.

7f. If you have one parent that is Dynamic and One that is Static, fill in the Dynamic Chain first. After, fill in the Static Chain. After, right-click the chain between the Static Parent and Child and choose to make this the Default chain. Make sure the Dynamic Parent to Child Properties have not gone away.

Other hints:
For Static Fields, make one option a 'Select By...' display with a value of ERROR. You can exploit this to reset this field (and others in the chain). In my case, my second field was the Static one. I set the onChange event of my first field to the following:
function cboEntity_onchange(ctrl) {
document.GetElementByID(cboStaticDropDown).value = 'ERROR';
}

This way, if someone got to the last step and decided to start over, they would not have to reload the page. They just do the natural thing, select a new top-level value. My third level drop-down (the child to the Static and Dynamic parent) is coded to interpret the error value and loads the list with nothing.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Report This Post
Master
posted Hide Post
Holy doodle !

Good stuff. I hope IB adds this to the course materials ...


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report 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     [CASE OPENED] Dev Studio HTML Composer: How to pass a variable to a Dynamic Procedure

Copyright © 1996-2020 Information Builders