struts2(4)

(13)tree

<s:url var="nodesUrl" namespace="/nodecorate" action="getNodes" />
<div style="float:left; margin-right: 50px;">
    <sx:tree id="tree" href="%{#nodesUrl}" />
</div>

 

<s:url var="url" namespace="/tags/ui" value="treeExampleStatic.jsp" /><s:a href="%{url}">

 

(14)

<sx:tree
    id="tree"
    rootNode="%{treeRootNode}"
    childCollectionProperty="children"
    nodeIdProperty="id"
    nodeTitleProperty="name"
    treeSelectedTopic="treeSelected">
</sx:tree>

<div id="displayId">

 

<script language="JavaScript" type="text/javascript">
    dojo.event.topic.subscribe("treeSelected", function treeNodeSelected(node) {
        dojo.io.bind({
            url: "<s:url value='/ajax/select/dynamicTreeSelectAction.action'/>?nodeId="+node.node.widgetId,
            load: function(type, data, evt) {
                var divDisplay = dojo.byId("displayId");
                divDisplay.innerHTML=data;
            },
            mimeType: "text/html"
        });
    });
</script>

 

------------在一个页面,当点击一个node时,就会激活treeSelected,就会请求dojo.io.bind里的url.会把响应数据显示在本页面中。没有跳转,局部刷新

 

(16)  dojo.event.topic.subscribe("treeSelected", function treeNodeSelected(node) {
        dojo.io.bind({

没有执行请求url.没反应。这是什么问题???

    它是没有请求响应的页面,不存在。

 (17)

<s:action var="myDate" name="date" namespace="/" executeResult="false" />

<s:property value="#myDate.now.toString()"/>

private Date now;//这是date Action中的属性。

<s:date name="#myDate.now" format="yyyy/MM/dd hh:mm:ss" />

 

(17)

<s:url var="quizAjax" namespace="/validation" action="quizAjax" method="input"/>

你可能感兴趣的:(JavaScript,jsp,Ajax,UI,dojo)