Soooorrry!!! For a mistake I pressed "Send" button without writing anything...

Scott Van Wart ha scritto:

So in the above, I want to change the <title>...</title> depending on whether it's an add or edit operation. Can I do this?
Change "edit" definition to:


  <definition name="edit" extends="mydef">
    <put name="editTitle" value="msg.edit.title" />
    <put name="createTitle" value="msg.create.title" />
    <put name="content" value="/edit.jsp" />
  </definition>

And then layout.jsp to:

<c:choose>
  <c:when test="${empty recordKey}">
    <c:set var="titleKey"><tiles:getAsString name="createTitle" /></c:set>
  </c:when>
  <c:otherwise>
    <c:set var="titleKey"><tiles:getAsString name="editTitle" /></c:set>
  </c:otherwise>
</c:choose>
  <head>
    <title><bean:message key="${titleKey}" /></title>
  </head>

Anyway I don't think it is a good way of doing this kind of things. I'd write two definitions (one for create and one for edit) sharing the same layout page

Do I need to worry about the order in which tiles attributes are included?

What do you mean here? Each attribute must be assigned when a page is displayed or you'll get an error.
HTH
Antonio


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to