Unable to use Spring.AjaxEventDecoration to update table
Basically I'm trying to make it so when I add a distribution element the table updates in place. It seems the ajax is working and when I use firebug I'm getting a response with the proper html fragment in it. However the table is not updating. I suspect I'm not properly registering the table as a tiles fragment. Can anyone shed some light here? Thanks!
Here is my script :
Code:
dojo.addOnLoad(function() {
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId:'create_${sec_field}_id',
event:'onclick',
params: {fragments: "${sec_field}"}
}));
Here is my fooList jsp
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<div xmlns:tiles="http://tiles.apache.org/tags-tiles" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:page="urn:jsptagdir:/WEB-INF/tags/form" xmlns:table="urn:jsptagdir:/WEB-INF/tags/form/fields" version="2.0">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<jsp:output omit-xml-declaration="yes"/>
<page:list id="domain_Distribution" items="${project.distribution}" z="user-managed">
<table:add roles="ROLE_MANAGER" field="distribution" object="${project}" id="domain_Project_distribution" itemLabel="name" itemValue="id" items="${people}" path="/projects" z="user-managed"/>
<tiles:insertAttribute name="distribution" ignore="true" />
</page:list>
</div>
Here is my foo jsp
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<div xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:page="urn:jsptagdir:/WEB-INF/tags/form" xmlns:table="urn:jsptagdir:/WEB-INF/tags/form/fields" version="2.0">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<jsp:output omit-xml-declaration="yes"/>
<table:table data="${project.distribution}" update="false" create="false" path="/people" id="domain_Distribution" roles="ROLE_MANAGER" z="user-managed">
<table:column id="domain_Person_name" property="name" z="user-managed"/>
<table:column id="domain_Person_email" property="email" z="user-managed"/>
<table:column id="domain_Person_departments" property="departments" z="user-managed"/>
<table:column id="domain_Person_givenname" property="givenname" z="user-managed"/>
</table:table>
</div>
Here is my views.xml
Code:
<definition name="projects/showDetailsTemplate" template="/WEB-INF/views/projects/showDetailsTemplate.jspx">
<put-attribute name="milestones" value="/WEB-INF/views/milestones/showList.jspx"/>
<put-attribute name="costlineitems" value="/WEB-INF/views/manager/costlineitems/showList.jspx"/>
<put-attribute name="distributionList" value="projects/distributionList"/>
<put-attribute name="worklogs" value="/WEB-INF/views/worklogs/projectList.jspx"/>
<put-attribute name="weeklynotes" value="/WEB-INF/views/weeklynotes/projectList.jspx"/>
</definition>
<definition name="projects/distributionList" template="/WEB-INF/views/projects/distributionList.jspx">
<put-attribute name="distribution" value="/WEB-INF/views/projects/distribution.jspx"/>
</definition>