Calendar in callback

Not Answered This post has 0 verified answers and 9 replies

Top 500 Contributor
Posts: 27
NewbieCompArt Posted: Fri Aug 27, 2010 @ 10:21 AM

I have a number of calendars (& pickers) on my page that are giving me errors after performing a callback (the errors occur when trying to click on the img to show the calendar; the picker appears to be fine). If I move my calendar controls above my img control in my aspx source markup, I do not get errors, but my calendars appear at the top left of my page, rather than relative to the img buttons which invoke the calendar. I'm not sure what's happening here??? Can someone provide a solution (with example) asap as I'm past a deadline? Thank you ever so much!! (using version 2007.2)

All Replies

Top 10 Contributor
Posts: 865
sberkovitz Posted: Fri Aug 27, 2010 @ 10:29 AM
Are you setting the PopUpExpandControlId property to the ID of the image?  Does that image exist in the DOM at the time of callback?
Steven Berkovitz MBC Development Ltd. & OrderDynamics Corporation http://www.mbccs.com http://www.orderdynamics.com
Top 500 Contributor
Posts: 27
NewbieCompArt Posted: Fri Aug 27, 2010 @ 11:47 AM
Yes, to both of your questions.
Top 10 Contributor
Posts: 865
sberkovitz Posted: Fri Aug 27, 2010 @ 11:50 AM
Can you post some code demonstrating the problem?
Steven Berkovitz MBC Development Ltd. & OrderDynamics Corporation http://www.mbccs.com http://www.orderdynamics.com
Top 500 Contributor
Posts: 27
NewbieCompArt Posted: Fri Aug 27, 2010 @ 12:15 PM
.......................
<td class="ms-formlabel" style="width: 15%">
                <asp:Label ID="_lblExpFinalShipDate" runat="server" Text="Expected Final Ship Date:"></asp:Label>
            </td>
            <td class="ms-formbody" style="width: 35%">
              <table><tr>
                <td>
                    <ComponentArt:Calendar id="_pickerExpFinalShipDate" runat="server" PickerFormat="Short" PickerCustomFormat="MMMM d yyyy"
                            ControlType="Picker" PickerCssClass="picker" >
                        <ClientEvents>
                            <SelectionChanged EventHandler="_pickerExpFinalShipDate_OnDateChange" />
                        </ClientEvents>
                    </ComponentArt:Calendar>
                </td>
                <td style="font-size:10px;">&nbsp;</td>
                <td>
                    <img id="calendar_to_button" alt="" onclick="ButtonTo_OnClick(event)" onmouseup="ButtonTo_OnMouseUp(event)" class="calendar_button" src="CSS/images/btn_calendar.gif" /><span><b> *</b></span>
                </td>
                <td>
                    <%-- Validation needs to be added? --%>
                    <%--<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>--%>
                </td>
              </tr></table> 
            </td> 
....................
<ComponentArt:Calendar runat="server"
      id="CalendarFrom"
      AllowMultipleSelection="false"
      AllowWeekSelection="false"
      AllowMonthSelection="false"
      ControlType="Calendar"
      PopUp="Custom"
      PopUpExpandControlId="calendar_from_button"
      CalendarTitleCssClass="title"
      DayHeaderCssClass="dayheader"
      DayCssClass="day"
      DayHoverCssClass="dayhover"
      OtherMonthDayCssClass="othermonthday"
      SelectedDayCssClass="selectedday"
      CalendarCssClass="calendar"
      NextPrevCssClass="nextprev"
      MonthCssClass="month"
      SwapSlide="Linear"
      SwapDuration="300"
      DayNameFormat="FirstTwoLetters"
      ImagesBaseUrl="CSS/images/"
      PrevImageUrl="cal_prevMonth.gif"
      NextImageUrl="cal_nextMonth.gif">
      <ClientEvents>
        <SelectionChanged EventHandler="CalendarFrom_OnChange" />
      </ClientEvents>
    </ComponentArt:Calendar> 
Is the aspx source what you're looking to see? I picked a picker/calendar out of the whole... Thanks!

Top 10 Contributor
Posts: 865
sberkovitz Posted: Fri Aug 27, 2010 @ 12:21 PM
I don't see any IMG tag with an ID of calendar_from_button
Steven Berkovitz MBC Development Ltd. & OrderDynamics Corporation http://www.mbccs.com http://www.orderdynamics.com
Top 500 Contributor
Posts: 27
NewbieCompArt Posted: Fri Aug 27, 2010 @ 12:24 PM
I posted it wrong above (the picker & image is for a different calendar) - too many - sorry!!

<td class="ms-formbody" style="width: 35%">
                <table>
                  <tr> 
                    <td>
                        <ComponentArt:Calendar id="_pickerExpFirstShipDate" runat="server" PickerFormat="Short" PickerCustomFormat="MMMM d yyyy" 
                                ControlType="Picker" PickerCssClass="picker">
                            <ClientEvents>
                                <SelectionChanged EventHandler="_pickerExpFirstShipDate_OnDateChange" />
                            </ClientEvents>
                        </ComponentArt:Calendar>
                    </td>
                    <td style="font-size:10px;">&nbsp;</td>
                    <td>
                        <%--<input id="calendar_from_button" type="button" value="button" onclick="ButtonFrom_OnClick(event)" onmouseup="ButtonFrom_OnMouseUp(event)" class="calendar_button" />--%>
                        <img id="calendar_from_button" alt="" onclick="ButtonFrom_OnClick(event)" onmouseup="ButtonFrom_OnMouseUp(event)" class="calendar_button" src="CSS/images/btn_calendar.gif" runat="Server"/><span><b> *</b></span>
                    </td>
                    <td>
                        <%-- Validation needs to be added? --%>
                    </td>
                  </tr>  
              </table>  
            </td>                
            <td class="ms-formlabel" style="width: 15%">
                <asp:Label ID="_lblExpFinalShipDate" runat="server" Text="Expected Final Ship Date:"></asp:Label>
            </td>




JS:

function ButtonFrom_OnClick(event)
{
    //Sys.Debug.Fail("");
    if (CalendarFrom.get_popUpShowing())
    {
        CalendarFrom.hide();
    }
    else
    {
        CalendarFrom.setSelectedDate(_pickerExpFirstShipDate.getSelectedDate());
        CalendarFrom.show();
    }
}

function ButtonFrom_OnMouseUp(event)
{
    if (CalendarFrom.get_popUpShowing())
    {
        event.cancelBubble=true;
        event.returnValue=false;
        return false;
    }
    else
    {
        return true;
    }
}
Top 10 Contributor
Posts: 865
sberkovitz Posted: Fri Aug 27, 2010 @ 12:28 PM

Can you try removing the MouseUp event to see if that is inteferring?

Steven Berkovitz MBC Development Ltd. & OrderDynamics Corporation http://www.mbccs.com http://www.orderdynamics.com
Top 500 Contributor
Posts: 27
NewbieCompArt Posted: Fri Aug 27, 2010 @ 12:34 PM
No change
Top 500 Contributor
Posts: 27
NewbieCompArt Posted: Fri Aug 27, 2010 @ 1:38 PM
Fyi, in case this matters: this is in a content page of a master.
Page 1 of 1 (10 items)