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 6854849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:41:06+00:00 2026-05-27T01:41:06+00:00

I have an IceFaces form with several HtmlCommandButtons on it. I have some input

  • 0

I have an IceFaces form with several HtmlCommandButtons on it. I have some input fields that have attached validators. The validation works well, but runs and blocks the process even if I press buttons different than the submit one. Logical because all my buttons are basically the same. The question is: how to distinguish between the buttons from the aspect of validation?

I cannot provide XHTML snippet because my form is build dynamically from Java code. The buttons are created this way:

    HtmlCommandButton comp = new HtmlCommandButton();
    comp.setId("btn" + StringUtil.toId(label) + "_" + action);
    comp.setTitle(label);
    comp.setValue(label);
    comp.setStyleClass("commandexbutton commandexbutton-" + StringUtil.toId(label));
    comp.addActionListener(JSFBuilderHelper.createActionListener(getActionListenerStr()));
    comp.setPartialSubmit(true);
  • 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-05-27T01:41:06+00:00Added an answer on May 27, 2026 at 1:41 am

    At simplest, you could set the UICommand component’s immediate attribute to true. It will then skip the processing of UIInput components which does not have this attribute to true.

    comp.setImmediate(true);
    

    For a detailed explanation of the usage of this attribute, see the 2nd half of this answer.

    If that’s not an option, then your best bet is to put the cancel button in a separate form so that it effectively ends up like:

    <h:form>
        input fields 
        submit button
    </h:form>
    <h:form>
        cancel button
    </h:form>
    

    If that’s also not an option due to design/layout restrictions (read: not fixable by just CSS/JS), then you basically need to check in every validator which button is been pressed. You could check that by the presence of the button’s client name (ID) in the request parameter map. For example, as component’s attribute:

    required="#{not empty param['formId:submitButtonId']}"
    

    or

    required="#{empty param['formId:cancelButtonId']}"
    

    or in the beginning of the validator’s validate() method:

    if (externalContext.getRequestParameterMap().get("formId:submitButtonId") == null) {
        return; // Skip validation when normal submit button is not pressed.
    }
    

    or

    if (externalContext.getRequestParameterMap().get("formId:cancelButtonId") != null) {
        return; // Skip validation when cancel button is pressed.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a IceFaces-form and several input fields. Let's say I have this: <ice:selectOneMenu
I have a JSF/ICEFaces application that was working fine but all of the sudden
Posting this one for a friend. They have an Icefaces app that uses Icefaces's
I am quite new to ICEfaces but already have experience with JSF/Facelets and the
I have a complex ICEFaces XHTML page that renders certain components conditionally, based on
I have a question about styling Icefaces. I have a minimal application that can
I'm using JSF/ICEFaces. I have a table that have many rows with values and
I have multiple drop down menus with my JSF/ICEFaces application that update each others
i intend to use IceFaces with spring framework and i have some questions, before
i have a strange problem. I have an ICEFaces(1.8.2) + Facelets application im working

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.