Callback multiplexer and passing args to callback panels

Hello,

So far, we have been using client side Javascript to call a callback panel. For. _sfCallbackPanel1.callback('action:save');
_sfCallbackPanel2.callback('action:display');

Now I want to use the mutiplexer to call these two panels.
_sfCallbackMultiplexer1.callback('bothpanels');

In the code behind event for the multiplexer, how would I pass arguments to panel1 ("action:save") and for panel2 ("action:display") ?

Thanks.


2 Replies

IV Ivan March 14, 2008 09:00 PM UTC

Just to clarify further, I am looking to use the multiplexer to call other callback panels that also takes arguments. How would I accomplish this? There isn't documentation on your web site for it.



AD Administrator Syncfusion Team April 1, 2008 11:13 AM UTC

Hi Ivan,

Thanks for posting your query to us.

You can call the callback panel in the callback multiplexer event as mentioned in the code below:


protected void CallbackMultiplexer1_Callback(object sender, Syncfusion.Web.UI.WebControls.Shared.CallbackEventArgs e)
{
char[] splitter = {':'};
string[] arr = e.CallbackArgument.Split(splitter);
Callbackpan1(arr[0], arr[2]);
Callbackpan2(arr[1], arr[2]);
}
public void Callbackpan1(string save,string val)
{
int eval = Convert.ToInt32(val);
switch (save)
{
case "save":
CallbackPanel1.BackColor = GetRandomBackColor();
CallbackMultiplexer1.ControlsToRefresh.Add(CallbackPanel1);
break;
case "any":
this.lbl1.Text = "any";
break;
}
}
public void Callbackpan2(string view, string val)
{
int eval = Convert.ToInt32(val);
switch (view)
{
case "view":
CallbackPanel2.BackColor = GetRandomBackColor();

CallbackMultiplexer1.ControlsToRefresh.Add(CallbackPanel2);
break;
case "any":
this.lbl1.Text = "any";
break;
}
}



Please refer the sample in the link below which illustrates the above:

http://websamples.syncfusion.com/samples/Tools.Web/6.1.0.34/I42307_N_W/main.htm

Please try running the above sample and let me know if this helps.

Regards,
Janagan.



Loader.
Up arrow icon