Focal Point
Sorting HTMLStack Output based on Radio Button Selection

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

February 05, 2008, 01:25 PM
<Vijaya_settu>
Sorting HTMLStack Output based on Radio Button Selection
Hello Everyone,
I have a form with Text box , Combobox and Radio Button. Currently it is giving ouput based on user input value from Text box or Combobox selction. But I also want my Output sort by Radio button Selection.

For Example: I have 5 radio button , First Name , Last Name, Dept, Divi & Build. when the user select the radio button, I want my output Sort. I appreciate any one could help me on this issue.

I have the following code on my form. but somewhow it didn't work.

Declare sortbutton / A50 ;


Case Ongrprdobtn_Change
if sortbutton eq '1'then
Stack sort Vw_personStk by LAST_NAME;
else
if sortbutton eq '2' then
Stack sort Vw_personStk by FIRST_NAME;
else
if sortbutton eq '3' then
Stack sort Vw_divisionsStk by DIV_DESC;
else
if sortbutton eq '4' then
Stack sort Vw_deptsStk by DEPTS_DESC;
else
if sortbutton eq '5' then
Stack sort Vw_buildingsStk by BLDG_DESC;
EndCase

Thankyou
Vijaya
February 05, 2008, 02:51 PM
Alan B
Vijaya

If you have sortbutton declared as A50, then it sounds as though you have bound the text rather than the value, which I would expect to be something like an I2 format.

TYPE or SAY out sortbutton during processing.

You also mention HTMLStack. This is normally the return from an EXEC and is usually the contents of a report (an HTMLTABLE) and has a format of StackOf A250 or some such, and is therefore not sortable like other stack


Alan.
WF 7.705/8.007
February 06, 2008, 03:54 AM
GamP
Did you name the 5 radio button differently?
Or did you use a stack to populate the control?
Did you bind radiobutton to a return variable?
As Alan stated: a type of the sortbutton variable may shed some light.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
February 06, 2008, 10:41 AM
PBrightwell
If you are sorting an HTML Stack see Alan's answer above. However, if you are using an HTML form and passing input parameters to a .fex you can set up a BY statement in an amphere variable. If you are using a SQL passthru you have to change this to SQL code and in either case you need &BY1.EVAL where you use it.
-SET &BY1=IF &WHATSRT1 EQ 'COUNTY' THEN 'BY COUNTY AS ''County'' SUBTOTAL AS ''Total for County''' 
- ELSE IF &WHATSRT1 EQ 'DISTRICT' THEN 'BY DISTRICT AS ''District'' SUBTOTAL AS ''Total for District'''
- ELSE IF &WHATSRT1 EQ 'CITY' THEN 'BY CITY AS ''City'' SUBTOTAL AS ''Total for City'''
- ELSE '';

The values in my form are the fieldnames in my table. In my HTML form this would be:
<input type="RADIO" name="WHATSRT1" value="COUNTRY"> Country
<input type="RADIO" name="WHATSRT1" value="DISTRICT"> District
<input type="RADIO" name="WHATSRT1" value="CITY"> City



Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
February 12, 2008, 10:32 AM
Maintain Wizard
Hi Vijaya
I don't believe that sortbutton is getting the correct value. Edit that object and select the SelectedItems property from the properties sheet in the MDE.

Make sure that sortbutton is the variable bound to the selection result. Also make sure that you are sending the result as value. If this is from a stack, the value will be the focindex of the stack selection. If the data is hard coded, add a value field for each item.

If you are still not getting sorting, type out or display the sortbutton value on the form and see what is getting passed back. Since you ARE just trying to get a number, I would change the A50 format to an A2.

Mark
February 12, 2008, 11:17 AM
<Vijaya_settu>
Mark,
Thank you for your quick response, finally i got my radio button problem solved.


Thank you
Vijaya