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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:49:18+00:00 2026-06-01T10:49:18+00:00

I’ve got the following jsp page and I’m using struts2-jquery-plugin-3.1.1 <script type=text/javascript> function openDialog()

  • 0

I’ve got the following jsp page and I’m using struts2-jquery-plugin-3.1.1

<script type="text/javascript">
function openDialog() {
    $.publish('openDialog');
}

</script>
</head>
<body>

<div id="detailContainer">
  <div id="header">
     <s:action name="ecu-info-header" var="dc"/>

<ul class="vMenu">
    <s:iterator var="ecus" value="ecuList" status="status">
    <s:url id="ecu" value="ecu-info-detail" escapeAmp="false">
        <s:param name="id" value="%{id}"></s:param>
        <s:param name="ecuName" value="name"></s:param>
        <s:param name="ajax" value="true"></s:param>
    </s:url>

    <li class="vMenuItem"><sj:a href="%{ecu}" requestType="GET" targets="detail" onclick="openDialog()" onCompleteTopics="closeDialog"><div class="vMenuItemText"><s:property value="description"/></div></sj:a></li>
    </s:iterator>
    </ul>

</div>

<div id="detail">
</div>
</div>
<div id="clear"></div>
<s:submit cssClass="vMenuItemText hidden" id="submit" type="button"
        label="Back" name="back"/>
<sj:dialog 
    id="myclickdialog" 
    autoOpen="false" 
    modal="true" 
    title="Please Wait ..... "
    closeOnEscape="false"
    openTopics="openDialog"
    closeTopics="closeDialog"
    overlayOpacity="0.85"
    showEffect="scale"
>
    <p class="instruction">Reading data from the vehicle</p><br /><br />
    <img id="loading" src="<%=request.getContextPath()%>/resources/images/loading.gif"/>

</sj:dialog>

</body>

The first time I click on one of the links, the dialog box opens and closes as expected with the results loaded in div id=”details”. Second and subsequent clicks on any of the links results in the fresh data reloading, but the dialog box never re-opens.

EDIT:

I’ve taken the sugestions below and tried to convert to pure JQuery and I still have the same problem.

<script type="text/javascript">

$(document).ready(function() {
    $('#popup').dialog({ autoOpen: false })    
    $('#popup').dialog({ modal: true })             // set modal
    $('#popup').dialog({ closeOnEscape: false });       // prevent closing by pressing the escape key
    $('#popup').dialog({ dialogClass: 'no-close' });    // in conjunction with css hides the "x" to close button
    $('#popup').dialog({ title: 'Please wait ....'});
    $('.anchor').each(function() {
        $(this).click(function() {
            processDialog($(this).attr('href'));
            return false;
        });
    });
});

function openDialog() {

    $('#popup').dialog('open');
}


function processDialog(url) {
        openDialog();

        $.get(url, function(data) {
            $('#popup').dialog('close');
            $('#detail').html(data);

            });

        return false;
    }

</script>
</head>
<body>

<div id="detailContainer">
<div id="header">
<s:action name="ecu-info-header" var="dc"/>

<ul class="vMenu">
    <s:iterator var="ecus" value="ecuList" status="status">
    <s:url id="ecu" value="ecu-info-detail">
        <s:param name="id" value="%{id}"></s:param>
        <s:param name="ecuName" value="name"></s:param>
        <s:param name="ajax" value="true"></s:param>
    </s:url>

    <li class="vMenuItem"><s:a cssClass="anchor" href="%{ecu}"><div class="vMenuItemText"><s:property value="description"/></div></s:a></li>
    </s:iterator>
    </ul>

</div>

<div id="detail">
</div>

</div>
<div id="clear"></div>
<s:a cssClass="vMenuItemText" id="floatingButton" href="display-diagnostic-menu">Back</s:a>


<div id="popup" class="hidden">
<p class="instruction">Reading data from the vehicle</p><br /><br />
    <img id="loading" src="<%=request.getContextPath()%>/resources/images/loading.gif"   />
</div>

First link I click on, the dialog opens as expected, the get request executes, the dialog closes and the data is refreshed. Any subsequent attempt to click on one of the links results in Firebug console reporting “(#popup).dialog is not a function”. Refreshing the page and everything starts to work, but again, only once.

EDIT

I found the blog entry at http://blog.nemikor.com/2009/04/08/basic-usage-of-the-jquery-ui-dialog and as a result the answer seems to be to remove the div for the dialog from my jsp page and create it javascript when the dialog is initialised. So what I’ve got now is

<script type="text/javascript">

var $dialog;

$(document).ready(function() {

    $dialog = $('<div></div>')
    .html('<p class="instruction">Reading data from the vehicle</p><br /><br /><img id="loading" src="<%=request.getContextPath()%>/resources/images/loading.gif"/>')
    .dialog({ autoOpen: false,    
              modal: true,              // set modal
              closeOnEscape: false,         // prevent closing by pressing the escape key
              dialogClass: 'no-close',  // in conjunction with css hides the "x" to close button
              title: 'Please wait ....'
              });
    $('.anchor').each(function() {
        $(this).click(function() {
            processDialog($(this).attr('href'));
            return false;
        });
    });
});

function processDialog(url) {
        $dialog.dialog('open');
        $('#detail').empty();

        $.get(url, function(data) {
            $('#detail').html(data);
            $dialog.dialog('close');


            });

        return false;
    }

</script>
</head>
<body>

<div id="detailContainer">
<div id="header">
<s:action name="ecu-info-header" var="dc"/>

<ul class="vMenu">
    <s:iterator var="ecus" value="ecuList" status="status">
    <s:url id="ecu" value="ecu-info-detail">
        <s:param name="id" value="%{id}"></s:param>
        <s:param name="ecuName" value="name"></s:param>
        <s:param name="ajax" value="true"></s:param>
    </s:url>

    <li class="vMenuItem"><s:a cssClass="anchor" href="%{ecu}"><div class="vMenuItemText"><s:property value="description"/></div></s:a></li>
    </s:iterator>
    </ul>

</div>

<div id="detail">
</div>

</div>
<div id="clear"></div>
<s:a cssClass="vMenuItemText" id="floatingButton" href="display-diagnostic-menu">Back</s:a>

</body>

Why this works instead of referencing a div in the jsp page I have no idea and
would be grateful for an explanation.

  • 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-01T10:49:19+00:00Added an answer on June 1, 2026 at 10:49 am

    Have you looked in the browser debug console?

    similar bug: http://code.google.com/p/struts2-jquery/issues/detail?id=652

    I recommend using the javascript and jQuery instead struts2-jquery-plugin. It is more flexible and clear.

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

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has

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.