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

The Archive Base Latest Questions

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

I created this example of JSF button with question dialog: <!– hidden button –>

  • 0

I created this example of JSF button with question dialog:

<!-- hidden button -->
<h:commandButton id="deleterow" value="HiddenDelete"  action="#{AccountProfileTabGeneralController.saveData}" style="display:none" update="growl">
    <f:ajax render="@form" execute="@form"></f:ajax>
</h:commandButton>

<!-- edit button -->
<h:button style="position:absolute; bottom:12px; right:12%;" rendered="#{AccountProfileTabGeneralController.editable}" styleClass="lbimage" value=" Save Account " onclick="editdialog(this, 'Do you want to save the changes?'); return false;" />

I use this JS to display the dialog:

function editdialog(button, a){      
    $("<div />", {
        text: a
    }).dialog({        
        width: 600,
        buttons: {
            "Ok": function() { 
                $("#form\\:deleterow").click();
                $(this).dialog("close");
                button.value = "Processing...";
                button.disabled = true;                  
            }, 
            "Cancel": function(event) { 
                $(this).dialog("close");
                event.preventDefault();
                button.value = "Save Account";
                button.disabled = false;
            } 
        }
    });         
}

But for some reason then I click OK button the button is disabled and it’s not working maybe the id of the form is not correct. I use this <h:form id="general">

How I can fix the problem? And also how I can use the code in forms with different id’s?

  • 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-13T18:04:16+00:00Added an answer on June 13, 2026 at 6:04 pm

    If you have the form’s id as “general”, the jQuery selector should probably be

    $("#general\\:deleterow")
    

    but as you pointed out, you may have different forms, so that selector is very specific.

    I would think you’d want something like:

    $(button).closest("form").find("[id$=deleterow]").click();
    

    What this does is find the first parent form element of the button that initiated the editDialog function, then find any element inside of that form that has an id that ends with “deleterow”. This should work, since the id of that element will be something like “form_id:deleterow”.

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

Sidebar

Related Questions

I want to implement Prime Faces example I created this JSF page: <?xml version='1.0'
I created this example The remove function doesn't work, and I can't figure out
I've created this simple example program, but this doesn't work. it won't connect. any
I created a duplex service ( NetTcpBinding ) like this example : I used
I created a simple application inspired by this example in order to test all
I have a loop created with each, check this example: $('.foo').each(function(i){ //do stuff });
For example I now created a this tiny class: public static class FileSystemInfoComparers<T> where
Just created an acc on SO to ask this :) Assuming this simplified example:
First, I would have created this example in JSFiddle but they are in read-only
We got this assignment from school to reproduce this example (created in Flash) into

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.