Skip to main content
Formatting and wording improved.
Source Link
Dmytro Shevchenko
  • 12.6k
  • 2
  • 45
  • 90

I suggest you use a SearchDataSourceSearchDataSource and then bind it to your ListControlListControl. Check

Check this post for binding example: https://visionsincode.wordpress.com/2016/10/17/put-json-data-in-your-searchdatasource-and-bind-it-to-searchabledroplist-sitecore-speak/

Now, in your code, if you do this (jsondata.Communications needs to be an array):

 providerHelper.getData(this.AdditionalInfoDataProvider,
            this.AdditionalInfoDataProvider,
    $.proxy(function (jsondata) {
                    cintelUtil.setText($that.CompanyValue, renderUrl(jsondata.Company, jsondata.CompanyUrl), true); /* working correctly */
                    cintelUtil.setText($that.IndustryValue, jsondata.Industry, true); /* working correctly */
                    cintelUtil.setText($that.SubIndustryValue, jsondata.SubIndustry, true); /* working correctly */
                    cintelUtil.setText($that.RevenueRangeValue, jsondata.RevenueRange, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownExecutiveValue, jsondata.IsKnownExecutive, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownCustomerValue, jsondata.IsKnownCustomer, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownBlogUserValue, jsondata.IsKnownBlogUser, true); /* working correctly */
                    cintelUtil.setText($that.OptInValue, jsondata.OptIn, true); /* working correctly */

                    $that.YourSearchDataSource.set('items', jsondata.Communications);
                  
                    providerHelper.initProvider(this.AdditionalInfoCommunicationDataProvider, "", url, this.AdditionalInfoCommunicationMessageBar);
                    

                }));

Since this is SPEAK version 1  (using set) I think you should do like this:

SPEAK2 is so much cleaner, then it it would beso you can use this:

$that.YourSearchDataSource.Items = jsondata.CommunicationsCommunications;

You will also need to create columndefinitionscolumn definitions for the list control,control; here is an example from the LatestVisitorsLatestVisitors list on the Dashboarddashboard in the Experience Profile:   

LatestVisitors list

Then you you will need to create a ColumnfieldColumnfield for each column:
Sent, ContactType, and Message

Don't forget to enter the jsonJSON field name  (from the jsonJSON array) in the DataFieldDataField on the Columnfield Columnfield:

Columnfield

Finally, go to your layout and select your list control to get its properties. Locate the DataSourceDataSource attribute and point it to your new ColumndefinitionsColumnDefinitions item  :

Speak layout

I suggest you use a SearchDataSource and then bind it to your ListControl. Check this post for binding example: https://visionsincode.wordpress.com/2016/10/17/put-json-data-in-your-searchdatasource-and-bind-it-to-searchabledroplist-sitecore-speak/

Now in your code if you do this (jsondata.Communications needs to be an array):

 providerHelper.getData(this.AdditionalInfoDataProvider,
                $.proxy(function (jsondata) {
                    cintelUtil.setText($that.CompanyValue, renderUrl(jsondata.Company, jsondata.CompanyUrl), true); /* working correctly */
                    cintelUtil.setText($that.IndustryValue, jsondata.Industry, true); /* working correctly */
                    cintelUtil.setText($that.SubIndustryValue, jsondata.SubIndustry, true); /* working correctly */
                    cintelUtil.setText($that.RevenueRangeValue, jsondata.RevenueRange, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownExecutiveValue, jsondata.IsKnownExecutive, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownCustomerValue, jsondata.IsKnownCustomer, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownBlogUserValue, jsondata.IsKnownBlogUser, true); /* working correctly */
                    cintelUtil.setText($that.OptInValue, jsondata.OptIn, true); /* working correctly */

                    $that.YourSearchDataSource.set('items', jsondata.Communications);
                  
                    providerHelper.initProvider(this.AdditionalInfoCommunicationDataProvider, "", url, this.AdditionalInfoCommunicationMessageBar);
                    

                }));

Since this is SPEAK version 1(using set) I think you do like this:

SPEAK2 is so much cleaner, then it it would be:

$that.YourSearchDataSource.Items = jsondata.Communications

You will also need to create columndefinitions for the list control, here is an example from the LatestVisitors list on the Dashboard in the Experience Profile:  LatestVisitors list

Then you you will need to create a Columnfield for each column:
Sent, ContactType, and Message

Don't forget to enter the json field name(from the json array) in the DataField on the Columnfield Columnfield

Finally go to your layout and select your list control to get its properties. Locate the DataSource attribute and point it to your new Columndefinitions item  Speak layout

I suggest you use a SearchDataSource and then bind it to your ListControl.

Check this post for binding example: https://visionsincode.wordpress.com/2016/10/17/put-json-data-in-your-searchdatasource-and-bind-it-to-searchabledroplist-sitecore-speak/

