Hi,
I am looking for some direction on how to accomplish the following task:
I have a web dialog component, which has variables to be posted to a master table and several detail tables. The master table contains property addresses and pointers to child tables of Owner, Management company, and Tenant. So my master table would contain a field for TenantID which is set to the id of the tenant record (but would be null if there is no tenant). Same for Management Company (MgtCoID if there is a mgt company, null if there is not). Every property address would have an OwnerID.
I would like the dialog to be able to allow the user, when entering a new address, to choose whether or not to add a tenant, and whether or not to add a management company by using radio buttons and selectively showing or hiding the appropriate fields.
As it works now, every submit always submits the new address, a new owner (which is what I want), and a new tenant and a new management company (which is NOT what I want, as they are NULL when nothing is entered). Instead I want to, based on the selection of a radio button, skip posting a management company and/or tenant record if the corresponding radio button has a value of "NO".
I know that somehow I am going to have to customize the aftervalidate server side event to check for the value of the radio button, and then somehow include or exclude the INSERT query for the corresponding table. For example, if the value of the radio button which asks "Add Management Company" is NO, then I do not want to submit any of those fields. If it is YES however, then I do want to submit those fields.
I have been trying to find any resource which would demonstrate a way to do this, but am coming up empty.
Do any of you have any suggestions as to how this could be accomplished, or can point me to a video or some discussion of how to do this?
Thanks for any help you may be able to offer.
I am looking for some direction on how to accomplish the following task:
I have a web dialog component, which has variables to be posted to a master table and several detail tables. The master table contains property addresses and pointers to child tables of Owner, Management company, and Tenant. So my master table would contain a field for TenantID which is set to the id of the tenant record (but would be null if there is no tenant). Same for Management Company (MgtCoID if there is a mgt company, null if there is not). Every property address would have an OwnerID.
I would like the dialog to be able to allow the user, when entering a new address, to choose whether or not to add a tenant, and whether or not to add a management company by using radio buttons and selectively showing or hiding the appropriate fields.
As it works now, every submit always submits the new address, a new owner (which is what I want), and a new tenant and a new management company (which is NOT what I want, as they are NULL when nothing is entered). Instead I want to, based on the selection of a radio button, skip posting a management company and/or tenant record if the corresponding radio button has a value of "NO".
I know that somehow I am going to have to customize the aftervalidate server side event to check for the value of the radio button, and then somehow include or exclude the INSERT query for the corresponding table. For example, if the value of the radio button which asks "Add Management Company" is NO, then I do not want to submit any of those fields. If it is YES however, then I do want to submit those fields.
I have been trying to find any resource which would demonstrate a way to do this, but am coming up empty.
Do any of you have any suggestions as to how this could be accomplished, or can point me to a video or some discussion of how to do this?
Thanks for any help you may be able to offer.
Comment