0
我有IceFaces的問題,我嘗試改變ace:textEntry取決於冰上選擇的項目:selectOneMenu。selectOneMenu和IceFaces中的textEntry
此外,我不需要去新的一頁,我希望它是AJAX和每次我改變它reflesh。 我嘗試做那樣:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:ace="http://www.icefaces.org/icefaces/components"
xmlns:icecore="http://www.icefaces.org/icefaces/core">
<f:view>
<ice:selectOneMenu partialSubmit="true" onchange="submit()"
value="#{testBean.selectedItem}"
valueChangeListener="#{testBean.selectionChanged}"
immediate="true">
<f:selectItems value="#{testBean.standardList}"
var="itemValue" itemLabel="#{itemValue}"
itemValue="#{itemValue}" />
</ice:selectOneMenu>
<ace:textEntry labelPosition="left" label="Output text: " id="output" value="#{testBean.outputItem}" >
<ace:ajax render="@this"/>
</ace:textEntry>
</f:view>
和豆製品:
import java.util.Arrays;
import java.util.List;
import javax.faces.bean.CustomScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.event.ValueChangeEvent;
import javax.inject.Inject;
import org.slf4j.Logger;
@ManagedBean
@CustomScoped(value = "#{window}")
public class TestBean {
@Inject
private Logger logger;
private String selectedItem;
private String outputItem;
private List<String> standardList = Arrays.asList("Artur","Adam","Mirek");
public void selectionChanged(ValueChangeEvent e){
this.outputItem = this.selectedItem;
logger.info(this.outputItem);
}
public String getSelectedItem() {
return selectedItem;
}
public void setSelectedItem(String selectedItem) {
this.selectedItem = selectedItem;
}
public List<String> getStandardList() {
return standardList;
}
public void setStandardList(List<String> standardList) {
this.standardList = standardList;
}
public String getOutputItem() {
return outputItem;
}
public void setOutputItem(String outputItem) {
this.outputItem = outputItem;
}
但它不會工作,任何解決方案?大thx。
它的工作很好!非常感謝。 – sha4ky 2013-03-07 15:43:50