Feb 14, 2014, 12:36 AM
[CLOSED] TagField Code Behind setValue
In the last couple of weeks something has changed in the SVN with the TagField.
Store used to populate the TagField
After updating to the latest version: 5666, the SetValue no longer works. I have the following with not success:
Attempt 1:
Attemp 2:
Thank you for your assistance.
Russ
Store used to populate the TagField
@(
X.Store()
.ID("storeDocumentType")
.AutoLoad(false)
.AutoDataBind(true)
.DataSource(Model)
.Model(
X.Model()
.ID("modelDocumentType")
.Fields(
X.ModelField().Name("Text").Type(ModelFieldType.String),
X.ModelField().Name("Value").Type(ModelFieldType.String)
)
)
)
Tag Field definition within a FieldSetX.FieldSet()
.Items(
.X.TagField().Flex(1).ID("displayRecordDocType").FieldLabel("Doc Type").LabelWidth(70).MultiSelect(true).QueryMode(DataLoadMode.Local)
.HideTrigger(false).HideSelected(true).Editable(false).TypeAhead(false).StoreID("storeDocumentType").DisplayField("Text").ValueField("Value").GrowMax(100).TagLabelConfig(new TagLabel() { TagsDelimeter = "|", Stacked = true}).Delimiter("|").EmptyText("Select all document types").Listeners(l => { l.Change.Handler = "App.fieldsetBulkSelect.doLayout();"; })
)
Originally I had set the following to populate the in code behind the value for the field:TagField tf = this.GetCmp<TagField>("displayRecordDocType");
tf.Clear();
tf.SetValue(doc.bulkDocTypes);
Where doc.bulkDoctypes = "Comment|Charts|Solutions"After updating to the latest version: 5666, the SetValue no longer works. I have the following with not success:
Attempt 1:
tf.Value = doc.bulkDocTypes;
<-- Does not populate the Tags propertyAttemp 2:
List<Tag> doctypes = pages.GroupBy(g => new { g.documenttype }).OrderBy(o => o.Key.documenttype).Select(s => new Tag() { Text = s.Key.documenttype, Value = s.Key.documenttype }).ToList();
tf.Tags.AddRange(doctypes); <-- Does not populate the Tags property
Attemp 3:List<Tag> doctypes = pages.GroupBy(g => new { g.documenttype }).OrderBy(o => o.Key.documenttype).Select(s => new Tag() { Text = s.Key.documenttype, Value = s.Key.documenttype }).ToList();
foreach (Tag t in doctypes)
tf.Tags.Add(t); <-- Does not populate the Tags property
What should I be doing to set the Tags value in code behind. I also attempted to remove the store and set the Items property, with no success.Thank you for your assistance.
Russ
Last edited by Daniil; Feb 17, 2014 at 2:58 AM.
Reason: [CLOSED]