sarah310
Programmer
- May 31, 2007
- 1
Hi guys,
I used the UserField-Control in my webpart. If I create a new listitem, the userfield-value gets saved into the SPList. But there's a Problem, when there is a listitem: the control is shown on screen with the right value, but on updating the Control the value gets null (even in the SPList) and after clicking the check-name-button the screenshot appears (picture here
Create-Code:
Update-Code:
Is there anybody out there who knows how to save the Edit-Value?
I used the UserField-Control in my webpart. If I create a new listitem, the userfield-value gets saved into the SPList. But there's a Problem, when there is a listitem: the control is shown on screen with the right value, but on updating the Control the value gets null (even in the SPList) and after clicking the check-name-button the screenshot appears (picture here
Create-Code:
Code:
UserField bf = new UserField();
bf.ID = bf;
bf.ListId = //is set
bf.FieldName = //is set
if (/*listItem is != null*/)
{ bf.ControlMode = SPControlMode.Edit;
bf.ItemId = //is set}
else
{ bf.ControlMode = SPControlMode.New;}
Update-Code:
Code:
UserField bf = (UserField)editTable.FindControl("bf");
if ((bf != null))
{ listItem[user.Id] = bf.Value;}
Is there anybody out there who knows how to save the Edit-Value?