This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Just call a regular method at onclick on an image

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,

its kind of frustrating now. I have some navigation images on my site like this:



My faces-config.xml looks like this:



and my java class like this




All I want is when I click on the image, that the "updateAktuelleSeite" method will be called with the argument given on the jsf page.

This line is workin fine : <a4j:include viewId="#{navigation.aktuelleSeite }"></a4j:include>

Because when I remove the onclick attributes, it workes.

I always get this error:


javax.servlet.ServletException: /index.jsp(32,4) '#{navigation.updateAktuelleSeite }' Property 'updateAktuelleSeite' not found on type de.hauke.steuerung.web.Navigation
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)





So why is java is thinking, updateAktuelleSeite is an property? It is just a regular method. Do I have to add something inside the faces-config.xml file?


My System:
I used JBoss 4.2.3GA with Richfaces 3.3.3 FINAL and JSF 1.2 (I believe it is 1.2, because a friend of mine configured everything for me and
we didn't get the project working with the latest JSF Libs).



Thanks a lot and many greeting,
Hauke
 
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hauke,


Did you try this: onclick="#{navigation.updateAktuelleSeite()}"

otherwise it might try to access "updateAktuelleSeite" property like getUpdateAktuelleSeite()

 
Hauke Meier
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

that doesn't work either. But I solved the problem by using this instead:



I don't know if this is a good method but it works.

Many greetings,
Hauke
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hauke,


ok. It seems onclick is not submitting a request to server by default; we need to write a javascript method to do so.
I suppose onclick in any tag will not post a request to server by default.

where as <h:commandLink>'s "action" is going to submit the request to server by default.
Thanks for posting this query.
 
I'm so happy! And I wish to make this tiny ad happy too:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic