道场自定义构建

时间:2012-06-06 05:20:23

标签: dojo

我使用下面的form.profile.js文件

创建了自定义构建
dependencies ={
layers: [
{
name: "form.js",
dependencies: [
"dijit.form.Button",
"dijit.form.Form",
"dijit.form.ValidationTextBox"
]
}
],
prefixes: [
[ "dijit", "../dijit" ]
]
};

我得到了form.js和form.js.uncompressed.js文件

当我尝试在我的jsp中使用form.js时,它给出了我这样的错误

无法加载class' dijit.form.ValidationTextBox

以下是jsp

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link href="./scripts/dijit/themes/tundra/tundra.css" type="text/css" rel="stylesheet"/>
<style>
.myClass{
font-size:14px;
}
</style>
<script src="./scripts/dojo/dojo.js" djConfig="parseOnLoad:true"></script>
<script src="./scripts/dojo/form.js"></script>
<script>
//dojo.require("dijit.form.Button");
//dojo.require("dijit.form.ValidationTextBox");
dojo.ready(function(){

});
function showDialog(){
alert("Clicked!!");
//dijit.byId("dialog1").show();
}

function changed(){
alert(dijit.byId("select1").value);
dijit.byId("name").attr("value",dijit.byId("select1").value);
}
</script>
</head>
<body class="tundra">

<input type="text" dojoType="dijit.form.ValidationTextBox" id="name" propercase=true trim=true required=true  invalidMessage="Please Enter a valid value" />
<button dojoType="dijit.form.Button" value="Click" id="b1" onclick="showDialog()">Click</button>



</body>
</html>

请告诉我哪里出错了。

1 个答案:

答案 0 :(得分:0)

为dojo.js尝试完整的脚本标记,为其他所有内容尝试“dojo.require()”:

<script 
   type="text/javascript" 
   src="scripts/dojo/dojo.js"
   djConfig="parseOnLoad:true,isDebug:true">
   dojo.require("scripts/dojo/form.js");
</script>