you may try to make a call to
NWF.FormFiller.Functions.ProcessFillerControl(....)
however, I'm not sure it'll work in your scenario, I've never tested it with forms 2016 nor with custom control.
you may find some example on this search results
https://community.nintex.com/search.jspa?q=ProcessFillerControl
I can detect via javascript in the frontend when the size of the control changes and needs more/less space, and at that point, call a javascript function. I did try the ProcessFillerControl function, but was unable to get it to work (looked at your previous answers related to it). However, I am in no way certain I am using the API correctly. Is there documentation somewhere that I can read with regards to it?
Marian Hatala - I got it to work. ProcessFillerControl works when I added a wrapper div around my content, such that there is only one child HTML element below the "nf-filler-control-inner", see screenshot below:
Then, this javascript snippet works:
$("select.auto-complete-lookupumultiple]").on("select2:select", function () {
NWF.FormFiller.Functions.ProcessFillerControl(NWF$(this).closest('.nf-filler-control'), NWF$('#formFillerDiv'));
});
Note: "this" refers to the <select> element, so ProcessFillerControl needs the outer <div> with the .nf-filler-control css class, and the entire form-control container as its second argument.
My last problem is that shrinking doesnt work, but that is a minor issue i can live without fixing.
glad to hear that,
ProcessFillerControl works when I added a wrapper div around my content
I've never (been granted enough resources) came to the need to develop my own custom control, but looking at Forms SDK that sounds to me to be expected (or mandatory?) requirement ...
https://help.nintex.com/en-US/sdks/sdk2013/#FormSDK/Topics/SDK_NF_SC001_Add_SubClasses.htm?Highlight=div
ProcessFillerControl needs the outer <div> with the .nf-filler-control css class, and the entire form-control container as its second argument.
I hope that might have been obvious from provided examples
My last problem is that shrinking doesnt work, but that is a minor issue i can live without fixing.
from my experience ProcessFillerControl works in both directions - enlarging and shrinking.
have you checked layouting model that your custom control resize correctly when selected elements are removed?
btw, you mentioned you developed your custom forms control.
I've briefly browsed through the page you've linked at the beginning. out of that it seems to me select2 is just kind of a jQuery extension, but not an (general) object model that would support custom form control development in term if .net coding.
how did you proceed then? what you mean with custom control? or correct me if I'm wrong ...
anyway, the component seems to be quite interesting, if you manage it to integrate with nintex it might be worth of short blog post
Marian Hatala skrev:
glad to hear that, Egil Hansen
ProcessFillerControl works when I added a wrapper div around my content
I've never (been granted enough resources) came to the need to develop my own custom control, but looking at Forms SDK that sounds to me to be expected (or mandatory?) requirement ...
https://help.nintex.com/en-US/sdks/sdk2013/#FormSDK/Topics/SDK_NF_SC001_Add_SubClasses.htm?Highlight=div
I actually started out following that guide you link to and created a .net based custom component.
The thing is, it is not obvious from the tutorial nor the rather lacking documentation of the NintexFormControl and NintexFormControlProperties classes, which methods one needs to overwrite, what their expected output is, what methods are optional, and again, what their use is. The same goes with the javascript API, especially if you are new to the nomenclature of Nintex Forms. So I hope @nintex will improve the documentation.
As for how I did it. I created a standard SharePoint Farm Project and added the Select2 and jQuery to the Layouts folder. Then, in the FormControl (which inherits from NintexFormControl) I add the script and css references needed and construct the HTML.
The goal is a (multi) lookup field form control that works like the People Picker, i.e. has live search/auto complete functionlity, and queries the lookup list from the client using the SharePoint REST API. It also tries its very best to work even when the lookup list has more than 5000 items / has reached the list view threshold.
To figure out how to actually get all the details right, I have been decompiling the Nintex .dlls and looking at how they have build the builtin form controls... so yeah, I would love some better documentation to work with.
Anyway, thanks for your input.
My last problem is that shrinking doesnt work, but that is a minor issue i can live without fixing.
from my experience ProcessFillerControl works in both directions - enlarging and shrinking.
have you checked layouting model that your custom control resize correctly when selected elements are removed?
The wrapper div (`div.auto-complete-lookup-wrapper`) correctly resizes down to a lower height, however, the `div.nf-filler-control-inner` keeps its height. I've tried trigger `ProcessFillerControl` in various ways, but I can never get it to shrink again, only grow. Any tips?