Announcement Announcement Module
Collapse
No announcement yet.
Odd Tiles problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Odd Tiles problem

    Hello everyone,

    I'm working on a project that I started with Roo (1.1.5), I refactored the controller via "push-in" and have complete control.

    I wanted to re-use the same form fields from my create.jspx for my update.jspx page. I extracted the fields, placed them in their own jspx file called, editaddressfields.jspx. I then nested the tile in the

    views.xml file like so:

    Code:
    	<definition extends="default" name="address/update">
            <put-attribute name="body" >
    	        <definition template="/WEB-INF/views/address/update.jspx">
    		   		<put-attribute name="editaddressfields" value="/WEB-INF/views/clients/editaddressfields.jspx"/>
    	   		</definition>
       		</put-attribute> 
    	</definition>

    My update.jspx file

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <div xmlns:c="http://java.sun.com/jsp/jstl/core"
    	xmlns:tiles="http://tiles.apache.org/tags-tiles"
    	xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
    	xmlns:util="urn:jsptagdir:/WEB-INF/tags/util"
    	xmlns:form="http://www.springframework.org/tags/form"
    	xmlns:jsp="http://java.sun.com/JSP/Page"
    	xmlns:spring="http://www.springframework.org/tags" version="2.0">
    	 
    	<jsp:output omit-xml-declaration="yes" />
    
    <script type="text/javascript">
    	dojo.require("dojo.parser");
    	dojo.require("dijit.form.ValidationTextBox");
    	dojo.require("dijit.form.Button");
    	dojo.require("dijit.form.FilteringSelect");
    	dojo.require("dijit.form.DateTextBox");
    	dojo.require("dijit.form.TextBox");
    	dojo.require("dijit.layout.TitlePane");
    
    	dojo.addOnLoad(function(){
    		dojo.parser.parse();
    	});
    </script>
    	
     <util:panel title="Edit Address" id="pnlEditAddress" > 
    	<form:form id="editClientForm" dojoType="dijit.form.Form" method="PUT" modelAttribute="address">
    	
    		<tiles:insertAttribute name="editaddressfields"  />
    	    
    		<form:hidden path="id" />
    		<form:hidden path="version" />
    	    <button dojoType="dijit.form.Button" type="submit" name="submitButton" value="Submit">
    	        Save
    	    </button>
    	    
    	</form:form>    
    </util:panel> 
    
    </div>
    What is happening is that the editaddressfields.jspx does render, but not in the correct location. I am using a classic layout of header, footer, left menu (dojo accordion) and body. It renders at the bottom and not in the <utilanel> like I would think it would. It causes the accordion menu on the left to be really screwed up, missing panes, and such. It doesn't seem to matter what I put in my editaddressfields.jspx file the outcome is the same. I removed all form elements and only put in a simple <H1> tag and still same results.

    I'm not sure what I am missing here.

    Any help would be greatly appreciated.

    Thanks,
    John

  • #2
    Ok, I think I found the issue. It boils down my not knowing dojo that well.

    In the above code example, I have the form line as:

    Code:
    <form:form id="editClientForm" dojoType="dijit.form.Form" method="PUT" modelAttribute="address">
    I should now have set the dojoType at all. According to the Dojo documentation:

    "dijit.form.Form is the dijit equivalent of the <form> node, and it provides various methods for serializing/deserializing form data, and checking whether or not a form is valid."

    So, if my thinking is correct, and its very possible that its not, I was getting a corrupted <form> tag. Probably getting "form" in there twice, and therefore messing up my page.

    Comment


    • #3
      Thanks for sharing your solution. That's always welcome.

      Comment

      Working...
      X