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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:41:35+00:00 2026-06-04T04:41:35+00:00

I want to be able to delete a user from my DB. The interface

  • 0

I want to be able to delete a user from my DB. The interface has something like the following code, but the action method never gets called. What am I missing?

        <h:form id="formAdministracionUsuarios">
            <br/>
            <rich:panel style="width: 800px">
                <f:facet name="header">
                    <h:outputText value="Administración de usuarios"/>
                </f:facet>

                <rich:dataScroller for="usersTable" fastControls="hide"
                                   boundaryControls="hide" />
                <h:panelGroup/>
                <rich:dataTable id="usersTable" rows="10" var="user"
                                value="#{administrationBean.tablaUsuarios}">
                    <f:facet name="header">
                        <rich:columnGroup>
                            <rich:column>
                                <h:outputText value="Nombre"/>
                            </rich:column>
                            <rich:column>
                                <h:outputText value="Usuario"/>
                            </rich:column>
                            <rich:column>
                                <h:outputText value="Dependencia"/>
                            </rich:column>
                            <rich:column>
                                <h:outputText value="Email"/>
                            </rich:column>
                            <rich:column>
                                <h:outputText value="Tipo usuario"/>
                            </rich:column>
                            <rich:column>
                                <h:outputText value="Tipo dependencia"/>
                            </rich:column>
                            <rich:column>
                                <h:outputText value="Fecha límite"/>
                            </rich:column>
                            <rich:column>
                                <h:outputText value="Eliminar"/>
                            </rich:column>
                        </rich:columnGroup>
                    </f:facet>
                    <rich:column>
                        <h:outputText value="#{user.nombre}"/>
                    </rich:column>
                    <rich:column>
                        <h:outputText value="#{user.usuario}"/>
                    </rich:column>
                    <rich:column>
                        <h:outputText value="#{user.dependencia}"/>
                    </rich:column>
                    <rich:column>
                        <h:outputText value="#{user.correo}"/>
                    </rich:column>
                    <rich:column>
                        <h:outputText value="#{user.tipoUsuario}"/>
                    </rich:column>
                    <rich:column>
                        <h:outputText value="#{user.tipoDependencia}"/>
                    </rich:column>
                    <rich:column>
                        <h:outputText value="#{user.fechaLimiteCarga}"/>
                    </rich:column>
                    <rich:column>
                        <a4j:commandLink value="Eliminar" execute="@form"
                                         action="#{administrationBean.doEliminarUsuario(user.usuario)}"/>
                    </rich:column>
                </rich:dataTable>
                <a4j:outputPanel>
                    <br/><br/>
                    <fieldset>                                
                        <legend>Datos del usuario</legend>
                        <h:panelGrid id="camposUsuario" columns="2">
                            <h:outputLabel value="Nombre" for="queryNombre"/>
                            <h:outputLabel value="Usuario" for="queryUsuario"/>
                            <h:inputText id="queryNombre" required="true"
                                         requiredMessage="Introduzca el nombre." immediate="true"
                                         value="#{administrationBean.queryNombre}">
                                <f:ajax event="keypress" 
                                        listener="#{administrationBean.doClearMessages}"
                                        render="datosUsuario"/>
                            </h:inputText>
                            <h:inputText id="queryUsuario" required="true"
                                         requiredMessage="Introduzca el nombre de usuario."
                                         value="#{administrationBean.queryUsuario}">
                            </h:inputText>                                
                            <rich:message ajaxRendered="true" for="queryNombre"/>
                            <rich:message ajaxRendered="true" for="queryUsuario"/>

                            <h:outputLabel value="Contraseña:" for="queryContrasena"/>
                            <h:outputLabel value="Dependencia:" for="queryDependencia"/>
                            <h:inputSecret id="queryContrasena" required="true"
                                           requiredMessage="Introduzca la contraseña."
                                           value="#{administrationBean.queryContrasena}"/>
                            <rich:select id="queryDependencia" required="true"
                                         requiredMessage="Seleccione la dependencia."
                                         defaultLabel="Dependencia..."
                                         value="#{administrationBean.queryDependencia}">
                                <f:selectItems value="#{administrationBean.selectDependencia}"/>
                            </rich:select>
                            <rich:message ajaxRendered="true" for="queryContrasena"/>
                            <rich:message ajaxRendered="true" for="queryDependencia"/>                                

                            <h:outputLabel value="Correo" for="queryCorreo"/>
                            <h:outputLabel value="Fecha límite:" for="queryFechaLimite"/>
                            <h:inputText id="queryCorreo" required="true"
                                         requiredMessage="Introduzca el correo."
                                         value="#{administrationBean.queryCorreo}"/>
                            <rich:calendar id="queryFechaLimite" datePattern="dd/MM/yyyy"
                                           value="#{administrationBean.queryFechaLimite}"/>
                            <rich:message ajaxRendered="true" for="queryCorreo"/>

                        </h:panelGrid>
                        <h:panelGrid columns="3">
                            <a4j:commandButton value="Agregar" execute="@form"
                                               render="datosUsuario usersTable camposUsuario"
                                               action="#{administrationBean.doRegistrarUsuario}"/>
                        </h:panelGrid>
                        <a4j:outputPanel id="datosUsuario" style="font-size: 14px; color: #D17100">
                            <h:outputText rendered="#{administrationBean.alreadyRegistered}"
                                          value="Usuario ya existe !"/>
                            <h:outputText rendered="#{administrationBean.registrationComplete}"
                                          value="Usuario registrado !"/>
                        </a4j:outputPanel>
                    </fieldset>
                </a4j:outputPanel>
            </rich:panel>

            <br/>
        </h:form>

