File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes changing elements in same Jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "changing elements in same Jsp page" Watch "changing elements in same Jsp page" New topic
Author

changing elements in same Jsp page

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I have a requirement where I need to display
text field ,submit ,reset button and also "Show list" btn

If the user enters deptno in text field and presses submit ..action is deptlist.do
What I need is when I click "show list" I want to open the same page
but the text field must not be there instead a list box must be displayed
and need the same submit and reset btns and the action element is same deptlist.do.

Is this possible
Can some one give me idea
Baps Vakkalagadda
Ranch Hand

Joined: May 25, 2004
Posts: 47
It is possible. Use a flag variable to track the status (submission type).
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
****How do I pass/change the flag on button click

test.jsp
"<"% int flag =0 ;%">"
"<"FORM name="dept_frm" method="Post" action="dept.do"">"
"<"%
if(flag==1){
%">"

"<"SELECT name="dept_code"">"
"<"OPTION value="-1"">"100"<"/OPTION">"
"<"OPTION value="-1"">"200"<"/OPTION">"
"<"/Select">"

"<"%
}else{
%">"
"<"input name = dept_code value = Enter /">"
"<"form action = test.jsp/">"
"<"input type=submit name=action value="show list"
"onClick flag = 1" /">" click
"<"/form">"
"<"%}%">"

"<"input type=submit name=action value="Login"">"
"<"/form">"

[ August 25, 2004: Message edited by: shan javan ]
[ August 25, 2004: Message edited by: shan javan ]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: changing elements in same Jsp page
 
Similar Threads
Problem of resubmisson in struts2
how can i display my data on jsp page
How to redirect to same page in struts 2
JSF page works perfect only for the first time
Refresh problem