X-Application Version: 3.1.2,
Tamino Version : 3.1.1
Platform : Win2k…
WebContainer : Tomcat 3.3
JDK Version : 1.3.1
I created a search/display page with several input fields. Upon commit the page links to itself.
Beneath the form fields I show the query results. How can I set the search fields to the values they had before the query?(i.e. “selected” for
Hello Ralf,
with the next version 3.1.3 it will be easy to save the values of input parameters within a session context. We will provide a variable context which will solve this problem. Request parameters are automatically stored within the variable context and can be addressed by a tag ?getvar?.
For X-Application 3.1.2, you could manually do these steps.
(1) Before the module tag evaluated the request parameter, store its values within the JSP page object. For example
<BR><%<BR> String myParamValue = request.getParameter("myParam?); <BR> page.setAttribute(?myParamValue?, myParamValue != null ? myParamValue : ??);<BR>%><BR></pre><BR><BR>(2) Use value of the attribute as default for the input tags of the parameter. For example<BR><BR><pre class="ip-ubbcode-code-pre"><BR><input name=?myParam? value=?<% out.print(page.getAttribute(?myParamValue?); %>?><BR>
page, request and out are predefined objects (variables) for JSP pages.
Hope, this helps you.
Bye,
Christian.
Thanks for your suggestions. Maybe you can help me a bit further:
This is what I put before the module tag:
<%
String myParamValue = request.getParameter(“query(/testcase1/Frage,~=)”);
page.setAttribute(“myParamValue”, myParamValue != null ? myParamValue : “”);
%>
The error message sounds like there are some imports missing ??
Did I get the name right? I took what’s in the name attribute : “query(/testcase1/Frage,~=)”
For the text-control it should work after you give me some more hints …, but for the
Hello,
excuse me, my mistake. Use pageContext instead of page. For this object, setting attributes is possible.
Bye,
Christian.