6

i have an h:inputTextarea with some a4j:support to update the model on demand

<h:inputTextarea rows="15" id="taFreetext" value="#{customInput.value}"
  required="true" 
  onkeyup="textAndLinesCount(#{rich:element('taFreetext')},document.getElementById('msgCounterLines'),20, 64);">
     <a4j:support ajaxSingle="true" event="onchange" />
</h:inputTextarea>

My Problem is, that not only the model in my context is updated, when i press a key, but also the entity is flushed automatically!

the page.xml of this file has flushing-mode to manual

<begin-conversation join="true" flush-mode="manual"/>

i read this post in the Seam Framework forum: Problems with AJAX and update model but this is not really helping. I also had some action in my a4j:support that makes a entityManager.refresh() as written in the post, but then the model and the entity was still on the old state...

Looking forward for some good hints, thanks!

(i use JSF 1.2, RichFaces 3.3.3)

Joergi
  • 1,527
  • 3
  • 39
  • 82
  • can you describe little more? i think you need to use `savestate`. – Jubin Patel Dec 18 '12 at 12:39
  • 1
    @jubinPatel what infos you want exactly? i would like to help you answering the question, if you can tell me, what you kneed more... and: what you mean with `savestate`? – Joergi Dec 18 '12 at 17:22
  • 1
    which entity goes null you mean input textarea value? also provide your JS. and `savestate` mean when full page reload then your backing bean `customInput` generate new object. to preserve last object use `t:savestate`. after `` tag use `` t tag for tomahawk lib. it may resolve problem – Jubin Patel Dec 19 '12 at 05:09
  • we are not using tomahawk lib. no entity goes to null, the problem is, that an update of the model is autospersisting the entity... no save function is called! the setter function is a normal setter function... – Joergi Dec 20 '12 at 10:42
  • Hi @Joerg, are you using a SEAM managed persistance context (@In EntityManager)? Also what is the scope of the customInput bean? – DaveB Mar 21 '13 at 13:38

1 Answers1

0

use reRender attribute for updating the model, what you do is mention the id of that in reRender attribute, you will get the result.

<a4j:support event="onchange" reRender="userRegistrationForm" action="#{UserRegistrationBean.onChangeMenuCountry}"></a4j:support>
UdayKiran Pulipati
  • 6,579
  • 7
  • 67
  • 92