In a workflow task, in custom edit form, i use CompositeField
to render relevant fields current task item and for workflow item by setting a different context for CompositeField
.
However if i put Task List item field first, it will render only task list item fields, leaving workflow item fields with some example value like ["Title" field value]
I investigated that its actually FormField
control that CompositeField
uses to display value is guilty.
Below you can see code i use to render the workflow item field and output it provides.
<SharePoint:CompositeField ID="TitleField" FieldName="Title" ControlMode="Display" runat="server" />
SPContext workflowItemContext = SPContext.GetContext(HttpContext.Current, this.WorkflowItem.ID, this.WorkflowItem.ParentList.ID, SPContext.Current.Web);
this.TitleField.ItemContext = workflowItemContext;
Note that before rendering this control, i have other CompositeField
s that render value correctly for task item. The value says something like: ["Title" field value]
But if i change ControlMode="Edit"
, it displays field value.
What's the problem and how to get CompositeField
to display correct value not some example value at in Display mode along with other CompositeField
s with different context?
Note: I use SharePoint 2007