Focal Point
Problem with Maintain DROPDOWN

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

November 15, 2007, 02:08 PM
<Vijaya_settu>
Problem with Maintain DROPDOWN
Hello Everyone,
In my form, I have 3 dropdown fields, values populating from stack. If I run my form , I am seeing blank dropdown. If I click next to the drop down .Then only it is giving value.

My code is below.
Case ShowReport
Stack clear HTMLSTACK;
COMPUTE DIVS/A50 = Vw_divisionsStk().VW_DIVISIONS.DIV_DESC ;
STACK CLEAR Vw_divisionsStk;

COMPUTE DEPT/A50 = Vw_deptsStk().VW_DEPTS.DEPTS_DESC ;
STACK CLEAR Vw_deptsStk;

COMPUTE BLDG/A50 = Vw_buildingsStk().VW_BUILDINGS.BLDG_DESC ;
STACK CLEAR Vw_buildingsStk;

EXEC campusDirectory from Last First DIVS DEPT BLDG INTO HTMLSTACK;
EndCase
Please let me know if anyone has solution for this problem.

Thankyou
Vijaya
November 15, 2007, 03:00 PM
Maintain Wizard
First let me assume that you have HTMLSTK declared as something like:

COMPUTE HTMLSTK.HTML/A200:

Are you doing ON TABLE PCHOLD FORMAT HTML in your TABLE?

If so, then you are returning HTML that should only be displayed in an HTML Object. What are you returning? If you are just trying to populate a drop down box, then it shouldn't be HTML. Make sure that the combo box is bound to the stack that you are returning.

If you are not returning HTML, please show me the declaration for HTMLSTK and what you are using in the TABLE.

Mark
November 16, 2007, 09:56 AM
<Vijaya_settu>
Mark,
Thank you for your reply. I am populating
a value for the dropdown from the stack. My problem is my dropdown box is not showing value automatically. For Ex. I have Division Dropdown in my form. When I run my form , My division dropdown is empty .if I click on the empty area next to the dropdown.Then it is showing all the division.Then i can select value from the dropdown and hit search button.It is givng output.

Thank you
Vijaya



This following is one of my dropdown event handler:
Case OncbxDivis_Blur
Reposition vw_divisions.VW_DIVISIONS.DIV_DESC ;
For all next vw_divisions.VW_DIVISIONS.DIV_DESC into Vw_divisionsStk ;
EndCase

Case Onbtnsrchdivi_Click
Perform ShowReport( );
Winform Show Form2;
EndCase
---------------------------------------
My report Code:
-SET &LstNme = &1;
-SET &FstNme = &2;
-SET &Div = &3;
-SET &Dep = &4;
-SET &Bldg = &5;
TABLE FILE VW_HRPER
PRINT
LAST_NAME AS 'Last Name'
FIRST_NAME AS 'First Name'
DEPTS_DESC AS 'Departments'
DIVISIONS_ID NOPRINT
DIV_DESC AS 'Division'
BLDG_DESC AS 'Building'
BY LAST_NAME NOPRINT
BY HRPER_ID NOPRINT
WHERE (HRP_EFFECT_TERM_DATE EQ MISSING)
AND (ALL_STATUSES NE MISSING)
AND (PERSTAT_END_DATE EQ MISSING);
WHERE ((LAST_NAME EQ '&LstNme')OR (FIRST_NAME EQ '&FstNme') OR (DIV_DESC EQ '&Div') OR (DEPTS_DESC EQ '&Dep') OR (BLDG_DESC EQ '&Bldg'));
ON TABLE SET PAGE-NUM OFF
ON TABLE PCHOLD FORMAT HTMTABLE
END
________________________________________
My maintain Code below:

MAINTAIN FILE vw_person AND vw_hrper AND vw_divisions AND vw_depts AND vw_buildings
$$Declarations

Declare Last / A25 ;
Declare First / A25 ;

Case Top
Infer vw_person.VW_PERSON.LAST_NAME into Vw_personStk;
Infer vw_buildings.VW_BUILDINGS.BLDG_DESC into Vw_buildingsStk;
Infer vw_depts.VW_DEPTS.DEPTS_DESC into Vw_deptsStk;

Compute HTMLStackEntireReport.HTML / A250 ;

Infer vw_divisions.VW_DIVISIONS.DIV_DESC into Vw_divisionsStk;

Compute HtmlStack.HTML / A250 ;



Winform Show Form1;

-* Replace the Winform Show command with the following code
-* when to display your form in a non-persistent state
-* Winform Show_and_exit Form1;
EndCase

Case ShowReport
Stack clear HTMLSTACK;
COMPUTE DIVS/A50 = Vw_divisionsStk().VW_DIVISIONS.DIV_DESC ;
STACK CLEAR Vw_divisionsStk;

COMPUTE DEPT/A50 = Vw_deptsStk().VW_DEPTS.DEPTS_DESC ;
STACK CLEAR Vw_deptsStk;

COMPUTE BLDG/A50 = Vw_buildingsStk().VW_BUILDINGS.BLDG_DESC ;
STACK CLEAR Vw_buildingsStk;

EXEC campusDirectory from Last First DIVS DEPT BLDG INTO HTMLSTACK;
EndCase

Case EntireReport
EXEC CampusDirectoryEnt INTO HTMLStackEntireReport;
EndCase
END
November 16, 2007, 01:12 PM
Maintain Wizard
Ok - The problem is, you are loading your combo box using the same box's BLUR trigger. BLUR means, perform this trigger when the object loses focus. What you want to do is populate this combo box BEFORE the form is displayed. Remove the BLUR trigger from the combo box and place that code in TOP case (See my commented line in TOP case)

This way, the stack is populated BEFORE the form is displayed and you can see the data.

Mark

MAINTAIN FILE vw_person AND vw_hrper AND vw_divisions AND vw_depts AND vw_buildings
$$Declarations

Declare Last / A25 ;
Declare First / A25 ;

Case Top
Infer vw_person.VW_PERSON.LAST_NAME into Vw_personStk;
Infer vw_buildings.VW_BUILDINGS.BLDG_DESC into Vw_buildingsStk;
Infer vw_depts.VW_DEPTS.DEPTS_DESC into Vw_deptsStk;

Compute HTMLStackEntireReport.HTML / A250 ;

Infer vw_divisions.VW_DIVISIONS.DIV_DESC into Vw_divisionsStk;

Compute HtmlStack.HTML / A250 ;

-***** CODE ADDED HERE ***
Reposition vw_divisions.VW_DIVISIONS.DIV_DESC ;
For all next vw_divisions.VW_DIVISIONS.DIV_DESC into Vw_divisionsStk ;

Winform Show Form1;
November 16, 2007, 04:07 PM
<Vijaya_settu>
Mark,
I really appreciate your suggestion, it was perfect! Now I am getting dropdown value automatically.

Thankyou!
Vijaya