I have an input form for my entity called "Dependents". A user, which in this case is an "Applicant", can have one or many dependents. So i want the user to be able to enter the number of dependents they have and based on the number they have entered, the "Dependents" input form must allow the user to input the dependents that many times. For instance, if the user says they have 5 dependents then the "dependents" for must allow the user to input 5 time. How do i go about doing this?


Solution

Hi Solomon,

you can have your widgets on a screen without form  in a list and bind that list to a structure. when user enter any dependent numbers add those many structure records in that list via listappend and bind that structure list to screen list.

also at time of save just iterate over that screen or list you created and assign values from that list to dependent entity and save that.

I can create an example if you want. Please let me know if you want example.

Also please mark this post as Solution if this help to you.

Solution

Hi Abdul


Thank you for your response. Please send me an example, I would greatly appreciate it

Regards

Diemiso



Hello Diemiso Solomon,

what Abdul quadir Saifee said is a good approach, Here i am giving one more approach to achieve your requirement,

Use the Tab pattern , above the tab use the button to add the number of dependents , when you click add dependent button it will open new tab, here in the button action before moving to the next tab append the first dependent records to the list , this list you can create local. finally you use this local list records to save,

i hope this helps you,if you need more info please let me known.


I am working on it for traditional web, you can modify and use concept for other type of apps.

Hi,

I have added code sample, please check. Also please consider this is just an example for approach and you may need to modify it as per best practices. Please implement edit part where you can bind list from database to that screenlist.

Abdul quadir Saifee wrote:

Hi,

I have added code sample, please check. Also please consider this is just an example for approach and you may need to modify it as per best practices. Please implement edit part where you can bind list from database to that screenlist.

Thank you. let me have a look


Abdul quadir Saifee wrote:

Hi,

I have added code sample, please check. Also please consider this is just an example for approach and you may need to modify it as per best practices. Please implement edit part where you can bind list from database to that screenlist.

nice


Diemiso Solomon wrote:

I have an input form for my entity called "Dependents". A user, which in this case is an "Applicant", can have one or many dependents. So i want the user to be able to enter the number of dependents they have and based on the number they have entered, the "Dependents" input form must allow the user to input the dependents that many times. For instance, if the user says they have 5 dependents then the "dependents" for must allow the user to input 5 time. How do i go about doing this?


Hi Diemisio, I would suggest a different approach, I attached the oml from the OSMDB from the web Bootcamp and changed to achieve what you need, in the pic you see an input max session, that will be like your N: Dependents, and a list of Movie Session that will be similar with the dependents you have.

So here I add a logic to be possible to add as many sessions as I have in the input Max Session, and I call a popup every time I want to add new, so this way I don't need to populate the screen with as many forms I would need to the number of dependents:

This list of session would be your list of dependents


Check the oml and have a look on the page Cinema Detail

Sample here

Hope I could help you

Carlos Lessa wrote:

Diemiso Solomon wrote:

I have an input form for my entity called "Dependents". A user, which in this case is an "Applicant", can have one or many dependents. So i want the user to be able to enter the number of dependents they have and based on the number they have entered, the "Dependents" input form must allow the user to input the dependents that many times. For instance, if the user says they have 5 dependents then the "dependents" for must allow the user to input 5 time. How do i go about doing this?


Hi Diemisio, I would suggest a different approach, I attached the oml from the OSMDB from the web Bootcamp and changed to achieve what you need, in the pic you see an input max session, that will be like your N: Dependents, and a list of Movie Session that will be similar with the dependents you have.

So here I add a logic to be possible to add as many sessions as I have in the input Max Session, and I call a popup every time I want to add new, so this way I don't need to populate the screen with as many forms I would need to the number of dependents:

This list of session would be your list of dependents


Check the oml and have a look on the page Cinema Detail

Sample here

Hope I could help you

Hi Carlos

Thank you so much for this. I will try both approaches and see which one goes well with my mobile app


Diemiso Solomon wrote:

Carlos Lessa wrote:

Diemiso Solomon wrote:

I have an input form for my entity called "Dependents". A user, which in this case is an "Applicant", can have one or many dependents. So i want the user to be able to enter the number of dependents they have and based on the number they have entered, the "Dependents" input form must allow the user to input the dependents that many times. For instance, if the user says they have 5 dependents then the "dependents" for must allow the user to input 5 time. How do i go about doing this?


Hi Diemisio, I would suggest a different approach, I attached the oml from the OSMDB from the web Bootcamp and changed to achieve what you need, in the pic you see an input max session, that will be like your N: Dependents, and a list of Movie Session that will be similar with the dependents you have.

So here I add a logic to be possible to add as many sessions as I have in the input Max Session, and I call a popup every time I want to add new, so this way I don't need to populate the screen with as many forms I would need to the number of dependents:

This list of session would be your list of dependents


Check the oml and have a look on the page Cinema Detail

Sample here

Hope I could help you

Hi Carlos

Thank you so much for this. I will try both approaches and see which one goes well with my mobile app


Mobile? you said before traditional if is mobile is a little different from the solution I post before


Carlos Lessa wrote:

Diemiso Solomon wrote:

Carlos Lessa wrote:

Diemiso Solomon wrote:

I have an input form for my entity called "Dependents". A user, which in this case is an "Applicant", can have one or many dependents. So i want the user to be able to enter the number of dependents they have and based on the number they have entered, the "Dependents" input form must allow the user to input the dependents that many times. For instance, if the user says they have 5 dependents then the "dependents" for must allow the user to input 5 time. How do i go about doing this?


Hi Diemisio, I would suggest a different approach, I attached the oml from the OSMDB from the web Bootcamp and changed to achieve what you need, in the pic you see an input max session, that will be like your N: Dependents, and a list of Movie Session that will be similar with the dependents you have.

So here I add a logic to be possible to add as many sessions as I have in the input Max Session, and I call a popup every time I want to add new, so this way I don't need to populate the screen with as many forms I would need to the number of dependents:

This list of session would be your list of dependents


Check the oml and have a look on the page Cinema Detail

Sample here

Hope I could help you

Hi Carlos

Thank you so much for this. I will try both approaches and see which one goes well with my mobile app


Mobile? you said before traditional if is mobile is a little different from the solution I post before


It's ok, even the solution that Abdul provided is for web. But it will give me an idea of what to do