You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Michael Mikhulya (JIRA)" <ji...@apache.org> on 2009/12/15 15:37:18 UTC

[jira] Created: (WICKET-2617) ModalWindow can't be shown when it is rendered with ajax request

ModalWindow can't be shown when it is rendered with ajax request
----------------------------------------------------------------

                 Key: WICKET-2617
                 URL: https://issues.apache.org/jira/browse/WICKET-2617
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.4
            Reporter: Michael Mikhulya


Regression appeared with 1.4.4 release, in previous releases all worked fine.

I load page in two requests. First one loads very small html, which then loads remaining part with ajax request.
(I do so to pass parameters after '#' to server in similar way as it is done in gmail, but there are other reasons to render ModalWindow with ajax request).
ModalWindow is rendered (but not shown) with second (ajax) request.

The private variable "shown" is set to true:
	protected void onBeforeRender()
	{
		shown = makeContentVisible();

Because of following implementation of makeContentVisible method:
	protected boolean makeContentVisible()
	{
		// if user is refreshing whole page, the window will not be shown
		return getWebRequest().isAjax();
	}

But when I call "show" method nothing happens:
	public void show(final AjaxRequestTarget target)
	{
		if (shown == false)
		{
			getContent().setVisible(true);
			target.addComponent(this);
			target.appendJavascript(getWindowOpenJavascript());
			shown = true;
		}
	}

Actually there are two problems:
1) behavior has changed
2) I didn't find safe workaround for this problem.
Unsafe workaround as follows, notice, it can break with next wicket release since base "show" method is not called in sub class:

class MyModalWindow extends ModalWindow {
	protected boolean visible = false;

	@Override
	protected boolean makeContentVisible() {
		return visible;
	}

	@Override
	public void show(org.apache.wicket.ajax.AjaxRequestTarget target) {
		visible = true;
		getContent().setVisible(true);
		target.addComponent(this);
		target.appendJavascript(getWindowOpenJavascript());
	};

	@Override
	public void close(AjaxRequestTarget target) {
		visible = false;
		super.close(target);
	}
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2617) ModalWindow can't be shown when it is rendered with ajax request

Posted by "Michael Mikhulya (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791863#action_12791863 ] 

Michael Mikhulya commented on WICKET-2617:
------------------------------------------

I've checked revision 891612, all works like a charm now.
Thank you!

