You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Ed...@swisscom.com on 2003/08/14 19:37:41 UTC

Use of velocity variables in html form parameters

I have a problem with a velocity portlet. This portlet contains a html form with some text fields. Most text fields are empty, but one text field should display the text stored in a velocity variable. The user has the possibility to change the text. 

The problem is, that the text is only displayed until the first space. That means when the text is "Hello World" then the displayed text is "Hello". The text is generated by my java code and it is ok. Does anybody know how to solve this problem or whether this is a bug?

I know, this could be a basic velocity problem, but as it occurs in my jetspeed portlet I post it in this mailing list.

Here is the code of my velocity file. The $text variable is the critical point:

#set ($forum_id = $data.getRequest().getParameter("forum_id"))
#set ($level =$data.getRequest().getParameter("level")+1)
#set ($parent_id =$data.getRequest().getParameter("parent_id"))


<form action="$jslink.getPaneByName("Forum")" method="post">
  <font color="$!{skin.Color}">
    <p>
      <br>
      ##<input name="news" value="$!news" size="30">
      <table>
        <tr>
          <td> Vorname </td>
          <td> <input type="text" name="firstname" value=""> </td>
        </tr>
        <tr>
          <td> Nachname </td>
          <td> <input type="text" name="lastname" value=""> </td>
        </tr>
        <tr>
          <td> Betreff</td>
          <td> <input type="text" name="title" size=50 value="$text" ></td>
        </tr>
      <table>
      
      <textarea name="content" value="" rows="8" cols="50"></textarea>
      <br>
      <input type="submit" name="eventSubmit_doUpdate" value="Update">
      <input type="reset" value="Reset">
      <input type="hidden" name="level" value=$level>
      <input type="hidden" name="parent_id" value=$parent_id>
      <input type="hidden" name="forum_id" value=$forum_id>
    </p>
  </font>
</form>