PDA

View Full Version : [CLOSED] It is null my dynamic control with X.GetCmp in ServerSide



osef
Dec 27, 2013, 7:18 AM

Daniil
Dec 27, 2013, 11:55 AM
Hi @osef,

X.GetCmp() can retrieve only a real control. Internally it uses the FindControl method. So, you don't recreate the CalendarPanel during a DirectEvent, therefore it returns null.

You could use X.GetCmp<CalendarPanel>(), but it creates a proxy control. Not a real one. It won't contain all the settings of your real CalendarPanel. I don't think it is helpful in your case.

Please clarify why do you need a CalendarPanel instance inside those DirectEvents?

osef
Dec 27, 2013, 5:13 PM
Hi @osef,

X.GetCmp() can retrieve only a real control. Internally it uses the FindControl method. So, you don't recreate the CalendarPanel during a DirectEvent, therefore it returns null.

You could use X.GetCmp<CalendarPanel>(), but it creates a proxy control. Not a real one. It won't contain all the settings of your real CalendarPanel. I don't think it is helpful in your case.

Please clarify why do you need a CalendarPanel instance inside those DirectEvents?

Hi Daniil, It is necessary in the dfFecha_Change, the other DirectEvent It is not necessary, because, When the datetime is changing the EventStore in the each CalendarPanel should display new events.

But, if there is another way to do, I'll appreciate.

Thanks

Daniil
Dec 30, 2013, 4:21 AM
Yes, I think that in your scenario where is no alternative rather recreating the controls.

osef
Dec 30, 2013, 4:39 PM

Daniil
Dec 31, 2013, 7:08 AM
As far as can understand you should do the following:

protected void Page_Load(object sender, EventArgs e)
{
AgregarCalendarios();
}

osef
Jan 03, 2014, 5:48 AM
As far as can understand you should do the following:

protected void Page_Load(object sender, EventArgs e)
{
AgregarCalendarios();
}



Thank you Daniil, I neededthe property SetStartDate but, I am continuing with the next error
http://forums.ext.net/showthread.php?27720-Error-in-SetStartDate-to-CalendarPanel-dynamic