-
1. Re: How to stop page refresh when hit enter button from rich:inputNumberSpinner field?
ilya_shaikovsky Jun 10, 2010 3:53 AM (in response to eswaramoorthy1985)update version to RF 3.3.3 Final and then could remove any specific handlers.
-
2. Re: How to stop page refresh when hit enter button from rich:inputNumberSpinner field?
eswaramoorthy1985 Jun 10, 2010 9:44 PM (in response to ilya_shaikovsky)Thanks for your response.
Now i add latest JSF richface 3.3.3 final jar files in my project. I use netbeans IDE 6.7.1.
The jar files are :
1. richfaces-api-3.3.3.Final.jar
2. richfaces-impl-3.3.3.Final.jar
3. richfaces-impl-jsf2-3.3.3.Final.jar
4. richfaces-ui-3.3.3.Final.jar
Is this right jar files i am using?
But the page refreshed when i hit enter button from inputNumberSpinnerField.(After set the cursor focus this field).
-
3. Re: How to stop page refresh when hit enter button from rich:inputNumberSpinner field?
ilya_shaikovsky Jun 11, 2010 5:04 AM (in response to eswaramoorthy1985)remove 3. richfaces-impl-jsf2-3.3.3.Final.jar
it should be only one impl for corresponding JSF impl.
And refresh browser cache in order new scripts to be fetched.
-
4. Re: How to stop page refresh when hit enter button from rich:inputNumberSpinner field?
eswaramoorthy1985 Jun 14, 2010 6:31 AM (in response to ilya_shaikovsky)Hi,
I remove richfaces-impl-jsf2-3.3.3.Final.jar.
And i clear browser cache.
But page refreshed when i click enter button from inputspinnerNumber field.
But in my sample project have the following jars.
1. commons-beanutils-1.7.0.jar
2. commons-collections-3.2.jar
3. commons-digester-1.8.jar
4. commons-logging-api-1.0.4.jar
5. jhighlight-1.0.jar
And Latest JSF RichFaces 3.3.3 Final jar files.
The above 5 jar files are raise any problem?
If i want to make any steps?
Otherwise , the page refreshing for that tag is default?
-
5. Re: How to stop page refresh when hit enter button from rich:inputNumberSpinner field?
ilya_shaikovsky Jun 15, 2010 7:06 AM (in response to eswaramoorthy1985)please visit http://livedemo.exadel.com/richfaces-demo/richfaces/inputNumberSpinner.jsf.
I can't reproduce there and environment is the same as you described. I checked in IE 8 FF 3.6, Chrome.
-
6. Re: How to stop page refresh when hit enter button from rich:inputNumberSpinner field?
eswaramoorthy1985 Jun 16, 2010 9:26 PM (in response to ilya_shaikovsky)Hi Ilya Shaikovsky,
Ya. I check it. The following code work.
<a4j:form ajaxSubmit="true"> <rich:inputNumberSpinner value="50" step="10"/> </a4j:form>
Its worked. Page not refreshed when i hit enter button form rich:inputNumerSpiiner field.
But the following code is not worked.
<h:form> <rich:inputNumberSpinner value="50" step="10"/> </h:form>
Its not worked.That is: Page refreshed when i hit enter button from rich:inputNumberSpinner field.
I would like to know reason for :
why page not refresh when i use <a4j:form/>? and
why page refresh when i use <h:form/>?
Any one tell about the reason.
Thanks for your support.
-
7. Re: How to stop page refresh when hit enter button from rich:inputNumberSpinner field?
ilya_shaikovsky Jun 18, 2010 9:54 AM (in response to eswaramoorthy1985)At first thanks for your patience! Need to admit that I wored with wrong sample while talking that things are fine :/
with a4j:form it actually also sends request. But as AjaxSbumit set to true - it's ajax request :/ so you just not see it. But it still has and could be a problem in some cases.
I checked and see the behavior you talking about..
But there is one more bad news.. for some reason the spinner was providden with autocompletion feature when "required" (adds first available value if empty) with using that code in script
if (e.keyCode == 13){if (this.spinner.required || "" != this.edit.value)this.edit.value = this.getValidValue(this.edit.value);if (this.edit.form) {this.edit.form.submit();}}so hotKey will not helps.. and I'm afraid it's even handlers also so could only propose to play with form onsubmit and checking targets from events (if input - stop the submit)1
This is definitelly a bug(I just believed that it was fixed as we talked about it in the past) and I will look into jira again and create if not present.
-
10. Re: How to stop page refresh when hit enter button from rich:inputNumberSpinner field?
andrey.chorniy Nov 10, 2010 10:26 AM (in response to ilya_shaikovsky)Hi Ilya, I also don't understand why we need to make a form-submit on enter, especially non-configurable,
if that functionality is needed for somebody - he can define his own onkeypressed to submit the form or to execute particular JSF action - this approach is more configurable.
I also have to deal with that issue and don't find anything more reasonable (and workable) than just disable this submit in richfaces code and rebuild richfaces-ui.jar. I was not able to deal with it in form.onsubmit() method
If somebody want the patched version - you can download it from http://www.4shared.com/file/uZcc2zFx/richfaces-ui-333Final.html
But actually you will feel much more safe if you will do it yourself - you can see the details in the
http://achorniy.wordpress.com/2010/11/06/disable-enter-form-submit-fix-inputnumberspinner/
In short - I just commented out this.edit.form.submit(); and rebuild richfaces-ui.jar
-
11. Re: How to stop page refresh when hit enter button from rich:inputNumberSpinner field?
ilya_shaikovsky Nov 10, 2010 3:18 PM (in response to andrey.chorniy)Agree that it's really weird issue The implementor has in mind that pressing Enter - submits form so after validation of input he directly performed that... It's not good but we can't do something for now except providing workaround
So thanks for all your efforts!! I will convert your post to FAQ entry
-
12. Re: How to stop page refresh when hit enter button from rich:inputNumberSpinner field?
nickleus Aug 19, 2013 6:02 AM (in response to ilya_shaikovsky)i've posted a simple workaround fix for this here: richfaces rich:inputNumberSpinner - how to disable form submit on enter key press
-
13. Re: How to stop page refresh when hit enter button from rich:inputNumberSpinner field?
stupserich Apr 9, 2014 6:06 AM (in response to ilya_shaikovsky)Hi Ilya,
has this ever been fixed. I still suffer from this behaviour in 4.3.4.Final ?
Thanks for your support!