【问题标题】:JSF 1.2 table value as id for a4j command buttonJSF 1.2 表值作为 a4j 命令按钮的 id
【发布时间】:2016-09-20 15:04:46
【问题描述】:

我有

<h:column headerClass="details_header">
    <h:panelGroup rendered="#{foo.checkIffooIsAvailable(table.YooId)}">
        <h:form>
            <h:inputHidden id="hiddenYooboo" value="#{table.YooId}" 
                binding="#{foo.hiddenInputValue}"/>
            <a4j:commandButton styleClass="quickYooButton fooButton"
                value="#{textElement.getText('foo')}" reRender="fooPanel" 
                action="#{foo.getFullfooAmount()}">
                <rich:componentControl for="fooPanel" event="oncomplete" 
                    operation="show" />
            </a4j:commandButton>
        </h:form>
    </h:panelGroup>
</h:column>

和后端

private Integer boo;
private BigDecimal partialfoo;
public List<Integer> fooTableYoos = new ArrayList<Integer>();
public UIInput hiddenInputValue;    

public Boolean checkIffooIsAvailable(Integer tableboo) {
    Iterator<Integer> iter = fooTableYoos.iterator();
    while (iter.hasNext()) {
        if (iter.next().compareTo(tableboo) == 0) {
            return true;
        } else {
            return false;
        }
    }
    return false;
}

public BigDecimal getFullfooAmount() {
    BigDecimal fooAmount = null;
    try {
        fooAmount = new BigDecimal(100);
        setFullfoo(fooAmount);
    } catch (Exception e) {
        log.error("getFullfooAmount()", e);
    }
    return fooAmount;
}
    public UIInput getHiddenInputValue() {
    return hiddenInputValue;
}

public void setHiddenInputValue(UIInput hiddenInputValue) {
    this.hiddenInputValue = hiddenInputValue;
}

问题是当我点击 commandButton 时出现错误:

无法实例化 Seam 组件:表格。

我需要在渲染表时检查 boo 是否在列表中以及何时真正渲染按钮。然后,当我有按钮时,我需要检查我点击了哪个 id,并通过这个 id 打开带有重新加载数据的模式。没有名为 table 的组件。 Couse 它只是 dataTable 的东西。 h:CommandButton 有效,但是模态在第二次关闭后不会重新加载模态数据。

【问题讨论】:

    标签: jsf richfaces jsf-1.2 richfaces-modal


    【解决方案1】:

    解决方案是将 dataTable 的类型更改为 rich:dataTable

    【讨论】:

      猜你喜欢
      • 2011-01-12
      • 1970-01-01
      • 1970-01-01
      • 2011-08-31
      • 2011-07-09
      • 1970-01-01
      • 2017-10-04
      • 2014-07-21
      • 1970-01-01
      相关资源
      最近更新 更多