.
Hi,
I'm trying to modify at the same time a user's Personal data and Security data, using a Dialog2 component. The video showing how to proceed is D_SF_3. The video uses a Dialog2 template by the name of SecurityFramework-EditAccountForExistingUser.
I built the Dialog using the template, re-created the RegisteredUsers table together with its fields as one of my tables and have put the Dialog to test. It works as described in the video. The Dialog has two sections, one for Personal data and another for Security data. On initialize, both sections are automatically filled in with the user whose id=1 (that value is hardcoded, see just below), ready for editing.
The problem is: the user value is hardcoded. You'll find this code in Events --> Server-SIDE --> onDialogInitialize:
For the Dialog to be of any use, it should be able to edit any user, not just one particular hardcoded user. To that effect, I added a dropdown box to the Dialog, plus a button. The dropdown box retrieves the list of users from the RegisteredUsers table and the button, when clicked, uses the Populate Controls in a Dialog Component with Data from Tables Action Javascript. Now, when I select a user from the dropdown and click the button, the fields in the Personal data section are filled in but the fields in the Security data are left blank.
In the template's OnDialogInitialize event, the sequence of actions is:
a) Receive the user value (in our case, either hardcoded or passed from the dropdown), which is the primary key field id
b) Retrieve the user's Personal data corresponding to that id from our RegisteredUsers table. Also, capture this data into a dot variable by the name of _data
c) Retrieve the user's Security data. Which user? The one whose User Name matches the dot variable's _data.USERNAME value.
Since the data in the Personal section are captured in a dot variable and then used in the execution of the next action (irrespective of whether the user value is hardcoded or comes from the dropdown) it should work in both cases. But it only works when the user value is hardcoded.
I'd be grateful for any solution, suggestion or tip.
Regards,
Felix
.
Hi,
I'm trying to modify at the same time a user's Personal data and Security data, using a Dialog2 component. The video showing how to proceed is D_SF_3. The video uses a Dialog2 template by the name of SecurityFramework-EditAccountForExistingUser.
I built the Dialog using the template, re-created the RegisteredUsers table together with its fields as one of my tables and have put the Dialog to test. It works as described in the video. The Dialog has two sections, one for Personal data and another for Security data. On initialize, both sections are automatically filled in with the user whose id=1 (that value is hardcoded, see just below), ready for editing.
The problem is: the user value is hardcoded. You'll find this code in Events --> Server-SIDE --> onDialogInitialize:
'---------- Simulate a user value passed to the dialog for user with a primary key of 1
dim id as c = "1"
dim id as c = "1"
For the Dialog to be of any use, it should be able to edit any user, not just one particular hardcoded user. To that effect, I added a dropdown box to the Dialog, plus a button. The dropdown box retrieves the list of users from the RegisteredUsers table and the button, when clicked, uses the Populate Controls in a Dialog Component with Data from Tables Action Javascript. Now, when I select a user from the dropdown and click the button, the fields in the Personal data section are filled in but the fields in the Security data are left blank.
In the template's OnDialogInitialize event, the sequence of actions is:
a) Receive the user value (in our case, either hardcoded or passed from the dropdown), which is the primary key field id
b) Retrieve the user's Personal data corresponding to that id from our RegisteredUsers table. Also, capture this data into a dot variable by the name of _data
c) Retrieve the user's Security data. Which user? The one whose User Name matches the dot variable's _data.USERNAME value.
Since the data in the Personal section are captured in a dot variable and then used in the execution of the next action (irrespective of whether the user value is hardcoded or comes from the dropdown) it should work in both cases. But it only works when the user value is hardcoded.
I'd be grateful for any solution, suggestion or tip.
Regards,
Felix
.
Comment