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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:12:12+00:00 2026-06-07T01:12:12+00:00

In my application, I have some dialogs with dataTables that user can edit values,

  • 0

In my application, I have some dialogs with dataTables that user can edit values, so I’m using primefaces rowEditor… Sometimes I have required fields in dataTable as you can see in this screen:

dataTable with required fields

In this screen, the user isn’t required to fill all rows, so, if I put required=true, all fields including the ones that are deactive, show required validation message. This way if the user clicks on OK button, he can’t close the popup cause there is a lot of required fields validation error.
I tried use a parameter in required attribute this way:

<f:facet name="input">
    <h:selectOneMenu value="#{cfop.idTipoTributacao}" required="#{param['EDITAVEL']}"
                                             style="width: 100px;">
        <f:selectItems value="#{selectTipoTributacao.itens}"/>
    </h:selectOneMenu>
</f:facet>

but unfortunately I didn’t found a way to pass this parameter when user clicks on save button of p:rowEditor.
Is there a way I can make these fields required only when they are in edit mode?? I’m usgin primefaces 2.2.1 with MyFaces

  • 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-07T01:12:15+00:00Added an answer on June 7, 2026 at 1:12 am

    I solved the problem creating my own composite component… This way I have more control over when validation happens.

    cellEditor:

    <c:interface>
        <c:attribute name="id" required="false" targets="celula"/>
        <c:attribute name="desabilitado" required="false" default="true"/>
        <c:facet name="entrada" required="true"/>
        <c:facet name="saida" required="true"/>
    </c:interface>
    <c:implementation>
        <h:panelGroup id="celula" layout="block" styleClass="hrgi-celula">
            <h:panelGroup layout="block" styleClass="hrgi-celula-entrada" style="display: none">
                <c:renderFacet name="entrada" required="true"/>
            </h:panelGroup>
            <h:panelGroup layout="block" styleClass="hrgi-celula-saida">
                <c:renderFacet name="saida" required="true"/>
            </h:panelGroup>
        </h:panelGroup>
    </c:implementation>
    

    rowEditor:

    <c:interface>
        <c:attribute name="action" method-signature="void method(java.lang.Object)"/>
        <c:attribute name="indice" required="true"/>
        <c:attribute name="update" required="false" default=""/>
    </c:interface>
    <c:implementation>
        <h:outputScript library="js" name="hrgiRowEditor.js" target="head"/>
        <h:panelGroup layout="block">
            <h:panelGroup id="painelBotaoEdicao" layout="block" style="display: inline">
                <h:graphicImage library="img" name="pencil.png" onclick="ativarCamposEditaveis('#{cc.clientId}');"
                            style="cursor: pointer;"/>
            </h:panelGroup>
            <h:panelGroup id="painelBotoesSalvamento" layout="block" style="display: none">
                <h:commandLink id="botaoSalvar" style="float: left;" onclick="definirIdRowEditor('#{cc.clientId}')">
                    <h:graphicImage library="img" name="check.png"/>
                    <f:param name="#{cc.attrs.indice}" value="true"/>
                    <p:ajax event="click" update="@form #{cc.attrs.update}" process="@form" listener="#{cc.attrs.action}"
                        oncomplete="desativarCamposEditaveisQuandoSucesso(xhr, status, args, this);"/>
                </h:commandLink>
                <h:graphicImage library="img" name="cancel.png" style="float: left; cursor: pointer;"
                            onclick="desativarCamposEditaveis('#{cc.clientId}');">
                </h:graphicImage>
            </h:panelGroup>
        </h:panelGroup>
    </c:implementation>
    

    the only problem is that I can’t update just one row in table… Perhaps I will create another component…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just want to know that can i make an application which have some
In my WPF application I have some drawing functionality. I have solved this using
I have a solution that is deployed using ClickOnce. It consists of an application,
Okay basically I have an MFC application with lots of dialogs that need to
We have a ton of features in our application that can be described very
In my application,i have some .strings files.And on a button click,which is on my
In my Python application I have some GtkMenuItems (associated with the main GtkMenuBar), and
in my application i have some tinymce editors and the userinput is shown with
In my Java application I have some copy-constructors like this public MyClass(MyClass src) {
I have a VC++ application and in my application i have some basic file

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.