在用户界面输入绑定:重复JSF [英] input binding in ui:repeat in jsf

查看:157
本文介绍了在用户界面输入绑定:重复JSF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JSF的Facelets 2.0 primefaces 3.0.M2组件库。
我试图实现的行数动态时包括一个DataTable选择产生充满iput领域。

i am using facelets jsf 2.0 with primefaces 3.0.M2 component library. i am trying to achieve dynamic numbers of rows including iput fields that are filled when a datatable selection occurs.

每当作出选择与输入字段,但对于正确以下选择动态行计数的变化,但在输入字段不更新第一选择后正确地产生的动态的行,并保持表示从第一选择输入。

whenever a selection is made the dynamic rows generated correctly with input fields but after the first selection for following selections dynamic row count changes correctly but the input fields does not update and keeps showing inputs from the first selection.

这是我如何的facelet迭代名单;

here is how i iterate list in facelet;

<ui:repeat value="#{goalEntranceBean.selectedCard.parameterList}" var="prmBean" >
        <li><h:outputText value="#{prmBean.lookUp.value}"/></li>
        <li>

            <h:outputText value="Weight:"/>
            <p:inputText id="wx" required="true" value="#{prmBean.weight}">
            </p:inputText>
            <h:outputText value="Percent:"/>
            <p:inputText required="true" value="#{prmBean.percent}">
            </p:inputText>
        </li>

    </ui:repeat>

我的豆在那里我得到的卡列表中,并设置在数据表rowSelect事件selectedCard。

my bean where i get the list of cards and set the selectedCard with rowSelect event in datatable.

@ManagedBean(name = "goalEntranceBean")
@ViewScoped
public class GoalEntranceAction implements Serializable {

private List<ScoreCard> personalCards = new ArrayList<ScoreCard>();

    private ScoreCard selectedCard = new ScoreCard();
......
}

当我在调试模式下签,我可以看到真实的名单,但在屏幕上的内容并不会改变。

when i checked in debug mode i can see the true list but in screen the elements does not change.

推荐答案

感谢您的答复。对不起,我忘了分享的解决方案。
正如我上面提到我有primefaces数据表。
在行选择事件我呈现DataTable,并要更新DataTable的细胞。
使用P:inputText的轻松解决我的问题。现在我可以改变屏幕上的数据,我可以在屏幕上看到更新操作之后的值。我不明白的原因,但它的工作原理。

thanks for your replies. Sorry for forget sharing the solution. As i mentioned above i have primefaces datatable. On row selection event i render datatable and want to update the cells of that datatable. USING p:inputtext easily solved my problem. Now i can change the data on screen and i can see the values after update operation on screen. I don't understand the reason but it works.

  <p:dataTable var="orgPrmBean"
                 value="#{scoreCardOperationsBean.selectedCard.orgParameterList}"
                 emptyMessage="#{labels.norecord}"
                 rowKey="#{orgPrmBean.id}"
            >

        <p:columnGroup type="header">
            <p:row>
                <p:column headerText="Parameters" colspan="3" style="text-align:left;width:480;"/>
            </p:row>
        </p:columnGroup>


        <p:column style="text-align:left;width:200px;">
            <h:outputText value="#{orgPrmBean.info}"/>
        </p:column>

        <p:column style="text-align:left;width:180px;">
            <p:inputText value="#{orgPrmBean.weight}"
                         rendered="#{scoreCardOperationsBean.selectedCard.goalEdit}">
                <f:convertNumber maxFractionDigits="0"/>
            </p:inputText>

        </p:column>  

    </p:dataTable>

这篇关于在用户界面输入绑定:重复JSF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