Welcome Guest Search | Active Topics | Sign In | Register

ClientID in popupcalendar. Bug or Not? Options
Maxim
Posted: Thursday, October 8, 2009 6:20:59 PM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
Code: HTML/ASPX
<eo:PopupCalendar ID="Calendar1" runat="server" ClientSideOnSelect="DateClientSideOnSelect">...


How in function DateClientSideOnSelect(calendar, eventName) i can get DOM object of Calendar1 ?

calendar.getId() - return ClientID but document.getElementById(calendar.getId() ) - return null.
Also document.getElementById(<%=Calendar1.ClientID %>) return null
eo_support
Posted: Thursday, October 8, 2009 7:56:38 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

This is normal. Our PopupCalendar is not a single DHTML element, so you can not get a single element that represents the Calendar. You can only get the client side JavaScript method and call the methods that are exposed on that object (such as getId).

Thanks!
Maxim
Posted: Tuesday, October 13, 2009 7:55:17 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
Great! :(
And what i can do with Date from this PopupCalendar? What profit will i have from it?
eo_support
Posted: Tuesday, October 13, 2009 8:00:00 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Maxim
Posted: Tuesday, October 13, 2009 8:08:55 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
Thanks for links.
But you don't understand me. Forgive me for boring. I know EO client api and methods of Calendar class.

I create my UserControl aspx and use PopupCalendar and TextBox(display selected date).
If i use single my UserControl on page, then Calendar.getSelectedDate() and set value to <%TextBox.ClientID %>.value - work fine. But if i use many UserControl on page a must define what kind calendar fire event ClientSideOnSelect and accordingly define to what kind TextBox write selectedDate.
Maxim
Posted: Tuesday, October 13, 2009 8:10:19 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
Sorry for my English :)
eo_support
Posted: Tuesday, October 13, 2009 8:29:07 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

That will be up to you. You will need to use eo_GetObject("<%=Calendar.ClientID %>") to get the Calendar object. You can then use whatever method to associate your Calendar with your TextBox.

Thanks
Maxim
Posted: Tuesday, October 13, 2009 8:40:17 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
if i use ClientSideOnSelect handler for example function DateClientSideOnSelect(calendar, eventName) { ... } and many usercontrol contaied Calendar, then in html source will be many unction DateClientSideOnSelect and when event fire - then be called the last function DateClientSideOnSelect.

Accordingly eo_GetObject("<%=Calendar.ClientID %>") - it's latest UserControl on Page.


Yes, i make workaround. I use Dictionary - usercontrol.clientID and Calendar.getId().. but it's not good. I think will be great add to EO Object class method getParentElement, but ofcourse it's up to you.

Thanks.
eo_support
Posted: Tuesday, October 13, 2009 8:47:41 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Try use:

eo_GetObject("<%=Calendar.ClientID %>").getRootElement();

That should give you the root HTML element of the Calendar control. Note this is only for you to get a DHTML element in your page, it is not guaranteed that it has the same ID as the Calendar.

Thanks
Maxim
Posted: Tuesday, October 13, 2009 9:05:47 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
PopupCalendar don't contains getRootElement(); :)
eo_support
Posted: Tuesday, October 13, 2009 9:16:37 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Maxim wrote:
PopupCalendar don't contains getRootElement(); :)


Can you try it on the latest version first? The method is there. It's not documented.

Thanks
Maxim
Posted: Tuesday, October 13, 2009 9:48:28 AM
Rank: Advanced Member
Groups: Member

Joined: 12/26/2008
Posts: 45
Worked. Thanks.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.