Results 1 to 2 of 2
  1. #1
    jeeva is offline Member
    Join Date
    Jan 2009
    Posts
    4
    Rep Power
    0

    Unhappy Issue in calendar display

    I have a java file which contains the following code as a part of it:

    onClickStartDate.append(" onclick=\"javascript:calendarSetUp(");
    onClickStartDate.append("this");
    onClickStartDate.append(",");
    onClickStartDate.append("'"+inputFieldName+"'");
    onClickStartDate.append(",'true'");
    onClickStartDate.append(")\"");





    if((attribute.equalsIgnoreCase("Planned start date")))
    {
    System.out.println("$$$$DATES");
    retval.append("<input type=\"text\" tabindex=\"");
    retval.append(rowNumber);
    retval.append("\" name=\"r");
    retval.append(rowNumber);
    retval.append("c");
    retval.append(colNo);
    retval.append("\"");
    retval.append(" value=\"");
    retval.append(value);
    retval.append("\"");
    retval.append(onChange.toString());
    retval.append(">");
    retval.append("<img src=\"cim/images/calendar.gif\" id=\"calendarGif1\" alt=\"Add date\" " +onClickStartDate.toString()+"/>");
    rowNumber++;
    System.out.println("Retval STARTDATE : "+retval);
    return(retval.toString());

    }


    I am getting the calendar image.
    On click of that imabe on the first row,the particular function calendarSetup() is being called and I am getting the alerts in that function.
    Then again when i click that calendar image of 1st row ,I am getting the calendar.

    But if i do the same for other rows,it is entering into that celendarSetup method,getting the alerts.
    Again if i click the calendar,i am not getting the calendar.
    then i go to the image in the 1st row,then the calebdar is displayed and the date value is saved in the other row.


    the calendar program used by me is:

    <script language="JavaScript" src="<%=request.getContextPath()%>/esm/js/util.js"></script>
    <script language="JavaScript" src="<%=request.getContextPath()%>/esm/js/calendar.js"></script>
    <script language="JavaScript" src="<%=request.getContextPath()%>/esm/js/calendar-en.js"></script>
    <script language="JavaScript" src="<%=request.getContextPath()%>/esm/js/calendar-setup.js"></script>

    <script language="JavaScript">
    function calendarSetUp(object,inputelement,calendarButton)
    {
    alert("Yo dude!! welcome");


    alert(inputelement);
    alert(calendarButton);

    var calendar="";
    if(calendarButton == "true")
    calendar = "calendarGif1";
    else
    calendar = "calendarGif2";

    Calendar.setup({
    inputField :inputelement,// name of the input field
    ifFormat : "%d-%m-%Y", // format of the input field
    button : calendar, // trigger for the calendar align : "top", // alignment (defaults to "Bl")
    valign : "right",
    singleClick : true,
    mondayFirst : true
    });

    }
    </script>
    Could anyone resolve this issue for me.plsssssss

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Sorry to disappoint you but Java != JavaScript. Since this is a Java forum, your best bet is to Google for a JavaScript forum and ask there. I know that JavaRanch has one, but there are many others as well. Wishing you best of luck in finding a solution!

Similar Threads

  1. Replies: 8
    Last Post: 12-29-2008, 08:12 AM
  2. calendar
    By John in forum SWT / JFace
    Replies: 12
    Last Post: 08-07-2008, 11:54 PM
  3. Replies: 0
    Last Post: 06-28-2008, 10:26 PM
  4. Web calendar
    By Daniel in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 06-27-2007, 06:36 PM
  5. Gregorian calendar issue
    By orchid in forum New To Java
    Replies: 1
    Last Post: 05-16-2007, 07:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •