-
1. Re: Really need a solution to this problem (dynamically adding entries)
monkeyden Feb 3, 2011 9:52 AM (in response to nraf)Maybe I'm misunderstanding you but, are you using something like this:
[take input] <h:inputText id="username" value="#{myBean.newMessage}"> <a4j:support event="onblur"/> </h:inputText> <a4j:commandButton ajaxSingle="true" action="#{myBean.addMessage}" reRender="myDataTable"> [display messages] <rich:dataTable id="myDataTable" value="#{myBean.messages}" var="message"> ... </rich:dataTable>
to perform the action? Note the
reRender
attribute. As for the latest message on top, that's just a matter of sorting by date on the (re)query or, if you're trying to keep real-time queries to a minimum, the top of the list. -
2. Re: Really need a solution to this problem (dynamically adding entries)
nraf Feb 3, 2011 2:53 PM (in response to nraf)reRender will re-display the entire list, or a subset if using ajaxKeys. It can't add a new row to the datatable, howeve with an entire redraw. If I have 10 messages displayed on screen and the user enters a 11th, I don't want to have to rerender all 10 messages - I want to append that 11th to the screen dynamically without having to do anything (at least on the server-side) to any existing message.
-
3. Re: Really need a solution to this problem (dynamically adding entries)
yahawari Feb 3, 2011 4:30 PM (in response to nraf)when u need this fine level of control, u are better off using javascript and seam remoting.
in richfaces, there is ajaxKeys attribute for data iteration components which reRender certain rows rather than the whole table. for ur usecase, i am not sure what components will do it.
as i said, javascript is good for this scenario :) !