Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Strut2中调用JavaScript函数_Java_Javascript_Struts2_Stripes - Fatal编程技术网

在Strut2中调用JavaScript函数

在Strut2中调用JavaScript函数,java,javascript,struts2,stripes,Java,Javascript,Struts2,Stripes,大家好 我有一个html代码要调用函数来在Stripes框架中执行日期时间选择器,该函数运行良好,代码如下: <td class="value" align="left"> <s:text name="firstProcessDate" id="firstProcessDate" maxlength="16" size="20" readonly="true"/> <img alt="Calendar" src="../images/ib/icon_

大家好

我有一个html代码要调用函数来在Stripes框架中执行日期时间选择器,该函数运行良好,代码如下:

<td class="value" align="left">
    <s:text name="firstProcessDate" id="firstProcessDate" maxlength="16" size="20" readonly="true"/>
    <img alt="Calendar" src="../images/ib/icon_calendar.gif" id="calendar" name="calendar"/>
    <script type="text/javascript">
       Calendar.setup({
        inputField: getObject("firstProcessDate"),
        dateFormat: "%d/%m/%Y",
        trigger: getObject("calendar"),
        min: Calendar.dateToInt(new Date()),
        max: Calendar.dateToInt(new Date()) + 10000, //one year from today's date
        bottomBar: false,
        onSelect: function() { 
            this.hide();
            checkTodayDate(); 
        }
       });
    </script>
   </td> 

日历设置({
inputField:getObject(“firstProcessDate”),
日期格式:“%d/%m/%Y”,
触发器:getObject(“日历”),
min:Calendar.dateToInt(新日期()),
max:Calendar.dateToInt(new Date())+10000,//从今天起一年
底线:错,
onSelect:function(){
this.hide();
checkTodayDate();
}
});
目前,我想在Strut2框架中执行此操作,我将代码更改如下:

<td>
    <html:text property="firstProcessDate" maxlength="16" size="20" readonly="true" />
    <html:image alt="Calendar" src="/images/icon_calendar.gif" value="reset" onclick="return test()" />
    <script type="text/javascript">
        Calendar.setup({

            inputField: getObject("firstProcessDate"),
            dateFormat: "%d/%m/%Y", 
            trigger: getObject("calendar"), 
            min: Calendar.dateToInt(new Date()), 
            max: Calendar.dateToInt(new Date()) + 10000, //one year from today's date 
            bottomBar: false, 
            onSelect: function() {  
            this.hide(); 
                checkTodayDate();  
            }           
       }); 
    </script>
            </td>

日历设置({
inputField:getObject(“firstProcessDate”),
日期格式:“%d/%m/%Y”,
触发器:getObject(“日历”),
min:Calendar.dateToInt(新日期()),
max:Calendar.dateToInt(new Date())+10000,//从今天起一年
底线:错,
onSelect:function(){
this.hide();
checkTodayDate();
}           
}); 
但它不起作用。我很好奇如何在Strut2中调用Calendar.setup函数,在这个函数中,有一个
getObject(“firstProcessDate”)
函数,在此之前,参数是id或name,但在Strut2中,没有更多的id和name属性,不确定应该在里面放什么

请告知


非常感谢。

不是用于输入标记的。是的。但你对这个问题的意思是什么?这不是一个问题,更像是一个答案使用输入标记。嗨,Aleksandr M,我已经编辑了我的问题,第一个代码运行良好,是用条纹编写的。下面是支柱的代码,但它不能工作。请告知:)什么是
getObject
?如果这是Struts 2,为什么要使用Struts 1标记、