I disagree violently. The drop-down list in that example is nothing but
pure HTML. When the submit button is clicked, it sends a URL back to
the server. The acts on the URL just like it does for every other
request. What do you see as special in that example?
I also have to disagree with the wording on that page. What he calls
the "obtrusive way" is handled entirely in the browser. Everything takes
place locally, with no additional network traffic. What he calls the
"unobtrusive way" requires an extra and totally unnecessary round-trip
back to the web server, just so it can send a header to force the
browser to do the exact same thing that one line of Javascript was doing.
> No one, that I have seen so far, appears to do a drop down list with
> just straight HTML, that responds on selection completion of an item,
> which is what I was looking for.
The straight HTML example you cited does not do that, either. It
requires the user to click the "submit" button. The modified version at
the bottom is using Javascipt plus jQuery plus that extra server
round-trip to accomplish what the first example did with a single line
of code. The final product there is worse than the original example in
every conceivable way. It requires more Javascript code on the page, it
requires you to load jQuery in the page, and it requires an extra server
round-trip. I can't tell what they were trying to prove here, but they
failed to do so.
> Clearly, CherryPy has no native hook or method to do this, per the
> past discussion thus far.
And neither does PHP.
> This reliance on Java or PHP as the above link references, provides
> the event logic.
You do understand that Java and Javascript are not related in any way,
don't you? The page you cited shows three lines of PHP running on the
server. ALL of the other code there is Javascript that gets sent with
the HTML and executed in the browser, and would be present regardless of
the language used on the server. Do you understand that the chunk of
code that starts "$(function() {" is Javascript and not PHP?
If you are looking for the CherryPy equivalent to the three lines of PHP
code on that page, that's easy enough:
@cherrypy.expose
def number( self, nav=None ):
if nav:
cherrypy.response.headers['Location'] = nav
> Our project design is 100% python and within the CherryPy
> environment. To add just one drop down list... we have to add an
> additional language? Be it Java, PHP, or whatever, It appears that is
> the case.
No, I think you are confused about which code is running where.
--