Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Admin
Admin
Posts : 122
Join date : 2018-12-17
https://mattersphere-devs.forumotion.com

Embedded Searchlist Parameters Empty Embedded Searchlist Parameters

Tue 28 Jan 2020 - 9:36
I have a search list control which requires a "assocType" parameter. The control is on a Wizard and the parameter is passed to the wizard via task flow in a KVC and accessed like so...
Code:

Enquiry.ReplacementParameters["assocType"].Value.ToString();
I have accessed the SearchList control in the wizard like this...
Code:

FWBS.OMS.UI.Windows.ucSearchControl s = EnquiryForm.GetControl("schAssociate") as FWBS.OMS.UI.Windows.ucSearchControl;
and I can 'refresh' the search list like this...
Code:

s.Search();
How do I pass the "assocType" paramater from the KVC into the searchlist. I've noticed that the search list control has a SetParameters method that takes in a KVC, so I've written the following on the Rendering Event of the Wizard
Code:

FWBS.Common.KeyValueCollection _kvc = new FWBS.Common.KeyValueCollection();
string assocType = Enquiry.ReplacementParameters["assocType"].Value.ToString();
_kvc.Add("@assocType", assocType);
FWBS.OMS.UI.Windows.ucSearchControl s = EnquiryForm.GetControl("schAssociate") as FWBS.OMS.UI.Windows.ucSearchControl;s.SetParameters(_kvc);
s.Search();
But when I call the wizard I get an Object Reference error on
Code:
s.SetParameters(_kvc);

It may be that the parameters have been setup incorrectly in the Search list. As well as AssocID the search list also needs FileID - BoundValue is
Code:
%fileID%
. How should @AssocType be bound?What steps do I need to take to get this to work?
many thanks
________________________________________________________________________________________________________________________________________
Hi Mike, Not sure where the ORNS is coming from can you test that s is not null. I've previously done something similar I would set the search list parameters to be the Enquiries replacement parameters though.
Code:

s.SetParameters( Enquiry.ReplacementParameters)
Regards Richard.
________________________________________________________________________________________________________________________________________
that was the problem, it was null at times during the rendering, I've wrapped it up in an if (s != null) and the search lists populates after rendering.
thanks for your help
Back to top
Permissions in this forum:
You cannot reply to topics in this forum