Aug 04, 2011, 5:48 PM
[CLOSED] Add DirectEvent Params to Button Click during another DirectEvent.
Hi,
I'm building a form dynamically during a direct event. that part works great.
But I'd also like to pass back the as parameters each textbox id to the DirectEvent.Click of a button that is on the form already (ie, not dynamically created)
I'm using : this.btnSave.DirectEvents.Click.ExtraParams.Add(pa ra);
However, when I click the button, my params aren't there...I'm I adding these the wrong way?
I'm building a form dynamically during a direct event. that part works great.
But I'd also like to pass back the as parameters each textbox id to the DirectEvent.Click of a button that is on the form already (ie, not dynamically created)
I'm using : this.btnSave.DirectEvents.Click.ExtraParams.Add(pa ra);
However, when I click the button, my params aren't there...I'm I adding these the wrong way?
[DirectMethod]
public void InitializeSettingsWindow(string componentId, string userPortletId)
{
var fieldSet = new FieldSet
{
Title = "Portlet Parameters"
};
var form = new FormPanel
{
ID = "FormTaskPanel1",
RenderFormElement = false,
Border = false,
AutoHeight = true,
AutoScroll = true,
LabelWidth = 150,
LabelAlign = LabelAlign.Right,
Padding = 0
};
form.Items.Add(fieldSet);
//pass along userPortletID as a DirectEvent Param
Ext.Net.Parameter para = new Ext.Net.Parameter()
{
Name ="userPortletId",
Value = userPortletId,
Mode = ParameterMode.Value
};
this.btnSave.DirectEvents.Click.ExtraParams.Add(para);
try
{
UserPortletData portlet = PortletManager.GetUserPortlet(Guid.Parse(userPortletId));
if ( portlet.Params.Count > 0 )
{
foreach ( UserPortletParam param in portlet.Params )
{
//create text box for each param, add
TextField t = new TextField();
t.FieldLabel = param.ParamKey;
t.ID = param.UserPortletParamId.ToString();
t.Text = param.ParamValue;
fieldSet.Items.Add(t);
//Add direct event call back for each paramert
para = new Ext.Net.Parameter()
{
Name = param.UserPortletParamId.ToString(),
Value = string.Format("{0}.getValue()", t.ClientID),
Mode = ParameterMode.Raw
};
this.btnSave.DirectEvents.Click.ExtraParams.Add(para);
}
}
form.Render(this.winSettings, RenderMode.AddTo);
}
catch ( Exception e )
{
Ext.Net.ResourceManager.AjaxSuccess = false;
Ext.Net.ResourceManager.AjaxErrorMessage = e.Message;
}
}
Last edited by Daniil; Aug 08, 2011 at 1:26 PM.
Reason: [CLOSED]