-
1. Re: OnEnterkeyPress event call a java method and render the result in the same field
ilya_shaikovsky Aug 25, 2010 2:30 AM (in response to rajendra85)do not make return at all in case when condition value means that request should be fired. any return true or false will prevent ajax call as it performed via js call and return before the call will abort it.
-
2. Re: OnEnterkeyPress event call a java method and render the result in the same field
rajendra85 Aug 27, 2010 8:01 AM (in response to ilya_shaikovsky)Hi I am able to calling the java method by EnterKeypress and able to display the text into console;
Now the problem is i am not able to render the result into JSF page; when im opening other browser then its displaying the formatted text;
What is going over there??? Is reRender is not able to refreshing the page?? or reRender is not working correctly???
Can i get the solution for this problem????Here i am pasting the code i am telling again that its calling java method but not able to display the formatted value into same text field
Its purely facelets problem only; reRender is not working at all
<h:form id="mainForm">
<h:inputText value="#{user.dateEntered}" id="t1">
<a:support event="onkeyup"
action="#{user.changeValue}"
onsubmit="if (event.keyCode != 13) { return false; }"
reRender="t1" />
</h:inputText>
</h:form>Can anybody get me the solution????
-
3. Re: OnEnterkeyPress event call a java method and render the result in the same field
ahoehma Aug 27, 2010 3:48 PM (in response to rajendra85)1 of 1 people found this helpfulTry a <a4j:form ajaxSubmit="true"... instead of a <h:form...
There is "strange" behavior with html / browser / forms with ONLY one inputfield ...
Maybe your problem is the same I had some times ago ... I tried all combinations (IE, FF, form without field, with one field with two fields, ajax , none ajax ...) and at the end I found out ... there is something different for such forms ... I will write a blog about this (if i have some free time *g*) ...
http://ahoehma.wordpress.com/2009/11/16/richfaces-modal-panel-default-formular-action/
Regards
Andreas
-
4. Re: OnEnterkeyPress event call a java method and render the result in the same field
rajendra85 Aug 30, 2010 4:48 AM (in response to ahoehma)Hi Andreas,
First of all 'Thank you very much' for your help, I have struggled for 8 days and finally with your help I achieved it ;
The functionality that has been assigned for me was completed.
I have used that <a4j:form> instead of <h:form> as well as I have used <a:ajaxSubmit="true"> It works for me very well.
I never forget your help!!!! (Becoz its important and urgent for my requirement )
I have seen your link that was awesome for edit and cancel you have used that 'enter keys' and 'escape keys' that was good.
Anyways finally i got perfect solution, Thanks for everyone who helped me on this topic Especially Andreas and IIya .
Thanks to Rich faces forum
Best regards
Rajendra
-
5. Re: OnEnterkeyPress event call a java method and render the result in the same field
rajendra85 Aug 30, 2010 6:50 AM (in response to rajendra85)Hai guys,
I have tried below code its working fine for me OnEnterKeypress. I suggest you to mind two things before using this event
1. Use <a:form> instead if <h:form>
2.Use <a:form ajaxSubmit="true"> that it compulsory otherwise page will not Rerender formatted values into same field.
Here is the code: Enjoy guys
I would like to thank IIya and Andreas for their support. If anyqueries ask me through this discussion.
<a:form id="mainForm" ajaxSubmit="true">
<h:inputText value="#{user.dateEntered}" id="t1">
<a:support event="onkeyup"
action="#{user.changeValue}"
onsubmit="if (event.keyCode != 13) { return false; }"
reRender="t1"
/>
</h:inputText>
</a:form>