G
Guest
Hi,
I think this is a relatively simple problem, but it's starting to annoy me
quite a bit. I have two issues with a custom Web Part that I have created,
both related to property editing at run time using an EditorZone.
One of my web parts contains a control which displays information for a
particular (default) user. The user should have the ability to select an
alternate user whose information should be displayed in the control, and so I
have defined the relevant property as follows on the custom Web Part:
[Personalizable(true), WebBrowsable(true), WebDisplayName("Scope code")]
public string ScopeCode
{
get
{
return pr_scopeCode;
}
set
{
pr_scopeCode = value;
}
}
where pr_scopeCode is a private local variable.
To give the user a nicer front end than just a box for the code, I have
written a custom EditorPart to enable the users to be displayed and selected
from a drop-down list. *Problem 1*: although the drop-down list displays
correctly at run time, the value chosen by the user is not saved back to the
page. I can post the code for the custom EditorPart if that would be of
assistance.
I also have some other properties that I wish to allow the user to modify,
including the Title of the web part (I do not wish to open up all the
properties available in the AppearanceEditorZone). To implement this I have
used the code below:
[Browsable(true), Personalizable(), WebBrowsable(),
WebDisplayName("Title")]
public override string Title
{
get
{
return base.Title;
}
set
{
base.Title = value;
}
}
*Problem 2*: this, and the many other properties that I have marked as
'WebBrowsable' are not displayed in the EditorZone at run time at all.
Please can anyone suggest why these WebBrowsable properties would not be
available for editing at run time, and/or why changes in the custom
EditorPart are not saved back as personalised data? If I use the
AppearanceEditorZone or other pre-defined EditorZones, changes may be made
and saved back against the user successfully.
Thanks,
Marc
I think this is a relatively simple problem, but it's starting to annoy me
quite a bit. I have two issues with a custom Web Part that I have created,
both related to property editing at run time using an EditorZone.
One of my web parts contains a control which displays information for a
particular (default) user. The user should have the ability to select an
alternate user whose information should be displayed in the control, and so I
have defined the relevant property as follows on the custom Web Part:
[Personalizable(true), WebBrowsable(true), WebDisplayName("Scope code")]
public string ScopeCode
{
get
{
return pr_scopeCode;
}
set
{
pr_scopeCode = value;
}
}
where pr_scopeCode is a private local variable.
To give the user a nicer front end than just a box for the code, I have
written a custom EditorPart to enable the users to be displayed and selected
from a drop-down list. *Problem 1*: although the drop-down list displays
correctly at run time, the value chosen by the user is not saved back to the
page. I can post the code for the custom EditorPart if that would be of
assistance.
I also have some other properties that I wish to allow the user to modify,
including the Title of the web part (I do not wish to open up all the
properties available in the AppearanceEditorZone). To implement this I have
used the code below:
[Browsable(true), Personalizable(), WebBrowsable(),
WebDisplayName("Title")]
public override string Title
{
get
{
return base.Title;
}
set
{
base.Title = value;
}
}
*Problem 2*: this, and the many other properties that I have marked as
'WebBrowsable' are not displayed in the EditorZone at run time at all.
Please can anyone suggest why these WebBrowsable properties would not be
available for editing at run time, and/or why changes in the custom
EditorPart are not saved back as personalised data? If I use the
AppearanceEditorZone or other pre-defined EditorZones, changes may be made
and saved back against the user successfully.
Thanks,
Marc