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

trying to use ajax tag with jsf 2.0 but entire page is being rendered, not just specified id

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
edit - heh, turns out I was looking at the deployed app on an old context-root.... so all my attempts were not actually getting tested,. Not saying I have this figured out yet, but it is at least explainable now

Hey all

I have the following jsf:


You can probably see it is a basic login form. I have the command link set to call the login method, and I only want it to render this div. So I added the f:ajax tag close to the bottom there, but it is not behaving like I expect. I should mention this is my first attempt to use ajax, so I am probably doing something dumb.
I tried a few variations without luck, can someone guide me a bit here?
It seems the fact that I am calling login method is causing the page to reload no matter what. There is no logic there to reload the page, we just check the username and password and add errors if it fails (we redicret if it logs in, but that is not what I am worried about, I am working on getting only a portion of the page reloading when there is a login error).
Thanks
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, now that I am testing the right page, I am getting something else.
When I click the button the page is not rerendered, but neither is the area I define. I am getting this js error each time I click:

mojarra is not defined

So the following is not there I would assume:

<script type="text/javascript" src="/maze/javax.faces.resource/jsf.js.xhtml?ln=javax.faces">
</script>

But I am nto sure why or what to do about it
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Needed to change <head> tags to <h:head>
Working now
 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic