View Full Version : Repeating Section dropdowns after 'Refresh Controls' call


11-18-2014, 12:18 PM
I have repeating sections that link users to a visit. I have a link that says 'Add New User'. When clicking this link a popup comes up and I add new users.

I use the following code to refresh the dropdown in the repeating section:

This works fine, however, when clicking Add New Row in the repeating section - the dropdowns do not have my new user.
Is there a way to tell Alpha that when refreshing the control it should store this list as the new list when Adding New rows?

Any help is appreciated

11-19-2014, 08:43 AM
I do not where you are using that code, however would you mind testing the same
in the dduser control onFocus event and see if it works.

secondly, is this a desktop question? it is in desktop section.

11-19-2014, 09:54 AM
Hi Ggandhi,
It is technically a web quesiton, I must have put it in the wrong section.

Using on focus might be a good bandaid fix but will introduce a number of redudant ajax callbacks. I suppose with the caching it may not be so bad and it is better than it not working.
I was using the refreshDropdownBoxChoices call on the OnHide event of the dialog window that actually adds users.
So when the popup window is closed - the choices get refreshed. This works for existing dropdowns but when I add new records, it uses a cached list.

Thanks for your input

11-19-2014, 06:57 PM
I had similar situation where I had one button to add the name to list another to refresh the dropdown, now you made me think
and now I am testing new method, so far so good.
when you click on the link to add the new user you are using the dialog right? when you save the dialog on the afterDialogValidate event the variable that is exposed can be used to refresh the list.

here is the code I used and seems to work.

if rtc.flagRecordWasSaved = .t. then

e.javascript = e.javascript+ crlf()+"var po = {dialog.object}.getParentObject();"
e.javascript = e.javascript + "if (po) {po.refreshDropdownBoxChoices('NAME');}"

end if

edit: added if (po)
in your case change to DDUSER

11-20-2014, 09:47 AM
Hi Ggandhi,
I have similar code, but does the following work with your example:

Click the Add New User button
Add a User
Names refresh - Okay
What happens if you click the 'Add New Row' in the repeat section? Does the NEW dropdown contain your new entry?

Would appreciate it if you let me know

Thanks very much for your time

11-20-2014, 10:00 AM


this is two part series, one showing in real life I did not add data not to mess up my database,
the second one mock up shows what is happening.
hope this is what you are looking for..

11-20-2014, 10:12 AM
Hi Ggandhi,
Thank you for making the screencasts.
I took a look at them but here is the issue I have:

1) Click the Add Vendor
2) Add 'peacock'
3) Peacock will show in any dropdowns
4) Add New Row to the repeating section
5) Without doing anything else, see if 'peacock' exists in the New Row

In our tests over here, the newly added row does not contain the refreshed list.
Can you see if this bug happens in your version as well?

Someone had suggested I move the refresh code to onFocus of the dropdown, but this might introduce a lot of redundant ajax calls.
Just trying to see if there is a better solution.

Thank you for your time / patience / assistance

11-20-2014, 10:19 AM
did i not show with mozart? the next one?

11-20-2014, 10:20 AM
i just added new row and all of the newly added items exist

11-20-2014, 10:23 AM

11-20-2014, 10:35 AM
Hi GGandhi your last example is correct (the one with belafonte) - and everything seems to work in your system.
What Alpha Version are you using (V11? V12?) and Build#?
Maybe this is specific to Alpha Version V12.2 Build 1826.

Thank you for taking time out of your day.

11-20-2014, 10:36 AM
look down to my signature

11-20-2014, 10:46 AM
Gotcha - Wasn't sure if that was the only version you used.
Maybe this is something related to the specific version Im using.

Thank you for all your help.