Now, in your code, if you do this (jsondata.Communications needs to be an array):

providerHelper.getData(
    this.AdditionalInfoDataProvider,
    $.proxy(function (jsondata) {
        cintelUtil.setText($that.CompanyValue, renderUrl(jsondata.Company, jsondata.CompanyUrl), true); /* working correctly */
        cintelUtil.setText($that.IndustryValue, jsondata.Industry, true); /* working correctly */
        cintelUtil.setText($that.SubIndustryValue, jsondata.SubIndustry, true); /* working correctly */
        cintelUtil.setText($that.RevenueRangeValue, jsondata.RevenueRange, true); /* working correctly */
        cintelUtil.setText($that.IsKnownExecutiveValue, jsondata.IsKnownExecutive, true); /* working correctly */
        cintelUtil.setText($that.IsKnownCustomerValue, jsondata.IsKnownCustomer, true); /* working correctly */
        cintelUtil.setText($that.IsKnownBlogUserValue, jsondata.IsKnownBlogUser, true); /* working correctly */
        cintelUtil.setText($that.OptInValue, jsondata.OptIn, true); /* working correctly */

        $that.YourSearchDataSource.set('items', jsondata.Communications);

        providerHelper.initProvider(this.AdditionalInfoCommunicationDataProvider, "", url, this.AdditionalInfoCommunicationMessageBar);
    }));

Since this is SPEAK version 1  (using set) I think you should do this:

SPEAK2 is so much cleaner, so you can use this:

$that.YourSearchDataSource.Items = jsondata.Communications;

You will also need to create column definitions for the list control; here is an example from the LatestVisitors list on the dashboard in the Experience Profile: 

LatestVisitors list

Then you will need to create a Columnfield for each column:
Sent, ContactType, and Message

Don't forget to enter the JSON field name  (from the JSON array) in the DataField on the Columnfield:

Columnfield

Finally, go to your layout and select your list control to get its properties. Locate the DataSource attribute and point it to your new ColumnDefinitions item:

Speak layout

Now in your code if you do this  (jsondata.Communicationsjsondata.Communications needs to be an array):

 providerHelper.getData(this.AdditionalInfoDataProvider,
                $.proxy(function (jsondata) {
                    cintelUtil.setText($that.CompanyValue, renderUrl(jsondata.Company, jsondata.CompanyUrl), true); /* working correctly */
                    cintelUtil.setText($that.IndustryValue, jsondata.Industry, true); /* working correctly */
                    cintelUtil.setText($that.SubIndustryValue, jsondata.SubIndustry, true); /* working correctly */
                    cintelUtil.setText($that.RevenueRangeValue, jsondata.RevenueRange, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownExecutiveValue, jsondata.IsKnownExecutive, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownCustomerValue, jsondata.IsKnownCustomer, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownBlogUserValue, jsondata.IsKnownBlogUser, true); /* working correctly */
                    cintelUtil.setText($that.OptInValue, jsondata.OptIn, true); /* working correctly */

                    $that.YourSearchDataSource.set('items', jsondata.Communications);
                  
                    providerHelper.initProvider(this.AdditionalInfoCommunicationDataProvider, "", url, this.AdditionalInfoCommunicationMessageBar);
                    

                }));
 providerHelper.getData(this.AdditionalInfoDataProvider,
                $.proxy(function (jsondata) {
                    cintelUtil.setText($that.CompanyValue, renderUrl(jsondata.Company, jsondata.CompanyUrl), true); /* working correctly */
                    cintelUtil.setText($that.IndustryValue, jsondata.Industry, true); /* working correctly */
                    cintelUtil.setText($that.SubIndustryValue, jsondata.SubIndustry, true); /* working correctly */
                    cintelUtil.setText($that.RevenueRangeValue, jsondata.RevenueRange, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownExecutiveValue, jsondata.IsKnownExecutive, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownCustomerValue, jsondata.IsKnownCustomer, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownBlogUserValue, jsondata.IsKnownBlogUser, true); /* working correctly */
                    cintelUtil.setText($that.OptInValue, jsondata.OptIn, true); /* working correctly */

                    $that.YourSearchDataSource.set('items', jsondata.Communications);
                  
                    providerHelper.initProvider(this.AdditionalInfoCommunicationDataProvider, "", url, this.AdditionalInfoCommunicationMessageBar);
                    

                }));

$that.YourSearchDataSource.set('items', jsondata.Communications);

$that.YourSearchDataSource.set('items', jsondata.Communications);

$that.YourSearchDataSource.Items = jsondata.Communications

$that.YourSearchDataSource.Items = jsondata.Communications

