here is my files :
index.xhtml
---------------
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<p:panel header="Hello From">
<p:linkButton href="http://www.primefaces.org/labs" value="Prime Faces"/>
</p:panel>
<br/>
<h:form id="form1">
<h:commandButton id="cb1" value="cliquez-moi!">
<p:ajax actionListener="#{bean.magie}" update="form1:it1"/>
</h:commandButton>
<h:outputText id="it1" rendered="#{bean.ok}" value="ça marche"></h:outputText>
</h:form>
</h:body>
</html>
-----------------
Code: Select all
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import java.io.Serializable;
/**
*
* @author lolveley
*/
@Named(value="bean")
@SessionScoped
public class Bean implements Serializable{
/** Creates a new instance of Bean */
public Bean() {
ok=false;
}
boolean ok;
public boolean isOk() {
return ok;
}
public void setOk(boolean ok) {
this.ok = ok;
}
public String magie(){
ok=true;
return("");
}
can you help me to make this funny thing possible?
olivier
ps : I use netbeans with jsf 2.1