1
왜Richfaces : 요청 범위와 조건 및 콩 렌더링
<h:form>
<h1> JSF do not post a "execute doAction1"</h1>
<a4j:commandButton action="#{sample.showPanel}" value="Show Panel"
reRender="MyPanelShow"></a4j:commandButton>
<a4j:outputPanel id="MyPanelShow" >
<rich:panel rendered="#{sample.showPanel}" id="panel1">
<h:inputText value="#{sample.name}" id="input1"></h:inputText>
<a4j:commandButton value="Ejecutar" action="#{sample.doAction1}"
reRender="MyPanelShow" id="action1"></a4j:commandButton>
</rich:panel>
</a4j:outputPanel>
</h:form>
<!-- Backing Bean-->
package py.com.roshka.jrey.uifrw.web;
import java.io.Serializable;
public class SampleBean implements Serializable{
private String name;
private boolean showPanel = false;
public String doAction1() {
name = name + " Ok";
return null;
}
public String showPanel() {
showPanel = true;
return null;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name
* the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the showPanel
*/
public boolean isShowPanel() {
return showPanel;
}
/**
* @param showPanel
* the showPanel to set
*/
public void setShowPanel(boolean showPanel) {
this.showPanel = showPanel;
}
}
showPanel = true .. 첫 번째 조치는 showPanel = true로 설정했지만 요청 빈은 등록 정보가있는 bean 상태를 저장하지 않습니다 ... 두 번째 작업을 제출할 때 현재 showPanel 등록 정보를 어떻게 설정할 수 있습니까 ??? , 당신은 몇 가지 예입니다 ... 어떻게 정확하게 그것입니까? 고마워. – jrey
요청 범위가 지정된 bean은 하나의 요청에 대한 값을 보유합니다. 세션,보기 또는 대화와 같은 더 긴 범위를 사용해야합니다. –