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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:27:26+00:00 2026-05-31T23:27:26+00:00

Using tapestry5-jquery and Dialog component, ¿How do I implement a close action for the

  • 0

Using tapestry5-jquery and Dialog component, ¿How do I implement a close action for the parent dialog?. I mean a button that executes some code and then close parent dialog without changing of page.

This is the javascript only version of what I’m doing:

<div id="container">
  ¿Are you sure to delete selected items?
</div>

$('#container').dialog({
  modal : true,
  buttons:[{
     text: "Yes",
     click: function() {
        //Perform action here, then close dialog.
        $(this).dialog("close");
     }
    },{
     text: "No",
     click: function() {
        //Only close dialog
        $(this).dialog("close");
     }
    }
  }]
});

But I need to use Tapestry 5 tags and java class methods:

<t:jquery.dialog t:clientId="delDialog">
  ¿Are you sure to delete selected items?
  <input t:type="submit" t:id="delYes" value="Yes"/>
  <input t:type="submit" t:id="delNo" value="No"/>
</t:jquery.dialog>

Java class:

public class UserAdmin { 
  @OnEvent(component = "delYes", value = EventConstants.SELECTED)
  void delYesClicked(){
     //Delete selected items
  }

  @OnEvent(component = "delNo", value = EventConstants.SELECTED)
  void delNoClicked(){
     //Close dialog
  }
}

Thanks.

  • 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-31T23:27:28+00:00Added an answer on May 31, 2026 at 11:27 pm

    Suggested mixin:

    public class DialogButtonHandler {
      @Parameter(value = "dlgId", defaultPrefix = BindingConstants.LITERAL)
      private String dlgId;
    
      @Inject
      private JavaScriptSupport javaScriptSupport;
    
      @InjectContainer
      private ClientElement element;
    
      @AfterRender
      public void afterRender() {
        javaScriptSupport.addScript(
          "$('#%s').click(function(){$('#%s').dialog('close');});",
              element.getClientId(), dlgId);
      }}
    

    Markup:

    <t:jquery.dialog t:clientId="delDialog">
        ¿Are you sure to delete selected items?
        <input t:type="submit" t:id="delYes" value="Yes" />
        <input t:type="submit" t:id="delNo" value="No" t:mixins="dialogButtonHandler" t:dlgId="delDialog"/>
    </t:jquery.dialog>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using the jquery ui modal dialog , the background shades grey (i assuming this
Using LINQ on collections, what is the difference between the following lines of code?
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
Using Nunit, I want to be able to write a test fixture that will
Using top it's easy to identify processes that are hogging memory and cpu, but
I'm using jquery validation, however a few particular field values can be copied from
Most web frameworks are still using the traditional action based MVC model. A controller
** EDIT November 17th ** Hi again, I wanted to show some code you
(Using MVC 2) From inside my controller action, I need to display the url:
I'm using the Tapestry5 tapx template library to send an html email, as per

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.