Is it possible to fire action,actionListener of a <p:commandButton> with attribute type="button". I have a requirement where in a form there are text boxes and command buttons. If I press enter in any text box then commandButton is invoked. So I change all command buttons type to "button". Now problem I am facing that command button's action, actionListener not firing.I want to solve it with out using java script. Also I read this This Link. Can any one tell me where I should edit or change to get expected output. Thanks.
<p:commandButton>'s action listener not firing with attribute type="button"
1.1k Views Asked by Diganta At
1
There are 1 best solutions below
Related Questions in JSF-2
- JSF 2 Primefaces : On Ajax reponse I can see extra updates sent by server <update id="javax.faces.Resource"> and which cause my action skipped
- Understanding HTTP sessions in JSF as session attributres are going null unexpectedly while working actively on the application
- How to clear data from datatable using primefaces and java
- CDI Interceptor fires BEFORE HttpAuthenticationMechanism validates request
- JSF user lockout after X failed login attempts
- JSF ExceptionHandler - Response already committed in some cases
- Why am I getting Class NotFound Exception using data table with jsf
- Java Beans - how to ignore boolean isXXXXMethod in favor of BOOLEAN getXXXXMethod in JSF page?
- Input element created with h:inputText is not editable
- NullPointerException during initFaces of a MyFaces 2.0 application while migrating from WLS to Tomcat
- Primefaces 10 HTML styling in DataTable emptyMessage
- jsf2, primefaces 11, Component ID j_idt20 has already been found in the view
- Hide rows of datatable based on condition in JSF2
- How to generate and preview a presigned url of a file in jsf?
- commandLink action parameter not displayed in JSF2
Related Questions in PRIMEFACES
- primefaces component id not found in update
- LazyDataModel, custom filter with search button
- How to use SelectManyCheckbox with ArrayList as HashMap value
- Primefaces DataTable RowGroup with HeaderRow : how to reverse order?
- SelectManyCheckbox returns array of Object[] instead of ArrayList
- My dialog component on PrimeFaces can't render a list on first click
- Why print result is blank?
- PrimeFaces centering searchbar on menubar
- Is there an already-made template project using Spring, JSF, PrimeFaces, SOAP and MySQL?
- Frozen Columns in JSF Primefaces
- Slow page load after updating primefaces(-extension) from 6.2 to 8
- WildFly primefaces Fileupload customization (Encrypted tempFile)
- DuplicateIdException - myfaces 3.02, primefaces 13.0.0, TomEE 9.1
- Removing Axis Below Bars in Horizontal Bar Chart using PrimeFaces V8 HorizontalBarChartModel, JSF
- Primefaces dataTable reset after Submit button click
Related Questions in COMMANDBUTTON
- VBA Word changing command button properties prevents closing without save prompt
- How to delete row from excel sheet using command button and listbox selection
- Userform command button to delete selected row stopped working - getting errors when attempting to fix
- The use of CommandButton Shape into a form locks the navigation bar
- Have to click twice to go back to previous screen
- Excel Form Listbox VBA: how to sort last date and time entry
- Slow the time it takes to activate a MS Word VBA commandbutton click() when the mouse is hovered over it
- VBA USERFORM BUTTON CAPTION COLOR / NONUNIFORM
- Compile error: Argument not optional on CommandButton_Click
- Copying only one column of Userform ListBox data to single cell in separate spreadsheet with commas separating data
- Import data from and old sheet to an actual sheet, but the macro button from the old sheet is getting copy to, but I can´t remove it
- Hide command button for printing
- How to make counting the cells with button in Excel, VBA?
- How to copy rows from one worksheet into a table in another worksheet without overwriting the data
- Copy rows to a new sheet using command button
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Using
type="button"is the wrong solution to prevent enter key from submitting the form. It basically changes the submit button to a dead button which does not submit the form and is only useful for attaching JavaScriptonclickand likes. You're simply facing the consequences of this wrong solution. You should not try to fix it, but take a step back and solve the initial problem the right way.One of the ways is:
Or, more generically, with jQuery, which skips textareas from the restriction:
Note: jQuery is already bundled in PrimeFaces, you do not need to install any scripts separately. Also note that you really can't go around JavaScript here. Even more, PrimeFaces/ajax components rely on JavaScript and wouldn't work anyway without JavaScript.