Announcement Announcement Module
No announcement yet.
spring and dojo + tiles Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring and dojo + tiles

    I am having some problems using spring-js and tiles. I don't think that this is a problem because of tiles, i have tried using spring-js without tiles with the same result. So, i am receiving an javascript error when my bage is loade :

    Webpage error details
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB0.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)
    Timestamp: Mon, 10 May 2010 18:01:16 UTC
    Message: Could not load 'dijit.MultiSelect'; last tried '../dijit/MultiSelect.js'
    Line: 16
    Char: 5948
    Code: 0
    URI: http://localhost:8080/fm/resources/dojo/dojo.js
    This is what i have done :

    tiles main template :

    <%@ taglib prefix="c" uri="" %>
    <%@ taglib uri="" prefix="tiles"%>
        <title><tiles:getAsString name="title" /></title>
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    	<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
        <script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js" />"></script>
        <script type="text/javascript" src="<c:url value="/resources/dijit/form/MultiSelect.js" />"></script>
        <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"></script>
        <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"></script>
    	<link type="text/css" rel="stylesheet" href="<c:url value="/resources/dijit/themes/tundra/tundra.css" />" />
    	<style type="text/css" media="screen">
            @import url("<c:url value="/resources/css-framework/css/tools.css" />");
            @import url("<c:url value="/resources/css-framework/css/typo.css" />");
            @import url("<c:url value="/resources/css-framework/css/forms.css" />");
            @import url("<c:url value="/resources/css-framework/css/layout-navtop-localleft.css" />");
            @import url("<c:url value="/resources/css-framework/css/layout.css" />");
            @import url("<c:url value="/resources/styles/booking.css" />");
        <div id="header">
           <div id="headerTitle"><tiles:insertAttribute name="header" /></div>
        <div id="menu">
           <tiles:insertAttribute name="menu" />
        <div id="content">
           <td><tiles:insertAttribute name="body" />
        <div id="footer">
           <tiles:insertAttribute name="footer" />
    my jsp file :

    <%@ taglib prefix="form" uri="" %>
    <%--<%@ include file="/taglibs.jsp" %>
    <head>            <!-- extra -->
    <%@ include file="/extra_head.jsp" %>
    <script type="text/javascript">dojo.require("dijit.TitlePane");
    <div dojoType="dijit.TitlePane" style="width: 100%" title="Abonare newsletter">
        <form:form action="/${ctx}/newsletter/add" method="POST" modelAttribute="newsletter">
            <form:errors path="*" cssClass="errors"/><br/>
                <label for="nume">First Name:</label>
                <form:input id="nume" cssStyle="width:250px" maxlength="30" path="nume" size="30"/>
                <form:errors path="nume" cssClass="errors"/>
                <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration(
                {elementId : "nume", widgetType : "dijit.form.ValidationTextBox",
                    widgetAttrs : {promptMessage: "First name is mandatory",
                        required : true}})); </script>
                <label for="prenume">Last Name:</label>
                <form:input id="prenume" cssStyle="width:250px" maxlength="30" path="nume" size="30"/>
                <form:errors path="prenume" cssClass="errors"/>
                <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration(
                {elementId : "prenume", widgetType : "dijit.form.ValidationTextBox",
                    widgetAttrs : {promptMessage: "Last name is mandatory",
                        required : true}})); </script>
    I see a small boxe on the right of my textbox saying that they are mandatory, but widget seems to be unformated.

    You can see the message in the screenshot.

    Anyone can provide any solution. Thx.

  • #2
    This isn't my area of expertise, but did you apply the tundra CSS class to the decorated elements?


    • #3
      I have imported the css with this line :

      <link type="text/css" rel="stylesheet" href="<c:url value="/resources/dijit/themes/tundra/tundra.css" />" />
      I haven't done anything else.


      • #4
        Ok, so the CSS is available, but I don't think decorating the element APPLIES the tundra class automatically. You're going to have to do this yourself.

        As an alternative, I think you can specify the tundra class in any parent class without any ill effects. For example, I'm setting the tundra class on the body element in my layout xhtml. You'll need to apply this class, or you won't get some of the widgets to render properly.


        • #5
          Thx, that was the problem. I've added to my body tag :

          <body class="tundra spring">