This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



May 5, 2012, 4:50 PM
17 Posts
topic has been resolvedResolved

datepicker dojo constraint not working after upgrade to 853 and UpdatePack1

  • Category: Extension Library
  • Platform: Other
  • Release: 8.5.3
  • Role: Developer
  • Tags: dojo datepicker constraints minimum maximum
  • Replies: 1
After the upgrade to 853 and using the ibm supplied version of the extension library a function stopped working.
 
I use constraints in the datepicker to enable only dates in a certain range (from the start of a year until today
After the upgrade all dates are disabled, if  I change the function to return only a minimumvalue it does work
 
What am I missing?
 
My code for the field
<xp:inputText value="#{document1.datum}" id="datum1"
                                required="true">
                                <xp:this.converter>
                                    <xp:convertDateTime type="date" dateStyle="short" />
                                </xp:this.converter>
                                <xp:this.validators>
                                    <xp:validateDateTimeRange
                                        message="datum in dit jaar en maximaal vandaag" maximum="${javascript:new Date(@Today())}">
                                        <xp:this.minimum><![CDATA[${javascript:var jaar = sessionScope.AppSettings.get("boekJaar");
var jaari = parseInt(jaar,10);
new Date(jaari,0,1,0,0,0)}]]></xp:this.minimum>
                                    </xp:validateDateTimeRange>
                                    <xp:validateRequired message="welke datum?" />

                                </xp:this.validators>
                                <xp:this.validator><![CDATA[#{javascript:var nr = value.trim;
if (getComponent("comboBox1").getSubmittedValue() == "W") {
var msg = validWWDatum(nr);
if (msg!="") {
    postValidationError(this, msg);
}}}]]></xp:this.validator>
                                <xp:dateTimeHelper dojoType="dijit.form.DateTextBox"
                                    id="dateTimeHelper">
                                    <xp:this.dojoAttributes>
                                        <xp:dojoAttribute name="constraints">
                                            <xp:this.value><![CDATA[#{javascript:return minmaxDatum()}]]></xp:this.value>
                                        </xp:dojoAttribute>
                                    </xp:this.dojoAttributes>
                                </xp:dateTimeHelper>
                            </xp:inputText>
 
and the function
 
function minmaxDatum() {
    var jaar = sessionScope.AppSettings.get("boekJaar");
    var jaari = parseInt(jaar,10);
    var date1 = @Today();
    var year = @Year(date1);
    var month = @Month(date1);
    var day = @Day(date1);
    var min = "min:'" + jaari + "-01-01'";
    var max = "max:'" + year + "-" + month + "-" + day + "'";
//    return "{" + min + "," + max + "}";
    return "{" + min + "}";
}
May 7, 2012, 9:21 AM
17 Posts
solved, month and day should have 2 digits
If I change month and date to 2 digits (like 2011-06-01) the maxdate is accepted
 
(why, why, why is this changed)
 
function minmaxDatum() {
    function pad(n){return n<10 ? '0'+n : n}
    var jaar = sessionScope.AppSettings.get("boekJaar");
    var jaari = parseInt(jaar,10);
    var date1 = @Today();
    var year = @Year(date1);
    var month = @Month(date1);
    var day = @Day(date1);
    var min = "min:'" + jaari + "-01-01'";
    var max = "max:'" + year + "-" + pad(month) + "-" + pad(day) + "'";
    return "{" + min + "," + max + "}";
}

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal