(RPG) Two related dropdowns on an offline form view
Posted: Tue Jan 07, 2014 12:05 am
On an offline form view, I want to maintain an employee (which belongs to a department/section).
To facilitate the choice of the department/section to the user, I can display one dropdown with existing departments and one dropdown with existing sections. These dropdowns are populated/binded using local SQLite tables (Department and Section):
EZI_BindProperty( P1_DEPTMENT : 'VALUE' : 'FLD' : 'DEPTMENT');
EZI_BindProperty( P1_SECTION : 'VALUE' : 'FLD' : 'SECTION');
…
EZI_BindProperty( P1_DEPTMENT : 'ITEMTEMPLATE.VALUE'
: 'FLD' : 'DEPTMENT' );
EZI_BindProperty( P1_DEPTMENT : 'ITEMTEMPLATE.TEXT'
: 'FLD' : 'DEPTDESC' );
EZI_BindProperty( P1_DEPTMENT : 'ITEMLIST' : 'SQL'
: 'SELECT ROWID, DEPTMENT, DEPTDESC FROM Deptment');
EZI_BindProperty( P1_SECTION : 'ITEMTEMPLATE.VALUE'
: 'FLD' : 'SECTION' );
EZI_BindProperty( P1_SECTION : 'ITEMTEMPLATE.TEXT'
: 'FLD' : 'SECDESC' );
EZI_BindProperty( P1_SECTION : 'ITEMLIST' : 'SQL'
: 'SELECT ROWID, SECTION, SECDESC +
FROM Section'); // this display all Section records…
But I want to display in the section’s dropdown only the related sections of the displayed department. Any ideas how to achieve it?
Full RPG source is attached.
Yann
To facilitate the choice of the department/section to the user, I can display one dropdown with existing departments and one dropdown with existing sections. These dropdowns are populated/binded using local SQLite tables (Department and Section):
EZI_BindProperty( P1_DEPTMENT : 'VALUE' : 'FLD' : 'DEPTMENT');
EZI_BindProperty( P1_SECTION : 'VALUE' : 'FLD' : 'SECTION');
…
EZI_BindProperty( P1_DEPTMENT : 'ITEMTEMPLATE.VALUE'
: 'FLD' : 'DEPTMENT' );
EZI_BindProperty( P1_DEPTMENT : 'ITEMTEMPLATE.TEXT'
: 'FLD' : 'DEPTDESC' );
EZI_BindProperty( P1_DEPTMENT : 'ITEMLIST' : 'SQL'
: 'SELECT ROWID, DEPTMENT, DEPTDESC FROM Deptment');
EZI_BindProperty( P1_SECTION : 'ITEMTEMPLATE.VALUE'
: 'FLD' : 'SECTION' );
EZI_BindProperty( P1_SECTION : 'ITEMTEMPLATE.TEXT'
: 'FLD' : 'SECDESC' );
EZI_BindProperty( P1_SECTION : 'ITEMLIST' : 'SQL'
: 'SELECT ROWID, SECTION, SECDESC +
FROM Section'); // this display all Section records…
But I want to display in the section’s dropdown only the related sections of the displayed department. Any ideas how to achieve it?
Full RPG source is attached.
Yann