David,
Thank you so much for the clarification on the requestScope. I have 2 date fields one is start date and the other is end date, when I select start date , I want to use start date value for the min constraints for the End Date dojo attributes:
Start Date :
<xe:djDateTextBox id="LDate" value="#{requestData.LDate}">
<xp:eventHandler event="onChange" submit="false" refreshMode="complete"
refreshId="TTP">
<xe:this.script><![CDATA[
**** I want to store value here so that I can access it in the EndDate ( use this value for min constraints for the EndDate )*****
]]></xe:this.script>
</xp:eventHandler>
<xp:this.dojoAttributes>
<xp:dojoAttribute name="constraints">
<xp:this.value><![CDATA[#{javascript:
function pad(n){return n<10 ? '0'+n : n}
var date1 = @Today();
var year = @Year(date1);
var month = @Month(date1);
var day = @Day(date1);
var min = "min:'" + year + "-" + pad(month) + "-" + pad(day) + "'";
return "{" + min + "}";
}]]></xp:this.value>
</xp:dojoAttribute>
</xp:this.dojoAttributes>
</xe:djDateTextBox>
End Date:
<xe:djDateTextBox id="rDate" value="#{requestData.RDate}">
<xp:this.dojoAttributes>
<xp:dojoAttribute name="constraints">
<xp:this.value><![CDATA[#{javascript:
function pad(n){return n<10 ? '0'+n : n}
var startDateID = "#{id:LDate}";
var date1 = new Date (I want to get the LDate field value here but I am not able to get it. I was trying to store value in a scoped variable in onchange event of the Ldate Field )
var year = @Year(date1);
var month = @Month(date1);
var day = @Day(date1);
var min = "min:'" + year + "-" + pad(month) + "-" + pad(day) + "'";
return "{" + min + "}";
}]]></xp:this.value>
</xp:dojoAttribute>
</xp:this.dojoAttributes>
</xe:djDateTextBox>