UPDATE
Post the code of the complete form.

  • 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-04T04:41:37+00:00Added an answer on June 4, 2026 at 4:41 am

    I found it.
    The whole form includes the dataTable stuff and the registration of a new user stuff, i.e. inputFields.

    What was happening was that when the method in the h:commandLink was getting called the action wasn’t fired because of the required attributes set to true in the inputFields.

    What I did was to separate in two forms my stuff, first form dataTable related stuff and second form InputFields stuff

    With that I avoid the required attributes in the inputFields and so the action method in the commandLink now is being called.

    Here’s what it looks like now:

                <h:form id="formUsuariosRegistrados">
                    <rich:dataScroller for="usersTable" fastControls="hide"
                                       boundaryControls="hide" />
                    <rich:dataTable id="usersTable" rows="10" var="user"
                                    value="#{administrationBean.tablaUsuarios}">
                        <f:facet name="header">
                            <rich:columnGroup>
                                <rich:column>
                                    <h:outputText value="Nombre"/>
                                </rich:column>
                                <rich:column>
                                    <h:outputText value="Usuario"/>
                                </rich:column>
                                <rich:column>
                                    <h:outputText value="Dependencia"/>
                                </rich:column>
                                <rich:column>
                                    <h:outputText value="Email"/>
                                </rich:column>
                                <rich:column>
                                    <h:outputText value="Tipo usuario"/>
                                </rich:column>
                                <rich:column>
                                    <h:outputText value="Tipo dependencia"/>
                                </rich:column>
                                <rich:column>
                                    <h:outputText value="Fecha límite"/>
                                </rich:column>
                                <rich:column>
                                    <h:outputText value=""/>
                                </rich:column>
                            </rich:columnGroup>
                        </f:facet>
                        <rich:column>
                            <h:outputText value="#{user.nombre}"/>
                        </rich:column>
                        <rich:column>
                            <h:outputText value="#{user.usuario}"/>
                        </rich:column>
                        <rich:column>
                            <h:outputText value="#{user.dependencia}"/>
                        </rich:column>
                        <rich:column>
                            <h:outputText value="#{user.correo}"/>
                        </rich:column>
                        <rich:column>
                            <h:outputText value="#{user.tipoUsuario}"/>
                        </rich:column>
                        <rich:column>
                            <h:outputText value="#{user.tipoDependencia}"/>
                        </rich:column>
                        <rich:column>
                            <h:outputText value="#{user.fechaLimiteCarga}"/>
                        </rich:column>
                        <rich:column>
                            <a4j:commandLink value="Eliminar"
                                             render="@form :formFechaLimite :formModificarContrasena"
                                             actionListener="#{administrationBean.doEliminarUsuario(user.usuario)}"/>
                        </rich:column>
                    </rich:dataTable>
                </h:form>
    
                <br/>
    
                    <h:form id="formRegistroUsuarios">
                        <a4j:outputPanel>
                            <br/><br/>
                            <fieldset style="width: 350px" >
                                <legend>Datos del usuario</legend>
                                <h:panelGrid id="camposUsuario" columns="2">
                                    <h:outputLabel value="Nombre" for="queryNombre"/>
                                    <h:outputLabel value="Usuario" for="queryUsuario"/>
                                    <h:inputText id="queryNombre" required="true"
                                                 requiredMessage="Introduzca el nombre." immediate="true"
                                                 value="#{administrationBean.queryNombre}">
                                        <f:ajax event="focus" 
                                                listener="#{administrationBean.doClearMessages}"
                                                render="registroCompletado"/>
                                    </h:inputText>
                                    <h:inputText id="queryUsuario" required="true"
                                                 requiredMessage="Introduzca el nombre de usuario."
                                                 value="#{administrationBean.queryUsuario}">
                                    </h:inputText>                                
                                    <rich:message ajaxRendered="true" for="queryNombre"/>
                                    <rich:message ajaxRendered="true" for="queryUsuario"/>
    
                                    <h:outputLabel value="Contraseña:" for="queryContrasena"/>
                                    <h:outputLabel value="Dependencia:" for="queryDependencia"/>
                                    <h:inputSecret id="queryContrasena" required="true"
                                                   requiredMessage="Introduzca la contraseña."
                                                   value="#{administrationBean.queryContrasena}"/>
                                    <rich:select id="queryDependencia" required="true"
                                                 requiredMessage="Seleccione la dependencia."
                                                 defaultLabel="Dependencia..."
                                                 value="#{administrationBean.queryDependencia}">
                                        <f:selectItems value="#{administrationBean.selectDependencia}"/>
                                    </rich:select>
                                    <rich:message ajaxRendered="true" for="queryContrasena"/>
                                    <rich:message ajaxRendered="true" for="queryDependencia"/>                                
    
                                    <h:outputLabel value="Correo" for="queryCorreo"/>
                                    <h:outputLabel value="Fecha límite:" for="queryFechaLimite"/>
                                    <h:inputText id="queryCorreo" required="true"
                                                 requiredMessage="Introduzca el correo."
                                                 value="#{administrationBean.queryCorreo}"/>
                                    <rich:calendar id="queryFechaLimite" datePattern="dd/MM/yyyy"
                                                   value="#{administrationBean.queryFechaLimite}"/>
                                    <rich:message ajaxRendered="true" for="queryCorreo"/>
    
                                </h:panelGrid>
                                <h:panelGrid columns="3">
                                    <a4j:commandButton value="Agregar" execute="@form"
                                                       render="registroCompletado :formUsuariosRegistrados camposUsuario :formFechaLimite :formModificarContrasena"
                                                       action="#{administrationBean.doRegistrarUsuario}"/>
                                </h:panelGrid>
                                <a4j:outputPanel id="registroCompletado" style="font-size: 14px; color: #D17100">
                                    <h:outputText rendered="#{administrationBean.alreadyRegistered}"
                                                  value="Usuario ya existe !"/>
                                    <h:outputText rendered="#{administrationBean.registrationComplete}"
                                                  value="Usuario registrado !"/>
                                </a4j:outputPanel>
                            </fieldset>
                        </a4j:outputPanel>
                    </h:form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to delete a User, but a User has a
I want to be able to edit and delete resources myself, but not allow
Say if you want to allow a user to be able to delete some
I need to be able to delete a user account from a database on
I'd like the user to be able to remove an item from a list
In my app I want the user to be able to untag himself from
Want to be able to provide a search interface for a collection of objects
I want to be able to email a report daily from a glpi database
I want to be able to invoke an SSIS package at will from a
i want the EidtText to stop accepting input from the user if the input

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.