Focal Point
[SOLVED] Chaining Controls - Multiple Input

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

June 11, 2012, 11:33 AM
dburton
[SOLVED] Chaining Controls - Multiple Input
I have a drop down list that is populated based on the chaining of another drop down list. I would like to add a date range to help filter the list.

Essentially, I will have 3 inputs that will determine the output of the one drop down list. Is it possible to chain 3, or more, inputs to one drop down list? It doesn't have to be a drop down list either, it can be any control.

Thanks.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 7.7.03
Windows Web Server 2008
MS SQL Server 2000
Excel,CSV,PDF,HTML
June 11, 2012, 04:03 PM
susannah
short answer: yes indeed.
You are using 3 separate fexes to populate your 3 dropdown lists, yes?
just chain them in order, eg
pick a date first
then in the fex for list 2, use a date filter
and in the fex for list 3, use both a date filter and a list-2-value filter.
You can leave out the date filter from list 2, if you want to cheat.
Make sense?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
June 11, 2012, 04:46 PM
dburton
quote:
Originally posted by susannah:
short answer: yes indeed.
You are using 3 separate fexes to populate your 3 dropdown lists, yes?
just chain them in order, eg
pick a date first
then in the fex for list 2, use a date filter
and in the fex for list 3, use both a date filter and a list-2-value filter.
You can leave out the date filter from list 2, if you want to cheat.
Make sense?


This makes sense, however, its not my setup unfortunately.

Inputs:
Start Date - text box
End Date - text box
Standard - drop down list (embedded fex)

The other drop down list is the output and is based on the 3 input parameters in the fex. I have the Standard input chained with the output but am trying to figure out how to chain the other two inputs with the output. As soon as I do this, it doesn't give me any other options for the "resolve" parameter.

Any other suggestions?

Thanks.


WebFOCUS 7.7.03
Windows Web Server 2008
MS SQL Server 2000
Excel,CSV,PDF,HTML
June 11, 2012, 04:54 PM
susannah
ah, no.
use calendar controls or a dropdown for your date.
you really dont' want text boxes for dates b/c users make up all sorts of stuff for input.
and as for embedded fexes, i do so strongly suggest you use external fexes. keep your launch page as clean as humanly possible
June 11, 2012, 09:07 PM
dburton
I started with calendar controls and i'm still in the same situation. Even if I used external procedures, the outcome is still the same.

Any suggestions?


WebFOCUS 7.7.03
Windows Web Server 2008
MS SQL Server 2000
Excel,CSV,PDF,HTML
June 11, 2012, 10:03 PM
susannah
i'm in 768 so i'm not sure i can do anything with your files, but i pm'd you my email address, so you we can try.
i can certainly have a look.
June 12, 2012, 09:25 AM
j.gross
You should be able to nominally chain three hidden text controls (that contain copies of the values of the three visible controls) to your fourth one. Since the parents are hidden, they will never spontaneously cascade, but the IbComposer API functions in 7.7 allow you to refresh the drop-down list of the fourth control based on the values of its three chained parents.

See ("Designing a User Interface ..." 7.7.03 DN 4501002.0511), p. 316, "IbComposer_ResetDownChainControls()"
June 12, 2012, 09:37 AM
susannah
thanks for taking this over, jack Smiler




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
June 13, 2012, 11:32 AM
dburton
quote:
Originally posted by j.gross:
You should be able to nominally chain three hidden text controls (that contain copies of the values of the three visible controls) to your fourth one. Since the parents are hidden, they will never spontaneously cascade, but the IbComposer API functions in 7.7 allow you to refresh the drop-down list of the fourth control based on the values of its three chained parents.

See ("Designing a User Interface ..." 7.7.03 DN 4501002.0511), p. 316, "IbComposer_ResetDownChainControls()"


I have done an onChange event because I am using calendar controls. Also, this example I am using is from the GGORDER table as everyone has these examples.

Here is my HTML portion for the calendars.
//Begin function ENDDATE_onchange
function ENDDATE_onchange(ctrl) {
	IbComposer_ResetDownChainControls('ENDDATE');
}
//End function ENDDATE_onchange

//Begin function STARTDATE_onchange
function STARTDATE_onchange(ctrl) {
	IbComposer_ResetDownChainControls('STARTDATE');
}
//End function STARTDATE_onchange


Here is the procedure I am using that is assigned to a listbox.
TABLE FILE GGORDER
PRINT 
     GGORDER.ORDER02.PRODUCT_DESCRIPTION
BY  GGORDER.ORDER01.ORDER_NUMBER
WHERE ( GGORDER.ORDER01.ORDER_DATE GE '&STARTDATE' ) AND ( GGORDER.ORDER01.ORDER_DATE LE '&ENDDATE' );
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XML
END


This still does not work. Any other suggestions?

Thanks.


WebFOCUS 7.7.03
Windows Web Server 2008
MS SQL Server 2000
Excel,CSV,PDF,HTML
June 13, 2012, 03:12 PM
j.gross
Have you verified whether or not the onchange handler is being triggered?

If you are using calendar controls, I believe the onChange event will fail to trigger when the user sets the value by means of the pop-up calendar control, because the user did not type a value in the text box, and the text value had not changed when ifocus shifted from it to the pop-up.

If so, you may have to resort to some other method to monitor (i.e., to sense changes in) the text-box's value and manually trigger the onchange handler.

In some scenarios that you can anticipate, the user would expect the dropdown to be refreshed when they revise either the start-date or the end-date value.

