运行我的应用程序时收到以下错误:
<f:ajax> Unable to attach <f:ajax> to non-ClientBehaviorHolder parent
Run Code Online (Sandbox Code Playgroud)
我的JSF:
<h:commandButton id="submitschool" action="submit" value="Get templates" style="FONT-SIZE: medium;FONT-FAMILY: 'Rockwell';width : 128px; height : 24px;">
<ui:repeat value="#{person.theImage}" var="item">
<f:ajax event="change" render="image" />
<h:graphicImage id="image" value="#{item}"/>
</ui:repeat>
</h:commandButton>
Run Code Online (Sandbox Code Playgroud)
我正在尝试将数组中的元素返回到视图,其中"theImage"是person类中的数组.
Bal*_*usC 17
该<f:ajax>标签只能直接嵌套在UIComponent它实现了ClientBehaviorHolder接口.这<ui:repeat>不是其中之一.
单击javadoc链接,它会告诉以下内容:
所有已知的实现类:
HtmlBody,HtmlCommandButton,HtmlCommandLink,HtmlDataTable,HtmlForm控件,HtmlGraphicImage,HtmlInputSecret,的HtmlInputText,HtmlInputTextarea,HtmlOutcomeTargetButton,HtmlOutcomeTargetLink,HtmlOutputLabel,HtmlOutputLink,HtmlPanelGrid,HtmlSelectBooleanCheckbox,HtmlSelectManyCheckbox,HtmlSelectManyListbox,HtmlSelectManyMenu,HtmlSelectOneListbox,HtmlSelectOneMenu,HtmlSelectOneRadio
从你的问题不清楚你的意图是什么,所以我不能给出一个更具体的答案,而不是建议摆脱<f:ajax>这个背景.它不属于那里.也许你的意思是把它直接放在<h:commandButton>(类型HtmlCommandButton)中,但是你需要更改change事件,因为它对于<input type="submit">生成的事件没有意义<h:commandButton>.
我想你也想把它<ui:repeat>从那里移出来<h:commandButton>,这也没有多大意义.把它放在旁边<h:commandButton>而不是嵌套在里面.
| 归档时间: |
|
| 查看次数: |
18126 次 |
| 最近记录: |