Now in your code if you do this(jsondata.Communications needs to be an array):

 providerHelper.getData(this.AdditionalInfoDataProvider,
                $.proxy(function (jsondata) {
                    cintelUtil.setText($that.CompanyValue, renderUrl(jsondata.Company, jsondata.CompanyUrl), true); /* working correctly */
                    cintelUtil.setText($that.IndustryValue, jsondata.Industry, true); /* working correctly */
                    cintelUtil.setText($that.SubIndustryValue, jsondata.SubIndustry, true); /* working correctly */
                    cintelUtil.setText($that.RevenueRangeValue, jsondata.RevenueRange, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownExecutiveValue, jsondata.IsKnownExecutive, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownCustomerValue, jsondata.IsKnownCustomer, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownBlogUserValue, jsondata.IsKnownBlogUser, true); /* working correctly */
                    cintelUtil.setText($that.OptInValue, jsondata.OptIn, true); /* working correctly */

                    $that.YourSearchDataSource.set('items', jsondata.Communications);
                  
                    providerHelper.initProvider(this.AdditionalInfoCommunicationDataProvider, "", url, this.AdditionalInfoCommunicationMessageBar);
                    

                }));

$that.YourSearchDataSource.set('items', jsondata.Communications);

$that.YourSearchDataSource.Items = jsondata.Communications

Now in your code if you do this  (jsondata.Communications needs to be an array):

 providerHelper.getData(this.AdditionalInfoDataProvider,
                $.proxy(function (jsondata) {
                    cintelUtil.setText($that.CompanyValue, renderUrl(jsondata.Company, jsondata.CompanyUrl), true); /* working correctly */
                    cintelUtil.setText($that.IndustryValue, jsondata.Industry, true); /* working correctly */
                    cintelUtil.setText($that.SubIndustryValue, jsondata.SubIndustry, true); /* working correctly */
                    cintelUtil.setText($that.RevenueRangeValue, jsondata.RevenueRange, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownExecutiveValue, jsondata.IsKnownExecutive, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownCustomerValue, jsondata.IsKnownCustomer, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownBlogUserValue, jsondata.IsKnownBlogUser, true); /* working correctly */
                    cintelUtil.setText($that.OptInValue, jsondata.OptIn, true); /* working correctly */

                    $that.YourSearchDataSource.set('items', jsondata.Communications);
                  
                    providerHelper.initProvider(this.AdditionalInfoCommunicationDataProvider, "", url, this.AdditionalInfoCommunicationMessageBar);
                    

                }));
$that.YourSearchDataSource.set('items', jsondata.Communications);
$that.YourSearchDataSource.Items = jsondata.Communications
Bounty Ended with 100 reputation awarded by eat-sleep-code
Source Link
gorhal
  • 318
  • 2
  • 7

I suggest you use a SearchDataSource and then bind it to your ListControl. Check this post for binding example: https://visionsincode.wordpress.com/2016/10/17/put-json-data-in-your-searchdatasource-and-bind-it-to-searchabledroplist-sitecore-speak/

Now in your code if you do this(jsondata.Communications needs to be an array):

 providerHelper.getData(this.AdditionalInfoDataProvider,
                $.proxy(function (jsondata) {
                    cintelUtil.setText($that.CompanyValue, renderUrl(jsondata.Company, jsondata.CompanyUrl), true); /* working correctly */
                    cintelUtil.setText($that.IndustryValue, jsondata.Industry, true); /* working correctly */
                    cintelUtil.setText($that.SubIndustryValue, jsondata.SubIndustry, true); /* working correctly */
                    cintelUtil.setText($that.RevenueRangeValue, jsondata.RevenueRange, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownExecutiveValue, jsondata.IsKnownExecutive, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownCustomerValue, jsondata.IsKnownCustomer, true); /* working correctly */
                    cintelUtil.setText($that.IsKnownBlogUserValue, jsondata.IsKnownBlogUser, true); /* working correctly */
                    cintelUtil.setText($that.OptInValue, jsondata.OptIn, true); /* working correctly */

                    $that.YourSearchDataSource.set('items', jsondata.Communications);
                  
                    providerHelper.initProvider(this.AdditionalInfoCommunicationDataProvider, "", url, this.AdditionalInfoCommunicationMessageBar);
                    

                }));

Since this is SPEAK version 1(using set) I think you do like this:

$that.YourSearchDataSource.set('items', jsondata.Communications);

SPEAK2 is so much cleaner, then it it would be:

$that.YourSearchDataSource.Items = jsondata.Communications

You will also need to create columndefinitions for the list control, here is an example from the LatestVisitors list on the Dashboard in the Experience Profile: LatestVisitors list

Then you you will need to create a Columnfield for each column:
Sent, ContactType, and Message

Don't forget to enter the json field name(from the json array) in the DataField on the Columnfield Columnfield

Finally go to your layout and select your list control to get its properties. Locate the DataSource attribute and point it to your new Columndefinitions item Speak layout

That should be it, I hope it will help you :-)