Populate String to Checkbox list


Hi,

 

 

 

 

I have a string like this Activation;CNPE;Conflict of Interest;Contract/Budget; from the view

 

 

and I want to load it into the checkbox list (subview LIke a picture below), Can someone tell me how do I do that.

 

 

thanks for you help.

 

 

15975iE2DC1441EFDA31C1.png

 


10 replies

Userlevel 5
Badge +16

Hi TTN,


 


What is your data source type? are you pulling the data from SQL?

It  just a regular string concat them together with ; separation 

Userlevel 5
Badge +16

Hi,


 


I though you could use stored procedure as data source of the checkbox list to split the string for you and return it as list:


 


examples:


http://stackoverflow.com/questions/23089579/how-to-separate-split-string-with-comma-in-sql-server-stored-procedure


http://community.k2.com/t5/K2-blackpearl/Populate-drop-down-with-each-item-from-picker-control/m-p/86365#M26606

Thanks, Mustafa.

 

To get around, I did repopulate the listview with the orginal smartobject list, then I set the filter.

If I set filter Operator to "equal" and Value to CNPE then it work, it display one item for me.

Howerver if I set the fitler Operator to "contain" and value to "Activation;CNPE;Conflict of Interest;Contract/Budget;" then nothing happen.

The result I want is 4 checkboxlist display on the screen. Is there away to fitler anything like this.

 

Thanks

 

 

Userlevel 5
Badge +16

Hi,


 


 


If I understand correctly, you have those values already seperated but you want to display only 4 of them? if yes, then just modify your filter.


 


Go to the populate action and configure advanced condition in the filter tab, example:


 



 


If that doesn't help then you need to create stored procedure to retrieve the data you need.


 


 

Thanks, Mustafa for your help.

 

However, My list string is dymanic, it can be 1 item or 10 or 20 items and so on.

And also the list value can be different all the time when I popup the subview.

Is there a way I can filter by seperate by semicolon ";"

 

Thanks 

Userlevel 5
Badge +16

Hi,


 


Unfortunately it's not possible, the only way I could think of is stored procedure.


 


 

Thank again for your help.

I guess I have to build the smartobject list then store the data in it.

Userlevel 5
Badge +16
Is not an option to categorise these entries? Because I am not sure about your business requirements.

Sorry, I am new to K2. I am not sure what do you mean by "categories" control. What control is this?

Do you have any example which I can look at

 

Thanks.

Reply