Google Answers Logo
View Question
 
Q: Dynamic page rendering using struts ( Answered 1 out of 5 stars,   2 Comments )
Question  
Subject: Dynamic page rendering using struts
Category: Computers > Programming
Asked by: nicevikki-ga
List Price: $15.00
Posted: 01 Feb 2005 12:38 PST
Expires: 03 Mar 2005 12:38 PST
Question ID: 467108
What are the ways for "dynamic page rendering" using struts with out
the use of java scripts with example.
Answer  
Subject: Re: Dynamic page rendering using struts
Answered By: willisboyce-ga on 02 Mar 2005 12:16 PST
Rated:1 out of 5 stars
 
You didn't mention whether or not you can use Java applets.  If you
can, then you can put your checkboxes and radio buttons on an applet
and use the applet to update the page.  You'll find the information
that you need here:

http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/java_js.html

Ignore JSObject.  That gives you access to JavaScript, which you've
implied is disabled.  You want DOMService.

If you can't use JavaScript or Java--in other words, if you don't have
any ability to implement logic on the client at all--then your only
choice is to make the checkboxes and radio buttons into image buttons
(<input type="image" ...>).  Create images that look exactly like
checkboxes and radio buttons.  (Just take a screen shot of a regular
web page and cut the checkboxes and radio buttons out.)  You'll need
two images of each button, one in the checked/selected state and the
other in the unchecked/deselected state.  When generating the HTML for
the page, use the appropriate image for each button.  The buttons are
submit buttons, so when the user clicks one, the form will be
submitted.  Your server code will have to detect which checkbox or
radio button was clicked (by looking at the request arguments in the
same way that you'd determine which of several regular submit buttons
was clicked), take the appropriate action, and then regenerate the
whole page.  While generating the new page, your program will
obviously have the opportunity to add or remove user interface
elements based on the selection state of the checkboxes and radio
buttons.  I'll cheerfully admit that this is the brute force approach,
but it will work and will not require any client-side logic at all.

Request for Answer Clarification by nicevikki-ga on 02 Mar 2005 15:09 PST
Thanks for the update.
I can not use a java applet.
I want the same functionality that appears for an online survery form.
As you answer each question, the next section pops up.
The application is complete J2EE application minus java script and applets.
When I have so many submits for a long form, my performance is very
bad and this is a very critical application for the State. If that
were the case, I can break a very big form to many small forms and
have a submit for each screen.
things that can be possible are
1.using features of Struts DynaAction Form
2.Combination of JSF and tiles.

thanks.

Request for Answer Clarification by nicevikki-ga on 07 Mar 2005 18:52 PST
The status looks closed, and I have requested for an answer clarification.
Can you pl gimme an update on this query.

Thanks

Request for Answer Clarification by nicevikki-ga on 11 Mar 2005 08:06 PST
willisboyce,

I have been requesting for a answer clarification for the second time.
Please dont close my question.

Thanks.
nicevikki-ga rated this answer:1 out of 5 stars
I have been asking for an answer clarification, and I didnt get any
feedback. To my surprise, the status of my query is closed.

Comments  
Subject: Re: Dynamic page rendering using struts
From: nicevikki-ga on 10 Feb 2005 11:43 PST
 
thanks Mestre.

What I am looking for is that, when a user clicks a radio button or a
checkbox, an action is to be triggered liked, presenting a text box or
display of info. This can happen in two ways- java script or making
server calls.
I am looking for a similar functionality in STRUTS-DYNA ACTION FORM.
Subject: Re: Dynamic page rendering using struts
From: billotte-ga on 14 Feb 2005 04:56 PST
 
As far as I know (been playing/working with html and server side
web-applications since 1995) there is no way to have a radio button
click translate into any type of action with out Javascript. True the
server could generate the response that you want, but there is still
no way to issue a request to the server, other than with an anchor tag
or with a form and submit button without javascript. Without
javascript you are limited to only those two methods of invoking a
server response.

With javascript, however, you can easily use the onClick or onChange
handler for any for element (text, radio button, checkbox, etc.) to
trigger either a javascript pop-up dialog or a server response.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy