Export to GitHub

struts2-jquery - issue #711

onOpenTopics not being called with sj:dialog


Posted on Nov 28, 2011 by Massive Bird

(This is for feature requests and bugs in Struts2 jQuery Plugin - for getting help, please use the User Group. http://groups.google.com/group/struts2-jquery )

What steps will reproduce the problem? 1. specify a topic in sj:dialog tag with onOpenTopics 2. subscribe with a handler

What is the expected output? What do you see instead?

Handler is not being called.

Which struts2 version? 2.2.3.1

Which struts2-jquery plugin version? 3.2.0

Please provide any additional information below.

Problem does not exist in 3.1.0 - there the handler works as expected.

Thanks guys!

Comment #1

Posted on Dec 5, 2011 by Swift Lion

This Exampel works with onOpenTopics:

<sj:dialog 
    id="mytopicdialog" 
    openTopics="openTopicDialog"
    onOpenTopics="dialogopentopic" 
    onCloseTopics="dialogclosetopic" 
    onBeforeCloseTopics="dialogbeforeclosetopic" 
    autoOpen="false" 
    modal="true" 
    title="Topics Dialog">
    Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
</sj:dialog>
<sj:a id="opentopicdialoglink"
    onClickTopics="openTopicDialog" 
    cssClass="buttonlink ui-state-default ui-corner-all"
    button="true"
    buttonIcon="ui-icon-newwin"
>
    Open modal dialog
</sj:a>

Comment #2

Posted on Dec 5, 2011 by Massive Bird

Really? Damn, it must be specific to my page. It is quite complex, with multiple grids, autocompleters and datepickers.

Below is a snippet of my code. The "beforelink" handler is supposed to get called to check for selected options in at least one of two grids. If no rows are selected it pops up an error message and closes the dialog. If any rows are selected though, the dialog is displayed.

However, the javascript is not being called at all in 3.2.0. It works as expected in 3.1.0. Hopefully the code below helps. It's a bit hard as I can't post the entire page due to company-specific stuff.

popup the dialog ... I have checked these dates and they are correct

...

columns etc

(grid 2 is the same) ...

$.subscribe('beforeLink', function(event, data) { var i,c; i = jQuery("#grid1").jqGrid('getGridParam','selarrrow'); c = jQuery("#grid2").jqGrid('getGridParam','selarrrow'); if (i.length==0&&c.length==00) { alert("Please select some grid options first"); cancelButton(); } });

Comment #3

Posted on Dec 5, 2011 by Swift Lion

You use openDialog and not the onClickTopics. With folloeing commit it should also works with openDialog attribute.

http://code.google.com/p/struts2-jquery/source/detail?r=1557

Comment #4

Posted on Dec 5, 2011 by Swift Lion

(No comment was entered for this change.)

Comment #5

Posted on Jan 2, 2012 by Swift Lion

(No comment was entered for this change.)

Comment #6

Posted on Jan 10, 2012 by Massive Bird

I can confirm that it's fixed for me in 3.2.1 - thanks!

Status: Fixed

Labels:
Type-Defect Priority-Medium Component-Plugin Milestone-3.2.1