mrackley / StratusForms

Lightweight InfoPath alternative for SharePoint 2007,2010,2013,2016,2019 and Office 365
82 stars 36 forks source link

StratusFormsLoadChildDDL, loading the non-selected form values after save #34

Open davidcfk opened 6 years ago

davidcfk commented 6 years ago

After saving the form, when returning back to the form it doesn't load the child DDL values that are non-selected, only the selected one...

Resolved only when changing the parent list back and forth (this reloads the select, but then you lose the selected option).

btroop202 commented 6 years ago

I too am having the same issue, it seems you will need to have a promise function as it needs to wait for the page to completely load. I have not had time to dig more into it to be sure.... but from the inital testing that was what I was seeing

davidcfk commented 6 years ago

I was thinking maybe somewhere in the completefunc of the loadForm we could trigger the ChildDDL code... but by the time that swung by, the trigger wasn't even loaded yet... sighs

Maybe I might just try and incorporate the logic into the existing DDL definition instead... surely the difference is just a query.

btroop202 commented 6 years ago

I tried the same thing, had to drop that (date time issues), will take a fresh look at it later. But if someone finds a solution please share.

davidcfk commented 6 years ago

Ta. Well, I managed to hack my way into it. Turns out there were a few more things wrong along the way, the way it generally conducts the lookup initially doesn't cater for Child lookups (like SP does using SPServices), so that condition needed to be added.

Once that condition was added in the PopulateFormData, I found that when you mimicked the stuff using the standard DDL, the function that is in the SPServices actually doesn't pass the element back for it to finish the part where it has to select the selected entries (curVal).

My current code version fixes this ... but I've fixed so many other things along the way (like option dropdowns that use the text rather than the ID doesn't seem to make sense for me) that I cannot isolate it back to a single commit per issue anymore 👎

I'll update it to my fork, but erh Mark, probably wouldn't bother with the pull-request for now ;)

btroop202 commented 6 years ago

I have also test and found you will need to a dda promise into the code, because the dropdown list do not fully load in time. I have not gotten time to add that yet, if someone does please share.

btroop202 commented 5 years ago

Is there any update on this?