That's why I would, upon change in either value, (a) copy the two dates to corresponding hidden chained text controls; and (b) run IbComposer_ResetDownChainControls(), passing the id of the hidden end-date (which is chained as immediate parent of the list-box control), so as to pass the two date strings to the fex that populates the list.

Have you tried that?
June 14, 2012, 09:12 AM
dburton
I'm not very familiar with Javascript at all which I'm assuming is how I would test the onChange handler.

So, I found an example "How to Use Controls to Populate Another Control Based on Selected Values" on page 246. I went through this example and it worked well. The only problem is that it doesn't have any dates.

I then applied the same concept which is to create the controls, add parameters, chain the controls to the parameters and then chain each of the controls to the output and resolve the parameters. This still didn't work. I believe this is what you were talking about before except I used parameters instead of hidden controls.

Any other suggestions?

Thanks.


WebFOCUS 7.7.03
Windows Web Server 2008
MS SQL Server 2000
Excel,CSV,PDF,HTML
February 26, 2017, 02:08 PM
kumarn
facing similar challenge where my chained list box controls depends on inputs from start date and end date .
Any suggestions/solution as part of this issue ?


WF 8.1.05 / APP Studio
February 28, 2017, 02:18 PM
MathematicalRob
@kumarn,

Where, exactly, are you running into a problem?

I have a chain where I have a text box and two drop-down lists supplying variables to an external procedure that populates a third drop-down list. These four controls, with others, populate variables used by the final report.

I haven't yet been able to get this to work using the GUI, but by coding it myself, I can get it work without using any extra Javascript. (Well, I do have some that is unique to my particular example.) The 8.1.05 chaining seems to be quite powerful.

- Rob


WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
May 01, 2020, 02:01 PM
Emily Lee
Hi MathematicalRob,

I am using the AppStudio8201 now. I wonder can we do the chaining control from multiple input links in the HTML canvas without using the JS code?

I have two sets of chain in my user-launch page, Set1: Region->State->City. Set2: Provider Type -> ProviderID. I need the value of State, and City and ProviderID to populate the facility dropdown list which belongs to the selected ProviderID in the selected city. I have the external fex programs to populate the State-box, City-box and ProviderID-box. I also have a fex program assigned to the Facility-dropdown box, which expect to received 3 params - State, City, and ProviderID. I don't know how to make the last Facility-dropdown box receive the input-triggers from the State and City box. I have read the conditional chain-control, but that does not seem relevant. Appreciate your help. Emily


WebFOCUS 8.2.01 AppStudio
HTML, PDF, Excel
May 01, 2020, 03:02 PM
MathematicalRob
Hi Emily,

Yes, it is possible to do without Javascript. I'll email you a simple example I did about three years ago using the CAR file. I haven't worked with these much in some time, but if I remember correctly, the key was to edit the text of your page and create additional
<link>
components under the html_element that ties the two chains together. In your case, I think you would need a link component under the Facility html_element referencing the controls for each of State, City, and ProviderID.

- Rob


WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
May 01, 2020, 04:57 PM
FP Mod Chuck
Emily

With App Studio 8201 you can create an html form and then reference the fex that has all your parameters (&variables) in WHERE statements. It will pop up a box asking you what kind of control you want to use and there is a check box you can check to set the chaining. It is very simple to use.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
May 04, 2020, 03:54 AM
Wep5622
Chuck,

You seem to be rather missing the point of Emily's question. I'm pretty sure that you can't use a single checkbox on a control to set multiple inputs to it.
Of course I'd gladly be proven wrong.

From a technical POV, the requirement is to generate multiple parameterized WHERE-clauses on the TABLE request that populates the control, based on selections in multiple controls chained to the same single control.
AFAIK, in the current implementation it is only possible to generate a single parameterized WHERE-clause chaining controls like that.

It would be a useful feature to have, for example to filter a control listing CARs by the selections on both MODELs and (# of) SEATs.

That said, the options on a chained control link do seem to allow for extra items to be added, but I don't think anybody understands how that's supposed to work nor whether that could be used to set multiple input chains on a control.


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 :
May 04, 2020, 10:12 AM
Emily Lee
Wep5622,
You are right, you understood my question correctly. It is sad that there is no easy way to receive multiple input links for a control box in AppStudio GUI tool.

Rob,
Thank you for your sample codes. I will try to test them to understand your tricks. I will let you know then. Thanks.
-- Emily


WebFOCUS 8.2.01 AppStudio
HTML, PDF, Excel
May 04, 2020, 10:49 AM
FP Mod Chuck
Ooooops sorry about that!


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
May 05, 2020, 01:33 PM
Emily Lee
Hi all,
I also discussed this issue with a WF expert at our site, he suggested me simplify the issue with – passing the 1st chain controls link to the 2nd chain controls link, all 6 cmbs all chained in order, no break. We can use basic GUI function in AppStudio to achieve this result. No complicated JS or others.

Let me summarize: I have two chain-controls links,
1st chain controls link: Region ->State -> City
2nd chain controls link: Network ->Provider -> Facility

The Facility cmb expect the value of “State”, “City” and “Provider” to populate the Facility dropdown list.
I places the 2nd chain link after the 1st chain link, the html “parameter” tab looks:

Region ->State -> City -> Network->Provider -> Facility

Although the value of State, and City are not referenced by the “Network” cmb and “Provider” cmb, but both values will be passed down by the chain to get to the last – “Facility” cmb.

The problem resolved. Thanks to all for your assistances and attentions.


WebFOCUS 8.2.01 AppStudio
HTML, PDF, Excel