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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:40:02+00:00 2026-06-14T18:40:02+00:00

i have a problem about partial processing. (I use primefaces 3.4.1.) I have a

  • 0

i have a problem about partial processing. (I use primefaces 3.4.1.) I have a dataGrid listing services and each row of the dataGrid has a commandButton, “remove service”, to remove the service.
I remove the specified service from my service list in my backing bean and update the datagrid while “remove service” button is clicked.

Also, i have two buttons in the form;
First button, “add service”, works to add new service; I add a new object to my service list in my backing bean and update the datagrid while “add service” is clicked.
The second, “save”, button works to save all services. When “save button” is clicked, service list is inserted to database.

Btw, i need form validation since there are mandatory fields in my service object. So, the form should be validated while “add service” and “save” are clicked. But, the form
shouldn’t be validated while “remove service” button is clicked. If i use ‘process=”@form”‘ for “remove service” button, everything is ok. I can remove the specified service
from my service list in the backing bean and the datagrid is updated properly. But as u know, since all form is processed, all input components are validated. If i use ‘process=”@this”‘ or ‘immediate=”true”‘ for “remove service” button, i can not reach the last entry. I mean, i cannot reach the last service. I guess it hasn’t been posted yet when i click the “remove service” button.
So, what should i do? Is there any suggestion about this situation? Thanks in advance…

My code is as below;

<h:form id="formServicesTab">
        <h:panelGrid id="pnlSvcTab" columns="1" styleClass="valignTop" width="100%">
            <p:dataGrid id="dgServices" var="service"
                value="#{subMerchantOperations.subMerchantServices}"
                columns="1" width="100%" styleClass="valignTop"
                emptyMessage="#{messagebundle.submerc_grdlabel_no_service}" transient="true"
                rowIndexVar="index" >

                <p:toolbar>
                    <p:toolbarGroup align="left">
                        <p:commandButton id="btnRemoveSvc" onclick="loading.show();"
                            oncomplete="loading.hide();"
                            value="#{messagebundle.submerc_btn_delete_service}"                         
                            actionListener="#{subMerchantOperations.removeService}"                     
                            process="@form" update="@form">

                            <f:setPropertyActionListener target="#{subMerchantOperations.serviceRowIndex}" value="#{index}" />
                        </p:commandButton>                      
                    </p:toolbarGroup>
                </p:toolbar>

                <h:panelGrid columns="3" styleClass="valignTop" width="100%" bgcolor="F0F0F0">
                    <p:panel style="background:#F0F0F0;">
                        <h:panelGrid id="pnlDgSvc" columns="1" width="100%" style="height:100%">
                            <h:outputText value="#{messagebundle.submerc_label_svc_shortName}" />
                            <h:panelGrid columns="2">
                                <p:inputText id="txtSvcName" value="#{service.serviceName}"
                                    required="true" transient="true"
                                    requiredMessage="#{messagebundle.submerc_validation_msg_required}"
                                    converter="UpperCaseConverter" />
                                <p:message for="txtSvcName" display="text" />
                            </h:panelGrid>

                            <h:outputText value="#{messagebundle.submerc_label_svc_website}" />
                            <p:inputText value="#{service.serviceUrl}" transient="true"/>                           
                        </h:panelGrid>
                    </p:panel>

                    <p:panel style="background:#F0F0F0;">
                        <h:panelGrid columns="1" width="100%">
                            ..........
                        </h:panelGrid>
                    </p:panel>

                    <p:panel style="background:#F0F0F0;">
                        <h:panelGrid id="pgSvcFiles" columns="1" width="100%">
                            ...........      
                        </h:panelGrid>
                    </p:panel>
                </h:panelGrid>
            </p:dataGrid>
        </h:panelGrid>
        <p:toolbar style="background:white">
            <p:toolbarGroup align="left">               
                <p:commandButton id="btnAddNewSvc"                  
                    value="#{messagebundle.submerc_btn_addSvc}"                  
                    actionListener="#{subMerchantOperations.addNewService}"
                    process="@form" update="@form" />

                <p:commandButton id="btnSaveSubM"                   
                    value="#{messagebundle.submerc_btn_sendApproval}"                   
                    action="#{subMerchantOperations.saveServices}" 
                    process="@form" update="@form" />
            </p:toolbarGroup>
        </p:toolbar>
    </h:form>

@ManagedBean
@ViewScoped
public class SubMerchantOperations implements Serializable {
    private static final long serialVersionUID = 8556103952857187080L;  

    private List<Service> subMerchantServices = new ArrayList<Service>();
    private int serviceRowIndex;    

    // add new empty service to the service list
    public void addNewService() {
        try {
            Service svc = new Service();
            svc.setStartDate(new Date());
            getSubMerchantServices().add(svc);                      
        }
        catch(Exception ex) {
            if (logger.isEnabledFor(Level.ERROR)) {
                ...
            }           
        }       
    }

    // Remove the specified service using index parameter got from the datagrid
    public void removeService() {
        try {
            getSubMerchantServices().remove(serviceRowIndex);   
        }
        catch(Exception ex) {
            ... 
        }                               
    }

    // DB Operations
    public String saveSubMerchant() {       
        ...
    }

    public List<Service> getSubMerchantServices() {
        return subMerchantServices;
    }

    public void setSubMerchantServices(List<Service> subMerchantServices) {
        this.subMerchantServices = subMerchantServices;
    }
    public int getServiceRowIndex() {
        return serviceRowIndex;
    }

    public void setServiceRowIndex(int serviceRowIndex) {
        this.serviceRowIndex = serviceRowIndex;
    }
}
  • 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-14T18:40:03+00:00Added an answer on June 14, 2026 at 6:40 pm

    I have no idea what that transient attribute is doing on your <p:dataGrid>. I have reviewed the latest published version of the Primefaces PDF documentation and this is not listed as a valid attribute.

    If you are finding that Facelet-based component validation is causing your empty form to fire validation errors on submit of one of your buttons, you might consider creating a method in your backing bean which is called by your submit method, and validates the state of elements on the bean. This is a popular approach with Primefaces, because unlike Seam we are not provided with form-level validation.

    However, do check your understanding of immediate=true.

    Alternatively you might consider annotating your POJO’s properties with JSR303 annotations.

    Since you’re using Collections, ensure that your Service POJO overrides equals and hashcode to rule out that something screwy isn’t going on with your collection and causing your problem.

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

Sidebar

Related Questions

I have a form which, for the sake of isolating the problem, has about
I have a problem about casting a CallableStatement to OracleCallableStatement . It gives ClassCastException
I have a problem about div position relative alignment. I want the second div
I am using MFC CFile Seek function. I have a problem about Seek out
I have a little problem about the sort direction of a specific column in
I have a great problem about the rotation in three.js I want to rotate
I have a little problem about Google Maps. I'm using Geocoding (xml) for getting
I have a little problem about using jQuery (I really do not know jQuery
I have problem adding arraylist to list view, will explain about my problem here..
I have got a strange problem about in_array recently which I cannot understand. e.g.

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.