Online Form with a bit of local data
Posted: Wed Oct 22, 2014 2:43 am
I have an Online form, a log on screen, with a bound screen element, an email field (textbox), where I populate the initial value from a local DB, i.e. the local DB “remembers” the users email address if a checkbox is checked. That part all works, the email address on the log on screen is populated from the local DB.
Here’s the DDS for the email address (EMAILADR) on my formview :
A 10 60HTML('<<EMAILADR>>
A Type : Textbox
A DataType : Email
A ShowClearButton : True
A Layout.Cols : 3
A PlaceHolder :
A "Enter your email address"
A ')
The RPG that populates EMAILADR on the form from the local DB.
LRNG_SetNumProperty('/Form.Vars.SFID' : SavedState.MC3SFID );
LRNG_SetProperty( '/Form.&.TBL' : 'CEMobileUserData');
LRNG_SetProperty( '/Form.&.SQL'
: 'SELECT ROWID, CEMSFID, CEMUSERID, CEMLANGID'
+ ' FROM CEMobileUserData'
+ ' WHERE CEMSFID = &(VAR:SFID)' );
LRNG_Using('/Form.Fields');
LRNG_SetProperty('EMAILADR.Value.&.FLD' : 'CEMUSERID');
LRNG_EndUsing();
The problem I’m having is that when the user touches the Log On button or Return to process the log on attempt using the email address, the RPG attempts to retrieve the value of the screen element, but it’s always blank. I saw another issue where Tony suggested not using the bound element but rather get the value directly from the DB. How do I do that when the local DB field is bound to my screen element? At some point I need to get the email address into an RPG field that I can use to Chain to the user file on the IBM I. This is where I can't seem to work out the mechanism.
wrkEmailAdr = LRNG_GetPropAsStr('Form.Fields.EMAILADR.Value'); // this works if unbound. When bound it returns blank.
If I leave EMAILADR as an unbound element, I can retrieve its value, but then of course the initial value isn’t set from my local SQLite DB on the device (a feature the sales reps here have requested). How do I get the value from the bound element into an RPG field ?
So in summary, I'm trying to save some log on information locally on the device so the user doesn't always have remember and key in the log on values. Ultimately I need to use that value to process my log on as though the user had keyed the value in. I just can't work out how to get the value of my bound data into an RPG field (50A).
I’ve gone through the Foundation and Advanced Offline documents and created my own variations of the shipped examples but I would still consider myself an offline noob. Any help would be appreciated.
Here’s the DDS for the email address (EMAILADR) on my formview :
A 10 60HTML('<<EMAILADR>>
A Type : Textbox
A DataType : Email
A ShowClearButton : True
A Layout.Cols : 3
A PlaceHolder :
A "Enter your email address"
A ')
The RPG that populates EMAILADR on the form from the local DB.
LRNG_SetNumProperty('/Form.Vars.SFID' : SavedState.MC3SFID );
LRNG_SetProperty( '/Form.&.TBL' : 'CEMobileUserData');
LRNG_SetProperty( '/Form.&.SQL'
: 'SELECT ROWID, CEMSFID, CEMUSERID, CEMLANGID'
+ ' FROM CEMobileUserData'
+ ' WHERE CEMSFID = &(VAR:SFID)' );
LRNG_Using('/Form.Fields');
LRNG_SetProperty('EMAILADR.Value.&.FLD' : 'CEMUSERID');
LRNG_EndUsing();
The problem I’m having is that when the user touches the Log On button or Return to process the log on attempt using the email address, the RPG attempts to retrieve the value of the screen element, but it’s always blank. I saw another issue where Tony suggested not using the bound element but rather get the value directly from the DB. How do I do that when the local DB field is bound to my screen element? At some point I need to get the email address into an RPG field that I can use to Chain to the user file on the IBM I. This is where I can't seem to work out the mechanism.
wrkEmailAdr = LRNG_GetPropAsStr('Form.Fields.EMAILADR.Value'); // this works if unbound. When bound it returns blank.
If I leave EMAILADR as an unbound element, I can retrieve its value, but then of course the initial value isn’t set from my local SQLite DB on the device (a feature the sales reps here have requested). How do I get the value from the bound element into an RPG field ?
So in summary, I'm trying to save some log on information locally on the device so the user doesn't always have remember and key in the log on values. Ultimately I need to use that value to process my log on as though the user had keyed the value in. I just can't work out how to get the value of my bound data into an RPG field (50A).
I’ve gone through the Foundation and Advanced Offline documents and created my own variations of the shipped examples but I would still consider myself an offline noob. Any help would be appreciated.