Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8443145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:03:32+00:00 2026-06-10T09:03:32+00:00

I have the following form, that I would like to submit only with my

  • 0

I have the following form, that I would like to submit only with my p:commandButton, however, I am getting submission in all my input boxes, how do I submit a form on p:commandButton only?

<h:form>
            <p:panel header="Lista de Referências" id="panel">
                <h:panelGrid columns="2" cellpadding="5">

                    <h:outputLabel>Referência</h:outputLabel>
                    <p:inputText value="#{entradaProdutoController.referencia}" 
                                 onkeypress="if (event.keyCode == 13) {onchange(); return false; }"> 
                        <f:ajax event="change" 
                                render="textDescri" 
                                listener="#{entradaProdutoController.listener}"/> 
                    </p:inputText>

                    <h:outputLabel>Descrição</h:outputLabel>
                    <h:outputText id="textDescri" value="#{entradaProdutoController.replyWith}" /> 

                    <h:outputLabel>Quantidade</h:outputLabel>
                    <p:inputText size="5" value="#{entradaProdutoController.quantidade}" />

                </h:panelGrid>
            </p:panel>
            <p:commandButton value="Adicionar" update="printTable" actionListener="#{entradaProdutoController.addAction(event)}">
            </p:commandButton>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:03:34+00:00Added an answer on June 10, 2026 at 9:03 am

    Tired the above suggestions with no successful results, so as a workaround this is what I am doing, this is probably not a best practice but it works(the hammering way of doing this):

    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:p="http://primefaces.org/ui"
          xmlns:f="http://java.sun.com/jsf/core"
          >
        <h:head>
            <title>Facelet Title</title>
        </h:head>
        <h:body>
            <h1>Adicionar Referências</h1>
            <h:form id="formID" onkeypress="if (event.keyCode == '13') {return false;}">
                <h:outputLabel>Referência</h:outputLabel>
                <h:inputText  id="referenciaLoookup" value="#{testController.referencia}"
                              onkeypress="if (event.keyCode == '13') {document.getElementById('formID:testeButton').click()}"
                              > 
                </h:inputText>
    
                <h:inputText value="#{testController.referencia}" 
                             onkeypress="if (event.keyCode == 13) { onchange(); return false; }">
                    <f:ajax event="change" listener="#{testController.teste(event)}" />
                </h:inputText>
    
    
                <p:commandButton id="lookup" value="lookup"
                                 actionListener="#{testController.listener(a)}"/>
    
                <p:commandButton id="adicionar" value="Adicionar" 
                                 actionListener="#{testController.addAction(e)}">
                </p:commandButton>
    
                <p:commandButton id="testeButton" value="teste" style="visibility: hidden;"
                                 actionListener="#{testController.teste(event)}"/>
            </h:form>
        </h:body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple html form that looks like the following <form action=search.php method=get>
Lets say that you have a following simple application: <form action=helloServlet method=post> Give name:<input
I have the following list that is dynamically generated. I would like the ability
I have XML in the following form that I want to parse with PHP
I have the following paint event (form) that is drawing the rectangle: void LogicSimulationViewerForm_Paint(object
I have the following form in a Struts2 JSP that contains some radio buttons.
I'm looking at some Java classes that have the following form: public abstract class
I have a following problem, I have HTML form that uploads a file with
i have the following if-clause: if(empty($var)){ $errors[]=Failure; } this is for a form that
I have a form that takes the following inputs: Name: IBM Surface(in m^2): 9

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.