You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by appwicket <ww...@gmail.com> on 2012/12/12 19:30:10 UTC

url problem of resourceLink popup page

Hi 
I am using resourceLink for a grammatically generated pdf resource:
PopupSettings popupSettings = new PopupSettings("resourcePage",
PopupSettings.RESIZABLE
				| PopupSettings.SCROLLBARS).setHeight(500).setWidth(700);
ResourceLink resourceLink = (ResourceLink) new
ResourceLink("resourceLink",getMyResource());
resourceLink.setPopupSettings(popupSettings);
myForm.add(resourceLink);

when the popup window opens the name is "Page(application/pdf object)"
instead of "resourcePage", 
and the link is
http://localhost:8080/myCompany/previewPDf?3-IResourceListener-myForm-resourceLink

The resource is generated when user comes to this page by using page
parameters sent from previous page.

I notice there are few ways to mount url in application.java but how can I
mount this dynamic resource?
another question, sometimes when I open the popup from resourceLink, the
contents (pdf) are not updating. is there any cache in resourceLink?

Thanks






--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/url-problem-of-resourceLink-popup-page-tp4654750.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: url problem of resourceLink popup page

Posted by appwicket <ww...@gmail.com>.
Hi,
Thanks for reply,
I overrided the setHeaders in my webpage but seems not work for IE
@Override
	protected void setHeaders(WebResponse response) {
	    if (response != null) {
	    	response.setHeader("Cache-Control",
"no-cache,no-store,private,must-revalidate,max-stale=0,post-check=0,pre-check=0");
	    	response.setHeader("Keep-Alive", "timeout=3, max=993");
	    }
	}

How can I disable the cache for resourceLink? 
Im using ByteArrayResource.
so I override ByteArrayResource#configureCache:
	@Override
	protected void configureCache(final ResourceResponse data, final Attributes
attributes)
		{
			Response response = attributes.getResponse();

			if (response instanceof WebResponse)
			{
				WebResponse webResponse = (WebResponse)response;
					webResponse.disableCaching();
			}
		}

now my popup window opens with no contents in IE.
Did I miss anything?
Thanks




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/url-problem-of-resourceLink-popup-page-tp4654750p4654828.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: url problem of resourceLink popup page

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

The popup settings' name is the JavaScript name used in window.open(). It
is used for inter window communication (JavaScript).
The resource name and cache are controlled by IResource's ResourceResponse
fields.


On Wed, Dec 12, 2012 at 7:30 PM, appwicket <ww...@gmail.com> wrote:

> Hi
> I am using resourceLink for a grammatically generated pdf resource:
> PopupSettings popupSettings = new PopupSettings("resourcePage",
> PopupSettings.RESIZABLE
>                                 |
> PopupSettings.SCROLLBARS).setHeight(500).setWidth(700);
> ResourceLink resourceLink = (ResourceLink) new
> ResourceLink("resourceLink",getMyResource());
> resourceLink.setPopupSettings(popupSettings);
> myForm.add(resourceLink);
>
> when the popup window opens the name is "Page(application/pdf object)"
> instead of "resourcePage",
> and the link is
>
> http://localhost:8080/myCompany/previewPDf?3-IResourceListener-myForm-resourceLink
>
> The resource is generated when user comes to this page by using page
> parameters sent from previous page.
>
> I notice there are few ways to mount url in application.java but how can I
> mount this dynamic resource?
> another question, sometimes when I open the popup from resourceLink, the
> contents (pdf) are not updating. is there any cache in resourceLink?
>
> Thanks
>
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/url-problem-of-resourceLink-popup-page-tp4654750.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>