I created this really simple macro parameter whicn is a dropdownlist that read it's value from a xml file and it appears to be working. The only problem is after save the macro and load it again, the previows saved value won't appear selected.
So, everytime i load the macro to change something i have to remeber to set this parameter again. Could somebody tell me what I missed?
Public Class RssChannelPicker Inherits System.Web.UI.WebControls.DropDownList Implements IMacroGuiRendering
#Region "Properties"
Public ReadOnly Property ShowCaption As Boolean Implements umbraco.interfaces.IMacroGuiRendering.ShowCaption Get Return True End Get End Property
Public Property Value As String Implements umbraco.interfaces.IMacroGuiRendering.Value Get Return Me.SelectedValue End Get Set(ByVal value As String) Me.SelectedValue = value End Set End Property
#End Region
#Region "Events"
Private Sub RssChannelPicker_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init If Me.Items.Count = 0 Then Dim helper As New SharedFunctions helper.LoadSettings("RSSChannels.config", Me) End If End Sub
I got that. The "set property" occurs before the "Init" so, the list is still empty. I just changed it to something like:
PublicPropertyValueAsStringImplements umbraco.interfaces.IMacroGuiRendering.Value Get ReturnMe.SelectedValue EndGet Set(ByVal value AsString) helper.LoadSettings("RSSChannels.config",Me) Me.SelectedValue= value EndSet EndProperty
But i appreciate if somebody point me to an event that occurs before the property are sets, so i don't have to call "LoadSettings" on all properties.
Creating a dropdownlist macro parameter
I created this really simple macro parameter whicn is a dropdownlist that read it's value from a xml file and it appears to be working. The only problem is after save the macro and load it again, the previows saved value won't appear selected.
So, everytime i load the macro to change something i have to remeber to set this parameter again.
Could somebody tell me what I missed?
I got that.
The "set property" occurs before the "Init" so, the list is still empty.
I just changed it to something like:
But i appreciate if somebody point me to an event that occurs before the property are sets, so i don't have to call "LoadSettings" on all properties.
is working on a reply...