> ModalWindow can't be shown when it is rendered with ajax request
> ----------------------------------------------------------------
>
>                 Key: WICKET-2617
>                 URL: https://issues.apache.org/jira/browse/WICKET-2617
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.4
>            Reporter: Michael Mikhulya
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.5
>
>
> Regression appeared with 1.4.4 release, in previous releases all worked fine.
> I load page in two requests. First one loads very small html, which then loads remaining part with ajax request.
> (I do so to pass parameters after '#' to server in similar way as it is done in gmail, but there are other reasons to render ModalWindow with ajax request).
> ModalWindow is rendered (but not shown) with second (ajax) request.
> The private variable "shown" is set to true:
> 	protected void onBeforeRender()
> 	{
> 		shown = makeContentVisible();
> Because of following implementation of makeContentVisible method:
> 	protected boolean makeContentVisible()
> 	{
> 		// if user is refreshing whole page, the window will not be shown
> 		return getWebRequest().isAjax();
> 	}
> But when I call "show" method nothing happens:
> 	public void show(final AjaxRequestTarget target)
> 	{
> 		if (shown == false)
> 		{
> 			getContent().setVisible(true);
> 			target.addComponent(this);
> 			target.appendJavascript(getWindowOpenJavascript());
> 			shown = true;
> 		}
> 	}
> Actually there are two problems:
> 1) behavior has changed
> 2) I didn't find safe workaround for this problem.
> Unsafe workaround as follows, notice, it can break with next wicket release since base "show" method is not called in sub class:
> class MyModalWindow extends ModalWindow {
> 	protected boolean visible = false;
> 	@Override
> 	protected boolean makeContentVisible() {
> 		return visible;
> 	}
> 	@Override
> 	public void show(org.apache.wicket.ajax.AjaxRequestTarget target) {
> 		visible = true;
> 		getContent().setVisible(true);
> 		target.addComponent(this);
> 		target.appendJavascript(getWindowOpenJavascript());
> 	};
> 	@Override
> 	public void close(AjaxRequestTarget target) {
> 		visible = false;
> 		super.close(target);
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2617) ModalWindow can't be shown when it is rendered with ajax request

Posted by "Michael Mikhulya (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791834#action_12791834 ] 

Michael Mikhulya commented on WICKET-2617:
------------------------------------------

Igor, thank you for quick response.

I would like to test your changes and provide quickstart if there is still an issue.

Unfortunatelly I can't test your changes because the latest available snapshot is wicket-1.4-20091031.051535-642.
I was looking for latest snapshot at
http://wicketstuff.org/maven/repository/org/apache/wicket/wicket/1.4-SNAPSHOT/
link to this maven repository is provided by
http://wicket.apache.org/getting-wicket.html

Seems like snapshots aren't automatically generated anymore or getting-wicket.html points to wrong/obsolete maven repository.

> ModalWindow can't be shown when it is rendered with ajax request
> ----------------------------------------------------------------
>
>                 Key: WICKET-2617
>                 URL: https://issues.apache.org/jira/browse/WICKET-2617
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.4
>            Reporter: Michael Mikhulya
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.5
>
>
> Regression appeared with 1.4.4 release, in previous releases all worked fine.
> I load page in two requests. First one loads very small html, which then loads remaining part with ajax request.
> (I do so to pass parameters after '#' to server in similar way as it is done in gmail, but there are other reasons to render ModalWindow with ajax request).
> ModalWindow is rendered (but not shown) with second (ajax) request.
> The private variable "shown" is set to true:
> 	protected void onBeforeRender()
> 	{
> 		shown = makeContentVisible();
> Because of following implementation of makeContentVisible method:
> 	protected boolean makeContentVisible()
> 	{
> 		// if user is refreshing whole page, the window will not be shown
> 		return getWebRequest().isAjax();
> 	}
> But when I call "show" method nothing happens:
> 	public void show(final AjaxRequestTarget target)
> 	{
> 		if (shown == false)
> 		{
> 			getContent().setVisible(true);
> 			target.addComponent(this);
> 			target.appendJavascript(getWindowOpenJavascript());
> 			shown = true;
> 		}
> 	}
> Actually there are two problems:
> 1) behavior has changed
> 2) I didn't find safe workaround for this problem.
> Unsafe workaround as follows, notice, it can break with next wicket release since base "show" method is not called in sub class:
> class MyModalWindow extends ModalWindow {
> 	protected boolean visible = false;
> 	@Override
> 	protected boolean makeContentVisible() {
> 		return visible;
> 	}
> 	@Override
> 	public void show(org.apache.wicket.ajax.AjaxRequestTarget target) {
> 		visible = true;
> 		getContent().setVisible(true);
> 		target.addComponent(this);
> 		target.appendJavascript(getWindowOpenJavascript());
> 	};
> 	@Override
> 	public void close(AjaxRequestTarget target) {
> 		visible = false;
> 		super.close(target);
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2617) ModalWindow can't be shown when it is rendered with ajax request

Posted by "Martin Bednar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800238#action_12800238 ] 

Martin Bednar commented on WICKET-2617:
---------------------------------------

Hi,

This patch dosn't work in situation described below:

I have page with AjaxTabbedPanel that contains two tabs, "tab1" that contains ModalWindows and AjaxButtons that fires show method on modal windows and "tab2" that contains some grids.

On start "tab1" is shown, and ModalWindows works, after switching to "tab2" and back to "tab1" ModalWindows has shown property set to true, so it can't shown anymore.

Martin


> ModalWindow can't be shown when it is rendered with ajax request
> ----------------------------------------------------------------
>
>                 Key: WICKET-2617
>                 URL: https://issues.apache.org/jira/browse/WICKET-2617
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.4
>            Reporter: Michael Mikhulya
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.5
>
>
> Regression appeared with 1.4.4 release, in previous releases all worked fine.
> I load page in two requests. First one loads very small html, which then loads remaining part with ajax request.
> (I do so to pass parameters after '#' to server in similar way as it is done in gmail, but there are other reasons to render ModalWindow with ajax request).
> ModalWindow is rendered (but not shown) with second (ajax) request.
> The private variable "shown" is set to true:
> 	protected void onBeforeRender()
> 	{
> 		shown = makeContentVisible();
> Because of following implementation of makeContentVisible method:
> 	protected boolean makeContentVisible()
> 	{
> 		// if user is refreshing whole page, the window will not be shown
> 		return getWebRequest().isAjax();
> 	}
> But when I call "show" method nothing happens:
> 	public void show(final AjaxRequestTarget target)
> 	{
> 		if (shown == false)
> 		{
> 			getContent().setVisible(true);
> 			target.addComponent(this);
> 			target.appendJavascript(getWindowOpenJavascript());
> 			shown = true;
> 		}
> 	}
> Actually there are two problems:
> 1) behavior has changed
> 2) I didn't find safe workaround for this problem.
> Unsafe workaround as follows, notice, it can break with next wicket release since base "show" method is not called in sub class:
> class MyModalWindow extends ModalWindow {
> 	protected boolean visible = false;
> 	@Override
> 	protected boolean makeContentVisible() {
> 		return visible;
> 	}
> 	@Override
> 	public void show(org.apache.wicket.ajax.AjaxRequestTarget target) {
> 		visible = true;
> 		getContent().setVisible(true);
> 		target.addComponent(this);
> 		target.appendJavascript(getWindowOpenJavascript());
> 	};
> 	@Override
> 	public void close(AjaxRequestTarget target) {
> 		visible = false;
> 		super.close(target);
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2617) ModalWindow can't be shown when it is rendered with ajax request

Posted by "Martin Bednar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Bednar updated WICKET-2617:
----------------------------------

    Comment: was deleted

(was: Hi,

This patch dosn't work in situation described below:

I have page with AjaxTabbedPanel that contains two tabs, "tab1" that contains ModalWindows and AjaxButtons that fires show method on modal windows and "tab2" that contains some grids.

On start "tab1" is shown, and ModalWindows works, after switching to "tab2" and back to "tab1" ModalWindows has shown property set to true, so it can't shown anymore.

Martin
)

> ModalWindow can't be shown when it is rendered with ajax request
> ----------------------------------------------------------------
>
>                 Key: WICKET-2617
>                 URL: https://issues.apache.org/jira/browse/WICKET-2617
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.4
>            Reporter: Michael Mikhulya
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.5
>
>
> Regression appeared with 1.4.4 release, in previous releases all worked fine.
> I load page in two requests. First one loads very small html, which then loads remaining part with ajax request.
> (I do so to pass parameters after '#' to server in similar way as it is done in gmail, but there are other reasons to render ModalWindow with ajax request).
> ModalWindow is rendered (but not shown) with second (ajax) request.
> The private variable "shown" is set to true:
> 	protected void onBeforeRender()
> 	{
> 		shown = makeContentVisible();
> Because of following implementation of makeContentVisible method:
> 	protected boolean makeContentVisible()
> 	{
> 		// if user is refreshing whole page, the window will not be shown
> 		return getWebRequest().isAjax();
> 	}
> But when I call "show" method nothing happens:
> 	public void show(final AjaxRequestTarget target)
> 	{
> 		if (shown == false)
> 		{
> 			getContent().setVisible(true);
> 			target.addComponent(this);
> 			target.appendJavascript(getWindowOpenJavascript());
> 			shown = true;
> 		}
> 	}
> Actually there are two problems:
> 1) behavior has changed
> 2) I didn't find safe workaround for this problem.
> Unsafe workaround as follows, notice, it can break with next wicket release since base "show" method is not called in sub class:
> class MyModalWindow extends ModalWindow {
> 	protected boolean visible = false;
> 	@Override
> 	protected boolean makeContentVisible() {
> 		return visible;
> 	}
> 	@Override
> 	public void show(org.apache.wicket.ajax.AjaxRequestTarget target) {
> 		visible = true;
> 		getContent().setVisible(true);
> 		target.addComponent(this);
> 		target.appendJavascript(getWindowOpenJavascript());
> 	};
> 	@Override
> 	public void close(AjaxRequestTarget target) {
> 		visible = false;
> 		super.close(target);
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-2617) ModalWindow can't be shown when it is rendered with ajax request

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2617.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4.6

found the regression, should be fixed

> ModalWindow can't be shown when it is rendered with ajax request
> ----------------------------------------------------------------
>
>                 Key: WICKET-2617
>                 URL: https://issues.apache.org/jira/browse/WICKET-2617
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.4
>            Reporter: Michael Mikhulya
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.6
>
>
> Regression appeared with 1.4.4 release, in previous releases all worked fine.
> I load page in two requests. First one loads very small html, which then loads remaining part with ajax request.
> (I do so to pass parameters after '#' to server in similar way as it is done in gmail, but there are other reasons to render ModalWindow with ajax request).
> ModalWindow is rendered (but not shown) with second (ajax) request.
> The private variable "shown" is set to true:
> 	protected void onBeforeRender()
> 	{
> 		shown = makeContentVisible();
> Because of following implementation of makeContentVisible method:
> 	protected boolean makeContentVisible()
> 	{
> 		// if user is refreshing whole page, the window will not be shown
> 		return getWebRequest().isAjax();
> 	}
> But when I call "show" method nothing happens:
> 	public void show(final AjaxRequestTarget target)
> 	{
> 		if (shown == false)
> 		{
> 			getContent().setVisible(true);
> 			target.addComponent(this);
> 			target.appendJavascript(getWindowOpenJavascript());
> 			shown = true;
> 		}
> 	}
> Actually there are two problems:
> 1) behavior has changed
> 2) I didn't find safe workaround for this problem.
> Unsafe workaround as follows, notice, it can break with next wicket release since base "show" method is not called in sub class:
> class MyModalWindow extends ModalWindow {
> 	protected boolean visible = false;
> 	@Override
> 	protected boolean makeContentVisible() {
> 		return visible;
> 	}
> 	@Override
> 	public void show(org.apache.wicket.ajax.AjaxRequestTarget target) {
> 		visible = true;
> 		getContent().setVisible(true);
> 		target.addComponent(this);
> 		target.appendJavascript(getWindowOpenJavascript());
> 	};
> 	@Override
> 	public void close(AjaxRequestTarget target) {
> 		visible = false;
> 		super.close(target);
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2617) ModalWindow can't be shown when it is rendered with ajax request

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791423#action_12791423 ] 

Igor Vaynberg commented on WICKET-2617:
---------------------------------------

try with latest snapshot, may be related to WICKET-2613

> ModalWindow can't be shown when it is rendered with ajax request
> ----------------------------------------------------------------
>
>                 Key: WICKET-2617
>                 URL: https://issues.apache.org/jira/browse/WICKET-2617
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.4
>            Reporter: Michael Mikhulya
>
> Regression appeared with 1.4.4 release, in previous releases all worked fine.
> I load page in two requests. First one loads very small html, which then loads remaining part with ajax request.
> (I do so to pass parameters after '#' to server in similar way as it is done in gmail, but there are other reasons to render ModalWindow with ajax request).
> ModalWindow is rendered (but not shown) with second (ajax) request.
> The private variable "shown" is set to true:
> 	protected void onBeforeRender()
> 	{
> 		shown = makeContentVisible();
> Because of following implementation of makeContentVisible method:
> 	protected boolean makeContentVisible()
> 	{
> 		// if user is refreshing whole page, the window will not be shown
> 		return getWebRequest().isAjax();
> 	}
> But when I call "show" method nothing happens:
> 	public void show(final AjaxRequestTarget target)
> 	{
> 		if (shown == false)
> 		{
> 			getContent().setVisible(true);
> 			target.addComponent(this);
> 			target.appendJavascript(getWindowOpenJavascript());
> 			shown = true;
> 		}
> 	}
> Actually there are two problems:
> 1) behavior has changed
> 2) I didn't find safe workaround for this problem.
> Unsafe workaround as follows, notice, it can break with next wicket release since base "show" method is not called in sub class:
> class MyModalWindow extends ModalWindow {
> 	protected boolean visible = false;
> 	@Override
> 	protected boolean makeContentVisible() {
> 		return visible;
> 	}
> 	@Override
> 	public void show(org.apache.wicket.ajax.AjaxRequestTarget target) {
> 		visible = true;
> 		getContent().setVisible(true);
> 		target.addComponent(this);
> 		target.appendJavascript(getWindowOpenJavascript());
> 	};
> 	@Override
> 	public void close(AjaxRequestTarget target) {
> 		visible = false;
> 		super.close(target);
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2617) ModalWindow can't be shown when it is rendered with ajax request

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791601#action_12791601 ] 

Igor Vaynberg commented on WICKET-2617:
---------------------------------------

or provide a quickstart so we can reproduce this.

> ModalWindow can't be shown when it is rendered with ajax request
> ----------------------------------------------------------------
>
>                 Key: WICKET-2617
>                 URL: https://issues.apache.org/jira/browse/WICKET-2617
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.4
>            Reporter: Michael Mikhulya
>
> Regression appeared with 1.4.4 release, in previous releases all worked fine.
> I load page in two requests. First one loads very small html, which then loads remaining part with ajax request.
> (I do so to pass parameters after '#' to server in similar way as it is done in gmail, but there are other reasons to render ModalWindow with ajax request).
> ModalWindow is rendered (but not shown) with second (ajax) request.
> The private variable "shown" is set to true:
> 	protected void onBeforeRender()
> 	{
> 		shown = makeContentVisible();
> Because of following implementation of makeContentVisible method:
> 	protected boolean makeContentVisible()
> 	{
> 		// if user is refreshing whole page, the window will not be shown
> 		return getWebRequest().isAjax();
> 	}
> But when I call "show" method nothing happens:
> 	public void show(final AjaxRequestTarget target)
> 	{
> 		if (shown == false)
> 		{
> 			getContent().setVisible(true);
> 			target.addComponent(this);
> 			target.appendJavascript(getWindowOpenJavascript());
> 			shown = true;
> 		}
> 	}
> Actually there are two problems:
> 1) behavior has changed
> 2) I didn't find safe workaround for this problem.
> Unsafe workaround as follows, notice, it can break with next wicket release since base "show" method is not called in sub class:
> class MyModalWindow extends ModalWindow {
> 	protected boolean visible = false;
> 	@Override
> 	protected boolean makeContentVisible() {
> 		return visible;
> 	}
> 	@Override
> 	public void show(org.apache.wicket.ajax.AjaxRequestTarget target) {
> 		visible = true;
> 		getContent().setVisible(true);
> 		target.addComponent(this);
> 		target.appendJavascript(getWindowOpenJavascript());
> 	};
> 	@Override
> 	public void close(AjaxRequestTarget target) {
> 		visible = false;
> 		super.close(target);
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-2617) ModalWindow can't be shown when it is rendered with ajax request

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-2617:
-------------------------------------

    Assignee: Igor Vaynberg

> ModalWindow can't be shown when it is rendered with ajax request
> ----------------------------------------------------------------
>
>                 Key: WICKET-2617
>                 URL: https://issues.apache.org/jira/browse/WICKET-2617
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.4
>            Reporter: Michael Mikhulya
>            Assignee: Igor Vaynberg
>
> Regression appeared with 1.4.4 release, in previous releases all worked fine.
> I load page in two requests. First one loads very small html, which then loads remaining part with ajax request.
> (I do so to pass parameters after '#' to server in similar way as it is done in gmail, but there are other reasons to render ModalWindow with ajax request).
> ModalWindow is rendered (but not shown) with second (ajax) request.
> The private variable "shown" is set to true:
> 	protected void onBeforeRender()
> 	{
> 		shown = makeContentVisible();
> Because of following implementation of makeContentVisible method:
> 	protected boolean makeContentVisible()
> 	{
> 		// if user is refreshing whole page, the window will not be shown
> 		return getWebRequest().isAjax();
> 	}
> But when I call "show" method nothing happens:
> 	public void show(final AjaxRequestTarget target)
> 	{
> 		if (shown == false)
> 		{
> 			getContent().setVisible(true);
> 			target.addComponent(this);
> 			target.appendJavascript(getWindowOpenJavascript());
> 			shown = true;
> 		}
> 	}
> Actually there are two problems:
> 1) behavior has changed
> 2) I didn't find safe workaround for this problem.
> Unsafe workaround as follows, notice, it can break with next wicket release since base "show" method is not called in sub class:
> class MyModalWindow extends ModalWindow {
> 	protected boolean visible = false;
> 	@Override
> 	protected boolean makeContentVisible() {
> 		return visible;
> 	}
> 	@Override
> 	public void show(org.apache.wicket.ajax.AjaxRequestTarget target) {
> 		visible = true;
> 		getContent().setVisible(true);
> 		target.addComponent(this);
> 		target.appendJavascript(getWindowOpenJavascript());
> 	};
> 	@Override
> 	public void close(AjaxRequestTarget target) {
> 		visible = false;
> 		super.close(target);
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2617) ModalWindow can't be shown when it is rendered with ajax request

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-2617:
----------------------------------

    Fix Version/s:     (was: 1.4.6)
                   1.4.5

> ModalWindow can't be shown when it is rendered with ajax request
> ----------------------------------------------------------------
>
>                 Key: WICKET-2617
>                 URL: https://issues.apache.org/jira/browse/WICKET-2617
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.4
>            Reporter: Michael Mikhulya
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.5
>
>
> Regression appeared with 1.4.4 release, in previous releases all worked fine.
> I load page in two requests. First one loads very small html, which then loads remaining part with ajax request.
> (I do so to pass parameters after '#' to server in similar way as it is done in gmail, but there are other reasons to render ModalWindow with ajax request).
> ModalWindow is rendered (but not shown) with second (ajax) request.
> The private variable "shown" is set to true:
> 	protected void onBeforeRender()
> 	{
> 		shown = makeContentVisible();
> Because of following implementation of makeContentVisible method:
> 	protected boolean makeContentVisible()
> 	{
> 		// if user is refreshing whole page, the window will not be shown
> 		return getWebRequest().isAjax();
> 	}
> But when I call "show" method nothing happens:
> 	public void show(final AjaxRequestTarget target)
> 	{
> 		if (shown == false)
> 		{
> 			getContent().setVisible(true);
> 			target.addComponent(this);
> 			target.appendJavascript(getWindowOpenJavascript());
> 			shown = true;
> 		}
> 	}
> Actually there are two problems:
> 1) behavior has changed
> 2) I didn't find safe workaround for this problem.
> Unsafe workaround as follows, notice, it can break with next wicket release since base "show" method is not called in sub class:
> class MyModalWindow extends ModalWindow {
> 	protected boolean visible = false;
> 	@Override
> 	protected boolean makeContentVisible() {
> 		return visible;
> 	}
> 	@Override
> 	public void show(org.apache.wicket.ajax.AjaxRequestTarget target) {
> 		visible = true;
> 		getContent().setVisible(true);
> 		target.addComponent(this);
> 		target.appendJavascript(getWindowOpenJavascript());
> 	};
> 	@Override
> 	public void close(AjaxRequestTarget target) {
> 		visible = false;
> 		super.close(target);
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2617) ModalWindow can't be shown when it is rendered with ajax request

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791838#action_12791838 ] 

Igor Vaynberg commented on WICKET-2617:
---------------------------------------

check out the source and run mvn install

> ModalWindow can't be shown when it is rendered with ajax request
> ----------------------------------------------------------------
>
>                 Key: WICKET-2617
>                 URL: https://issues.apache.org/jira/browse/WICKET-2617
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.4
>            Reporter: Michael Mikhulya
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.5
>
>
> Regression appeared with 1.4.4 release, in previous releases all worked fine.
> I load page in two requests. First one loads very small html, which then loads remaining part with ajax request.
> (I do so to pass parameters after '#' to server in similar way as it is done in gmail, but there are other reasons to render ModalWindow with ajax request).
> ModalWindow is rendered (but not shown) with second (ajax) request.
> The private variable "shown" is set to true:
> 	protected void onBeforeRender()
> 	{
> 		shown = makeContentVisible();
> Because of following implementation of makeContentVisible method:
> 	protected boolean makeContentVisible()
> 	{
> 		// if user is refreshing whole page, the window will not be shown
> 		return getWebRequest().isAjax();
> 	}
> But when I call "show" method nothing happens:
> 	public void show(final AjaxRequestTarget target)
> 	{
> 		if (shown == false)
> 		{
> 			getContent().setVisible(true);
> 			target.addComponent(this);
> 			target.appendJavascript(getWindowOpenJavascript());
> 			shown = true;
> 		}
> 	}
> Actually there are two problems:
> 1) behavior has changed
> 2) I didn't find safe workaround for this problem.
> Unsafe workaround as follows, notice, it can break with next wicket release since base "show" method is not called in sub class:
> class MyModalWindow extends ModalWindow {
> 	protected boolean visible = false;
> 	@Override
> 	protected boolean makeContentVisible() {
> 		return visible;
> 	}
> 	@Override
> 	public void show(org.apache.wicket.ajax.AjaxRequestTarget target) {
> 		visible = true;
> 		getContent().setVisible(true);
> 		target.addComponent(this);
> 		target.appendJavascript(getWindowOpenJavascript());
> 	};
> 	@Override
> 	public void close(AjaxRequestTarget target) {
> 		visible = false;
> 		super.close(target);
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.