tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simone Chiaretta" <simon...@logicapiu.it>
Subject R: Autopostback in JSP
Date Wed, 26 Feb 2003 08:52:36 GMT
You can also do everthing on the client side
using DOM you can show/hide "pieces" of pages just setting their
*.style.display=block (to show) = none (to hide)

you can call a function to do it on the onClick event of the page.

you can see a working example on http://www.simel.it/registrazioneUtente.asp

if u choose something from the first dropdown menu, you see at the end of
the page different type of fields

hope that helps
Simone

> -----Messaggio originale-----
> Da: Mr. Cristian Romanescu [mailto:c.romanescu@finsiel.ro]
> Inviato: mercoledi 26 febbraio 2003 9.02
> A: Tomcat Users List
> Oggetto: Re: Autopostback in JSP
>
>
> Here are some hints:
>
> At 09:00 PM 2/25/2003 -0800, you wrote:
> >Hi,
> >1)  I want the contents of my HTML page display to
> >refresh automatically based on a selection made by the
> >user. I am using HTML + JSP.
> >For Example:
> >   There are three radio buttons
> >           - Thesis
> >           - Non-Thesis
> >           - Software Engineering
> >   Drop Down Menu1
> >
> >If the user selects 'thesis' there should be one drop
> >down menu appearing on the screen else there should be
> >two drop down menus appearing.
> >  How can I do that?
>
>
> You have to do on the radio buttons, an JavaScript function which handler
> onClick (I think) event.
> It would be something like this:
>
> Here is a sample how an drop-down list works (I have it handy...)
>
> JavaScript function:
> ================
>      function MM_jumpMenu(targ,selObj,restore){ //v3.0
>
> eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
>        if (restore) selObj.selectedIndex=0;
>      }
> ================
> Here is the Drop-list that implements this functionality.
> ================
> <SELECT name="Country" id="Country"
> onChange="MM_jumpMenu('parent',this,0)">
>    <OPTION value="this.jsp?param=0">Please select a country</OPTION>
>    <OPTION value="this.jsp?param=1">Any country</OPTION>
> </SELECT>
> ================
> As you can see I pass using HTTP GET method the param field which
> shows me
> what used has selected.
>
> Now you could adapt this code to your needs.
>
>
> >2)  Also what function in JSP will allow my page to
> >display one image if the mouse is placed on it and
> >another image if the the mouse is not place on it?
>
> 2) That is called rollover and is done also from JavaScript.
> Search the web
> further for JS tutorials on that.
> As a a startup, you should handle the onMouseOver and onMouseOut
> events in
> a <A href...> for example
>
> here is some sample code:
> <A href="link.jsp" onMouseOut="swapImg()"
> onMouseOver="swapImage('Image13','','images/search/easy_search_foc
> us.jpg',1)">
> <IMG name="Image13" border="0" src="images/search/easy_search.jpg"
> width="84" height="29"></A>
>
> hope this helps.
>   c.
>
> >Thanks,
> >I shall appreciate any help.
> >Thanks,
> >Runu
> >
> >__________________________________________________
> >Do you Yahoo!?
> >Yahoo! Tax Center - forms, calculators, tips, more
> >http://taxes.yahoo.com/
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message