wood burning stoves*
The moose likes JSF and the fly likes trying to use ajax tag with jsf 2.0 but entire page is being rendered, not just specified id Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "trying to use ajax tag with jsf 2.0 but entire page is being rendered, not just specified id" Watch "trying to use ajax tag with jsf 2.0 but entire page is being rendered, not just specified id" New topic
Author

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

Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

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


True wisdom is in knowing you know nothing - Socrates
Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

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
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

Needed to change <head> tags to <h:head>
Working now
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: trying to use ajax tag with jsf 2.0 but entire page is being rendered, not just specified id
 
Similar Threads
dataTable columns can't include markup?
h:commandLink issue
Can you read this?
Form Being Rendered Outside of the Page
problem in Dynamic webform creation ?