Choice Fields

  • 2 October 2012
  • 9 replies
  • 1 view

Badge +2

I have a SharePoint list which contains some choice fields.
In my smartform I want a dropdownbox, or radiobutton list control that contains does values.


 


 


9 replies

Badge +9


1st step would be to create a SmartObject from
that list


-         
In SharePoint click Site Action > K2 Site
Settings


-         
Under the SmartObject Management section click
K2 Smartobjects Site List and Libraries


-         
Select the List or Document library and click
Create


Back in K2 Designer (smartforms) create or edit an existing View:


-         
From the controls pane add a dropdown control


-         
Under properties you will find a Data Source
section, from there you can specify the SmartObject under Type


Let me know if you have questions


Badge +2

Hello Renier,


 


What you are saying is true.
BUT I don't get the different choice fields, I get the selected value of the SmartObject.
For the moment we use different list for it.

Badge +5

If I follow, you need to create two smartobjects.  One for each sharepoint list.  Then in smart forms, create the main form, change one of the text fields into the Drop Down list.  Use the other smart object as the data source for your drop down list.


The choices you have in a sharepoint choice colum do not pass into smart forms.  You have to essentially re-create the same choices.  When the smart object is created, it is just a text field.


 

Badge +4

Hi Sebastian,


I would create a new list on your SharePoint site with one text column. Add a new item for each choice you want in your drop-down box. Make this list a SmartObject.


In your original SharePoint list, change your "Choice" column to a "Lookup" column. Point it to this new list for your choices (so it works as usual).


In SmartForms, point your drop-down list to the SmartObject you just created. 


Now you have one place to maintain all of your choices for both applications, one SmartObject.


HTH,


Tyler


 

Badge +2

Tyler,


 


I'm not going to create 5 additional lists in my SharePoint, create 5 SmartObjects and so on and so on...


Atlhough it's an approche that will work nevertheless not the way to go in my point of view 

Badge +5

When you hit the ... for "Type" under Data list (on Drop Down list):


Above "Use a Smart Object as data source" is "Use a static list of values in the control".  You can pick that and hard code the values in just like SharePoint.  Is that what you are looking for?


If not, perhaps a bit more description of what you are trying to achieve?

Badge +4

Hi Sebastian,


I wasn't suggesting creating 5 new lists or smartobjects. Perhaps I misunderstood your problem statement.


- What I believe you said is you have one list (List A) in SharePoint with one dropdown list column. This column contains a series of options (based on the fact that you said 5, i'll assume there are 5 options).


Here's what I'm suggesting:


- Create ONE new list (List B)


- Add 5 new list items to this new list (one item for each of the 5 options above)


- Make this ONE list a SmartObject


- Now, in List A, change the original "Choice" type column to a "Lookup" type column pointing at List B for the options


- In SmartForms, set the datasource for your dropdown list to the one new smartobject created against List B.


Now you have ONE new list, ONE new SmartObject. Your SharePoint list and SmartForm share the same dropdown options and you can maintain/change these options in one place.


There is no way to read in the existing Choice options from List A into SmartForms. This is the reason Wilner is suggesting hard coding the values into SmartForms, which would also work but would leave you updating the same options in two different places.


HTH,


Tyler

Badge +1

You got to be kidding right, we have to make seperate list to store drop down control values? I have version 4.6.8 dont we have GetFieldMetadata method to retrive values inside the list values?

Badge +7

I think I may understand what you are asking. I hope so.

When you create your SharePoint list you create columns that are type choice and they have X number of values. Do this exactly like you would in SharePoint. Then create your K2 objects. If you create SmartObjects, forms and views you will get the views and forms created with the drop down lists already on the form just like the SharePoint form. You can edit from here.

You do not need to create additional SharePoint lists for your columns but be aware that be default in central admin there is a setting to limit the number of lookup columns so if you have a lot you will need to change this.

If you just create smart objects for your list you will see that it automatically created a smart object for every choice column in the list as well as one for attachments on the list. You can manually create a view from the list SmartObject and when you run the wizard or drag the field to a view it usually will automatically be a drop down box but if not change it to a drop down box and set the data source to the SmartObject that was automatically created for the column

 

I hope this helps.

 

Reply