RichFaces a4j:support parameter passing
Posted
by Mark Lewis
on Stack Overflow
See other posts from Stack Overflow
or by Mark Lewis
Published on 2010-05-11T16:59:21Z
Indexed on
2010/05/11
17:04 UTC
Read the original article
Hit count: 276
Hello
I have a number of rich:inplaceInput
tags in RichFaces which represent numbers in an array. The validator allows integers only. When a user clicks in an input and changes a value, how can I get the bean to sort the array given the new number and reRender the list of rich:inplaceInput
tags so that they're in numerical order?
EG
<a4j:region>
<rich:dataTable value="#{MyBacking.config}" var="feed"
cellpadding="0" cellspacing="0" width="100%" border="0"
columns="5" id="Admin">
...
<a4j:repeat...
<a4j:region id="MsgCon">
<rich:inplaceInput value="#{h.id}"
validator="#{MyBacking.validateID}"
id="andID" showControls="true">
<a4j:support event="onviewactivated" action="#{MyBacking.sort}"
reRender="Admin" />
</rich:inplaceInput>
</a4j:region>
</a4j:repeat>
</data:Table>
</a4j:region>
Note I do NOT want to use dataTable sort functions. The table is complicated and I've specified id="Admin"
(ie the whole table) to reRender
as I've not found a way to send more localised values to the backing bean through the inplaceInput
.
This question is about how to use a4j:support
action attribute to call the sort method so that when the reRender
rerenders the component, it outputs the list in sorted order.
I have the sort method working ok when I click a button to sort, but I want to have the list sorted automatically as soon as a new valid value is entered into the inplaceInput
component.
Thanks
© Stack Overflow or respective owner