Hot answers tagged choice-field
7
Why do you need mappings
First things first: let me explain, why do you need to use mappings at all.
With some accuracy it can be said, that a Choice field in SharePoint represents a DropDownList control. And in the ASP.Net DropDownList control, each item (ListItem, to be precise) has two essential properties: Text and Value. Obviously, Value property acts ...
5
You can do it in InfoPath, cascading drop downs. But since you said you need to do it in jQuery, there is a very useful library, called SPServices, available to assist. Marc has created a function in the library to do cascading drop downs, which is exactly what you want.
Look over that information and see if it's helpful.
4
You could use a unicode character that does not print anything. I tried it with U+205F and it seemed to work as expected. To put this character in, open up the charmap (Start->Run->charmap) on your machine, then select a font that has unicode support (I chose calibri), scroll almost to the bottom and find the U+205F. You can then double click the ...
3
You can find details about <Mappings> in [MS-WSSCAML]: Collaborative Application Markup Language (CAML) Structure Specification V0.1
"MAPPINGS: A set of MAPPING string elements that represents a canonical, languageagnostic identifier for a corresponding CHOICE with the value specified by the
MAPPING element. The reader MUST ignore MAPPINGS if the ...
3
Looks like you're using default Update method of SPContentType when updating your content type in feature updating receiver.
To push changes to all inherited list content types, you should use another overload of the Update method, and pass true to it:
contentType.Update(true);
Description of the parameter from MSDN:
updateChildren
Type: ...
3
The only solution not involving code is:
Create the column as:
Choice
Not required
Unique
Choices: 1, 2, 3, 4 and 5 (not None)
Drop-Down Menu
Clear default value
That'll allow the users to create any number of entries without a priority, but only one for each of the 5 values.
This seems is like you want it to work. BUT once an entry has been assigned ...
3
SPFieldChoice has a property named FieldRenderingControl. Using reflector you can find this code in the FieldRedneringControl property:
....
switch (this.EditFormat)
{
case SPChoiceFormatType.Dropdown:
control = new DropDownChoiceField();
break;
case SPChoiceFormatType.RadioButtons:
control = new RadioButtonChoiceField();
...
3
Choice fields are returned with a Value without the need for expansion:
Example: IP_WorkflowStatus = IP_WorkflowStatusValue
Here is an example of a query without using expansion:
$filter=IP_WorkflowStatusValue eq '2-Validated'
If you want to use expansion, then you need to use expanded field notation Relation/Field:
$filter=IP_WorkflowStatus/Value eq ...
2
SPServices has a method for this:
The SPArrangeChoices rearranges radio buttons or checkboxes in a form from vertical to horizontal display to save page real estate.
The documentation is here: SPServices.SPArrangeChoices
2
There are a couple ways you can do this but they aren't really "out of the box" because these are your own custom rules.
Add some JavaScript to your New/Edit forms
If you are familiar with JavaScript, this is probably the easiest method since you don't need to deploy any code to the server. You can edit the forms to use jQuery or Prototype.js + ...
2
From my experience this will have to be done programmatically.
Add a new managed metadata column manually then write a console app or PowerShell to loop trhough the items/documents and match the selected value with the managed metadata equivalent. Then do a SystemUpdate(false) on the item (the false part will preventing the version from being increased)
...
2
If you must avoid creating WFs or event handlers, then another option is to use a Calculated field with bunch of new columns (AssignedOn, TimeToInProgress, etc.).
For the first duration:
time taken to change from Assigned to In Progress
The first time the user changes the status of the document to Assigned set the AssignedOn column to current date and ...
1
Attaching an event receiver to your list which dynamically populates the values in your ReleaseMonth column (as recommend by @Alex Choroshin) would be a good start, but you're probably going to run into problems when you try also display the value of the originally selected value.
This is because the values in the SPFieldChoice column are actually ...
1
You can use the GetFieldValue method of the field class if you are unsure of the actual type of the underling value.
For example:
item["MyChoiceField"] = listIstance.Fields["MyChoiceField"].GetFieldValue("Choice1");
1
maybe somthing like this?
// Get a reference to the field.
SPFieldMultiChoice choiceField = (SPFieldMultiChoice)list.Fields.GetField(fieldInternalName);
// Create a field value with all choices selected.
// (A CheckBoxChoiceField control would have all boxes checked.)
SPFieldMultiChoiceValue values = new SPFieldMultiChoiceValue();
foreach (string choice in ...
1
What you're describing sounds like a Cascading Lookup. There are several existing questions with suggestions for implementing such a thing:
How can we get Cascading Lookup Columns in sharepoint 2010?
How to implement Cascaded lookup in SP 2010?
How to make a filtered lookup field
1
There's no built-in functionality for this scenario.You have to write a custom javascript code to handle selection changes in the first dropdown and limit the selection in the second. And you need to have a full range of values (1,2,3,4,5) in the second column in order to save any entered value.
1
Short answer: No.
The only (out of the box) ways to do this are:
Lookup field
(PRO: behaves as a choice field when rendered)
(CON: only works within 1 site only)
Managed metadata, adding the value as a synonym
(PRO: works everywhere)
(CON: is type ahead, so looks different from choice field)
1
Since you don't want to perform extra requests to get the values, it means that the relationship between the two fields must be present somewhere in the form page.
The way to do this would be to store this relationship in a SharePoint list:
|Title | Choice |
| A1 | A |
| B1 | B |
etc.
Add this list as a Web Part, hidden below your form. ...
1
In the end I have followed the direction proposed by Stuart and marked this still another SharePoint blackhole, so I have left any hope of using this CAML tag as last for now.
During my research I had a look at many classes in the framework but I cannot find anything related to using the mapping "attribute", so I can only assume that it was an uncompleted ...
1
In your second screen-cast, the choices are shown as radio buttons. If the choices are look-up values, they should render as drop-down list. If I remember it correct, SharePoint does not provide option of radio buttons for look up column. Are you sure it is look-up column? Please confirm from the list settings page.
By the way, It seems the selected values ...
1
It is just for the status column? Maybe I'm completely wrong, because your screencasts are from 2007, but I saw this behaviour once, after migration from MOSS 2007 to SP 2010 and it was problem with rights.
Some documents was checked out or modified by "System account" (non existing users in the new farm or disabled in AD) and even logged with farm admin ...
1
A free downloadable plugin which uses jQuery and SPServices can be downloaded here: http://www.itidea.nl/index.php/cascading-dropdowns-with-jquery-and-spservices-on-a-page-or-webpart/
Only top voted, non community-wiki answers of a minimum length are eligible

