Question

Custom Control and For loop in Rule

  • 29 March 2023
  • 3 replies
  • 30 views

Badge +2

Hi,

 

i created a custom control with Smart Object.

i deployed and its working fine.

 

now issue is. i want to iterate that smartobject in for loop in rule as in below image. but its not showing any message on button click. (i verified the smart object attached. it has rows inside.)

 

i am using below in definition

<Category>Listing</Category>
    <Group>Documents</Group>
    <Name>MultiFile</Name>
    <DisplayName>Multi File</DisplayName>

    

    <ExecuteMethod></ExecuteMethod>
    <GetValueMethod></GetValueMethod>
    <SetValueMethod></SetValueMethod>
    <SetRulesMethod></SetRulesMethod>
    <SetItemsMethod></SetItemsMethod>
    <GetPropertyMethod></GetPropertyMethod>
    <SetPropertyMethod></SetPropertyMethod>

 

<Prop ID="DataSourceType" friendlyname="Type" type="complex" serverControlType="property" category="Data Source" InitializeServerControl="initializeAssociationPropertyConfig" ClearServerControl="clearComplexPropertyConfig" ServerControl="SourceCode.Forms.Controls.Web.PropertyConfiguration.AssociationPropertyConfig, SourceCode.Forms.Controls.Web" />
        <Prop ID="FixedListItems" friendlyname="Items" type="string" serverControlType="property" category="Data Source" ReadOnly="true" />
        <Prop ID="AssociationSO" friendlyname="SmartObject" type="string" serverControlType="smartobject" category="Data Source" ReadOnly="true" />
        <Prop ID="AssociationMethod" friendlyname="Method" type="string" serverControlType="listmethod" category="Data Source" ReadOnly="true" />
        <Prop ID="ValueProperty" friendlyname="Value" type="string" serverControlType="property" category="Data Source" ReadOnly="true" />
        <Prop ID="DisplayTemplate" friendlyname="Display" type="string" serverControlType="property" category="Data Source" ReadOnly="true" />

 

 

Please suggest if i am missing any configuration.

 

Regards,


3 replies

Badge +3

Have you configured the value for the control to be a unique value per row?

K2 gets confused in list controls if the value field assigned is not unique across all returned rows (note, all returned rows includes those rows excluded via the filter panel).

 

Hope this helps

Badge +2

Hi,

 

yes for now there are just 5 rows in the smartobject. which are unique one.

once i am calling my custom control in loop and showing message. nothing going inside the loop. thats the issue.

 

Regards,

Userlevel 2
Badge +8

@fharoon 

Are you using the data source’s property in your mapping instead of the control’s property?

Reply