This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes made progress with Ajax and JSF 2.0, need help please 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 "made progress with Ajax and JSF 2.0, need help please" Watch "made progress with Ajax and JSF 2.0, need help please" New topic
Author

made progress with Ajax and JSF 2.0, need help please

Cristian Jujea
Greenhorn

Joined: Feb 20, 2010
Posts: 3
Hi,

I have a simple JSF 2.0 form sent to the server with Ajax :

<h:form prependId="false" id="form">
<h:inputText value="#{securityResponsibleManagedBean.adminName}" /><br />
<h:inputSecret value="#{securityResponsibleManagedBean.adminPwd}" /><br />
<h:commandButton action="#{securityResponsibleManagedBean.adminLogin}" value="Intra">
<f:ajax event="action" execute="@form" onevent="afterAdminLogin()"/>
</h:commandButton><br />
</h:form>


This form is sent to :

@ManagedBean(eager=true)
@ApplicationScoped
public class SecurityResponsibleManagedBean {
private String adminName;
private String adminPwd;

public void setAdminName(String adminName) {
this.adminName = adminName;
}
public String getAdminName() {
return adminName;
}
public void setAdminPwd(String adminPwd) {
this.adminPwd = adminPwd;
}
public String getAdminPwd() {
return adminPwd;
}

public void adminLogin() {
System.err.println("Admin name : " adminName);
System.err.println("Admin pwd : " adminPwd);
}
}


After the adminLogin method is called, the Ajax response arrives in the browser and my afterAdminLogin javascript function is called.
How do I set the Ajax response to be as such :

<login>
<status>CORRECT</correct>
</login>

and how I pass the xmlHttp.responseXML to my afterAdminLogin javascript function?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: made progress with Ajax and JSF 2.0, need help please
 
Similar Threads
Validation Problem ... again!
Re-Execute Javascript on Ajax Render
relation between backing beans
how to get back bean value in javascript
AJAX request 's URL to a ManagedBean's method