Re: Can i display a WepPage in a PDF (How to get the rendered markup)?

2013-06-07 Thread Per Newgro

Found the solution already. I did it that way:

public class FlyingSaucerPdfResource extends ByteArrayResource {

public FlyingSaucerPdfResource() {
super("application/pdf");
}

@Override
protected byte[] getData(Attributes attributes) {
ByteArrayOutputStream os;
try {
CharSequence buf = renderPage(HomePage.class, 
attributes.getParameters());

ITextRenderer renderer = new ITextRenderer();
renderer.setDocumentFromString(buf.toString());
renderer.layout();
renderer.createPDF(os = new ByteArrayOutputStream());
os.close();
} catch (IOException | DocumentException e) {
throw new RuntimeException(e);
}
return os.toByteArray();
}

private CharSequence renderPage(final Class pageClass,
PageParameters parameters) {

final RenderPageRequestHandler handler = new 
RenderPageRequestHandler(

new PageProvider(pageClass, parameters),
RedirectPolicy.NEVER_REDIRECT);

final PageRenderer pageRenderer = getApplication()
.getPageRendererProvider().get(handler);

RequestCycle originalRequestCycle = RequestCycle.get();

BufferedWebResponse tempResponse = new BufferedWebResponse(null);

RequestCycleContext requestCycleContext = new RequestCycleContext(
originalRequestCycle.getRequest(), tempResponse,
getApplication().getRootRequestMapper(), getApplication()
.getExceptionMapperProvider().get());
RequestCycle tempRequestCycle = new 
RequestCycle(requestCycleContext);


final Response oldResponse = originalRequestCycle.getResponse();

try {
originalRequestCycle.setResponse(tempResponse);
pageRenderer.respond(tempRequestCycle);
} finally {
originalRequestCycle.setResponse(oldResponse);
}

return tempResponse.getText();
}

private Application getApplication() {
return Application.get();
}

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



Re: AjaxFallbackDefaultDataTable: cell not receiving event after sorting

2013-06-07 Thread Sven Meier

Hi,

your solution looks good to me.

Check the Ajax debug window for any problems with the requests. Then put 
a breakpoint on your behavior's #onEvent() and check whether is is 
triggered.


Sven

On 06/07/2013 04:15 PM, dlock wrote:

Hi.

I have a simple abstract panel that I display as a cell within an
AjaxFallbackDefaultDataTable.  The panel has a label and a WebComponent that
shows an icon (based on passed in css).

The WebComponent has an AjaxEventBehaviour("click") added and whenever the
icon is clicked the handling is delegated to the concrete implementation
(think of the table cell having an action associated with it, such as edit
etc).  Below is the (simplified) code of the LabelIconPanel...

public abstract class LabelIconPanel extends Panel
{
 private static final long serialVersionUID = 1L;
 public LabelIconPanel(String id, IModel model, IModel text,
String cssIcon)
 {
 super(id, model);

 Label label = new Label("label", text);
 
 Component icon = new WebComponent("icon");

 icon.add(new AjaxEventBehavior("click")
 {
 private static final long serialVersionUID = 1L;

 @Override
 protected void onEvent(AjaxRequestTarget target)
 {
 LabelIconPanel.this.onClick(target);
 }
 });

 icon.add(new AttributeAppender("class", new Model(cssIcon),
" "));
 add(label);
 add(icon);
 }
 public abstract void onClick(AjaxRequestTarget target);
}
_

The panel is added to the table via a PropertyColumn like so...

new PropertyColumn(new Model("Some header"),
"someProperty")
 {
 private static final long serialVersionUID = 1L;

 @Override
 public void populateItem(Item>
item, String componentId, final IModel rowModel)
 {

 LabelIconPanel labelIconPanel =
 new LabelIconPanel(componentId, rowModel,
new Model(
 rowModel.getObject().getPropertyValue()),
"icon-pencil")
 {
 private static final long serialVersionUID = 1L;

 @Override
 public void onClick(AjaxRequestTarget target)
 {
   // handle the icon being clicked
here...show a dialog to edit property etc.
 }
 };

 item.add(labelIconPanel);
 }
 }



The issue I am having is that when I sort the table via the header, the icon
in the above panel is no longer receiving the click event (for any rows).
If I revert the sort, the icons in each row work as expected.  If I refresh
the page after sorting, the icons work as expected.

This is my first post on here as I am new to Wicket development, so any
pointers as to what might be going on or suggestions as to where I might
need to start looking would be appreciated.

dl





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFallbackDefaultDataTable-cell-not-receiving-event-after-sorting-tp4659277.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



Re: "Connecting..." in Firefox's tab title

2013-06-07 Thread Sven Meier

Should I open a JIRA and should I attach a quickstart to it?


Yes please. And don't forget to add the collected information to it.

Thanks
Sven


On 06/07/2013 05:06 PM, Guillaume Smet wrote:

Hi,

After some digging, it's related to the multipart ajax request via
posting an iframe.

The iframe is removed in the onload of the iframe ( see
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js#L868
) and it seems to be problematic for Firefox.

Looks like there is some literature about it here:
http://stackoverflow.com/questions/7285866/never-ending-connecting-message-after-ajax-form-submit

and using a pattern like the following should fix it:
iframe.onload = function(){
 // Do work with the content of the iframe…

 setTimeout(function(){
 iframe.parentNode.removeChild(iframe);
 }, 0);
}

Note: we are using Wicket 6.8.0 and Firefox 21.

Should I open a JIRA and should I attach a quickstart to it? I'm AFK
till monday but should be able to do it on monday if needed.

Thanks.




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



Can i display a WepPage in a PDF (How to get the rendered markup)?

2013-06-07 Thread Per Newgro

Hi,

i would like to render a WebPage with flying saucer (PDF generator).
I've created a resource reference and a ByteArrayResource.

But now i need the rendered markup of the page (e.g. HomePage).

So my question is how can i render the markup in my Resource?

Thanks for your support
Per

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



Re: Adding Class Attribute When Link Clicked

2013-06-07 Thread dhongyt
Created a fix if any one is interested.

I noticed that every time I clicked on my Navbar, the base page would always
reload there for the Panel would always reset and would never know which one
is select.

In my Base Page I was about to do this.getClass() that gives me the current
page loaded and so in the Panel I just passed in the active page and did a
comparison to put the class attribute on the link.





If I'm doing it incorrectly and someone has a better solution please let me
know :)

Thanks!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-Class-Attribute-When-Link-Clicked-tp4659285p4659288.html
Sent from the Users forum mailing list archive at Nabble.com.

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



session event

2013-06-07 Thread lc991
how I capture  close windows event from user(from x in the upper right)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/session-event-tp4659287.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Adding Class Attribute When Link Clicked

2013-06-07 Thread dhongyt
I see that my issue is that every time I click on the link my Navigationbar
is created again.



Thus having the active private variable always being HomePage. That's why I
the active never changes.
If I created a way for MainMenu to get and set the active page in the top
level Repeater creation then it can probably know which one is active. Is
that a smart way to do this?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-Class-Attribute-When-Link-Clicked-tp4659285p4659286.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Adding Class Attribute When Link Clicked

2013-06-07 Thread dhongyt
I'm trying to figure out
1. How to add class attribute to a link that is clicked.
2. Default homepage class link attribute to be active.

I have look at this forum
http://apache-wicket.1842946.n4.nabble.com/How-to-add-and-remove-css-classes-the-right-way-td1868408.html
thinking it would help but I'm still stuck with class not adding to my
links.

I have create a MainMenuPanel to add my navigation bar.


So I was thinking that I needed to add the class via a AjaxLink onClick


It shows the when I click on my link the link has been pressed but can't
seem to have that class attribute "active" added to my link.

I also wanted "active" to be defaulted to my Homepage link so I implemented


But every time I click on the different link it gets initialized. Should I
go about this a different way?

I feel like this should be an easy thing to do but for the life of me can't
seem to get anything working the way I want. Any suggestions would be
helpful.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-Class-Attribute-When-Link-Clicked-tp4659285.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: ResourceResponse processing "Accept-Ranges"

2013-06-07 Thread Maxim Solodovnik
Thanks a lot!
It works as expected :)

Maybe you can help me to fix/workaround following issue in mobile Chrome
(Android 4.1.2, SGS2)
When I open the file I got 2 requests
1) has valid session or is able to get
session getAuthenticationStrategy().load()
as a result player is displayed, movie time is displayed correctly
2) play button is pushed, I got 2nd request and following error in the log:
CookieUtils - Unable to find Cookie with name=LoggedIn and request
URI=recordings/mp4/1

Mobile FF on the same phone works as expected

Maybe I should set additional header somewhere ...

Any help will be appreciated :))




On Fri, Jun 7, 2013 at 5:48 PM, Maxim Solodovnik wrote:

> Thanks!
>
> will try it
>
>
> On Fri, Jun 7, 2013 at 5:46 PM, Sven Meier  wrote:
>
>> Hi,
>>
>> IMHO is would be easier to just extend AbstractResource and catch
>> ClientAbortException in a custom WriteCallback.
>>
>> See "13.6 Custom resources" in the excellent Wicket free guide [1].
>>
>> Hope this helps
>> Sven
>>
>> [1] 
>> http://code.google.com/p/**wicket-guide
>>
>>
>>
>> On 06/07/2013 12:30 PM, Maxim Solodovnik wrote:
>>
>>> Hello Sven,
>>>
>>> Thanks for the response
>>> I was able to implement this:
>>> https://svn.apache.org/repos/**asf/openmeetings/trunk/**
>>> singlewebapp/src/org/apache/**openmeetings/web/util/**
>>> RecordingResourceReference.**java
>>>
>>> The only issue remains: the following stacktraces while client drops the
>>> current connection and requests the next chank: [1]
>>>
>>> Maybe you know is there any way to suppress them? since we are expecting
>>> connection drop I would like not to print this stack trace)
>>>
>>> Thanks in advance
>>>
>>> [1]
>>> http://mail-archives.apache.**org/mod_mbox/wicket-users/**201306.mbox/%*
>>> *3CCAJmbs8hNaWws2ORVURSYU6Bgb%**2BqdNGOPdp6QiJVLyKUVYpe5AQ%**
>>> 40mail.gmail.com%3E
>>>
>>>
>>> On Fri, Jun 7, 2013 at 4:45 PM, Sven Meier  wrote:
>>>
>>>  Hi,

 your dynamic resource can parse a "Range" header from the request and
 send
 back a "Content-Range" header along the requested content. This should
 work
 as with any servlet too.

 Let us know how you solved this.

 Regards
 Sven





 --
 View this message in context:
 http://apache-wicket.1842946.**n4.nabble.com/**
 ResourceResponse-processing-**Accept-Ranges-**tp4659263p4659264.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-h...@wicket.apache.org



>>>
>>
>> --**--**-
>> To unsubscribe, e-mail: 
>> users-unsubscribe@wicket.**apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
WBR
Maxim aka solomax


Re: UrlResourceReference for images

2013-06-07 Thread bronius
Hi, I just tried it and it worked! Thanks guys for help, this situation
really surprised me :) On the bright side at least I learned about framework
when solving this little problem of mine as its easy to go inside and check
how it works (im quite new to wicket). 

Best regards!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/UrlResourceReference-for-images-tp4659261p4659283.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: UrlResourceReference for images

2013-06-07 Thread Bertrand Guay-Paquet

Try this:

url.getSegments().add("");
url.getSegments().add("site2");
url.getSegments().add("image");

Have a look at the code of Url#isAbsolute(). It checks if the first 
segment is empty which is not the case with the code you provided in the 
first email.


This behavior of the segments array is definitely not intuitive... 
Another solution would be this:


url = Url.parse("http://localhost:8080/";);
url.getSegments().add("site2");
url.getSegments().add("image");
url.setQueryParameter("param1", "1");
url.setQueryParameter("param2", "2");

This creates the first empty segment automatically.

On 07/06/2013 10:43 AM, bronius wrote:

Yes that would be great, but src="app2/image?item-123" does not work (image
is not loaded) and after changing it with firebug to
src="http://localhost:8080/app2/image?item-123"; works fine. Any ideas why is
that? Any stupid mistake i overlooked? Maybe wicket interprets relative url
as http://localhost:8080/app1/app2/image?item-123 somehow? Maybe because
when i build url I put app2 as segment? (url.getSegments().add("app2");) I
will try different way to construct url later. Thanks for help appreciate it
:)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/UrlResourceReference-for-images-tp4659261p4659279.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



Re: UrlResourceReference for images

2013-06-07 Thread harmoniaa
If you have src="app2/image?item-123" in a resource located in
http://localhost:8080/app1/, it will be resolved as
http://localhost:8080/app1/app2/image?item-123 as you noticed.

Adding "/" to the beginning should help: src="/app2/image?item-123" should
be resolved as http://localhost:8080/app2/image?item-123.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/UrlResourceReference-for-images-tp4659261p4659281.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: "Connecting..." in Firefox's tab title

2013-06-07 Thread Guillaume Smet
Hi,

After some digging, it's related to the multipart ajax request via
posting an iframe.

The iframe is removed in the onload of the iframe ( see
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js#L868
) and it seems to be problematic for Firefox.

Looks like there is some literature about it here:
http://stackoverflow.com/questions/7285866/never-ending-connecting-message-after-ajax-form-submit

and using a pattern like the following should fix it:
iframe.onload = function(){
// Do work with the content of the iframe…

setTimeout(function(){
iframe.parentNode.removeChild(iframe);
}, 0);
}

Note: we are using Wicket 6.8.0 and Firefox 21.

Should I open a JIRA and should I attach a quickstart to it? I'm AFK
till monday but should be able to do it on monday if needed.

Thanks.

-- 
Guillaume

On Fri, Jun 7, 2013 at 4:34 PM, Guillaume Smet  wrote:
> Hi,
>
> For quite a while now, we are seeing a weird behavior with Firefox: as
> soon as Wicket does an Ajax call, the tab title is changed to
> "Connecting..." and it doesn't get back to the original page title at
> all, even after the Ajax call returned.
>
> Does anybody else see this behavior?
>
> We don't see it with any other site doing Ajax calls, just with Wicket app.
>
> It looks like a detail but it's quite annoying to have a bunch of tabs
> named "Connecting...".
>
> Thanks for your feedback.
>
> --
> Guillaume

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



Re: UrlResourceReference for images

2013-06-07 Thread bronius
Yes that would be great, but src="app2/image?item-123" does not work (image
is not loaded) and after changing it with firebug to
src="http://localhost:8080/app2/image?item-123"; works fine. Any ideas why is
that? Any stupid mistake i overlooked? Maybe wicket interprets relative url
as http://localhost:8080/app1/app2/image?item-123 somehow? Maybe because
when i build url I put app2 as segment? (url.getSegments().add("app2");) I
will try different way to construct url later. Thanks for help appreciate it
:)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/UrlResourceReference-for-images-tp4659261p4659279.html
Sent from the Users forum mailing list archive at Nabble.com.

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



"Connecting..." in Firefox's tab title

2013-06-07 Thread Guillaume Smet
Hi,

For quite a while now, we are seeing a weird behavior with Firefox: as
soon as Wicket does an Ajax call, the tab title is changed to
"Connecting..." and it doesn't get back to the original page title at
all, even after the Ajax call returned.

Does anybody else see this behavior?

We don't see it with any other site doing Ajax calls, just with Wicket app.

It looks like a detail but it's quite annoying to have a bunch of tabs
named "Connecting...".

Thanks for your feedback.

-- 
Guillaume

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



AjaxFallbackDefaultDataTable: cell not receiving event after sorting

2013-06-07 Thread dlock
Hi.

I have a simple abstract panel that I display as a cell within an
AjaxFallbackDefaultDataTable.  The panel has a label and a WebComponent that
shows an icon (based on passed in css).  

The WebComponent has an AjaxEventBehaviour("click") added and whenever the
icon is clicked the handling is delegated to the concrete implementation
(think of the table cell having an action associated with it, such as edit
etc).  Below is the (simplified) code of the LabelIconPanel...

public abstract class LabelIconPanel extends Panel
{
private static final long serialVersionUID = 1L;
public LabelIconPanel(String id, IModel model, IModel text,
String cssIcon)
{
super(id, model);

Label label = new Label("label", text);

Component icon = new WebComponent("icon");
icon.add(new AjaxEventBehavior("click")
{
private static final long serialVersionUID = 1L;

@Override
protected void onEvent(AjaxRequestTarget target)
{
LabelIconPanel.this.onClick(target);
}
});

icon.add(new AttributeAppender("class", new Model(cssIcon),
" "));
add(label);
add(icon);
}
public abstract void onClick(AjaxRequestTarget target);
}
_

The panel is added to the table via a PropertyColumn like so...

new PropertyColumn(new Model("Some header"),
"someProperty")
{
private static final long serialVersionUID = 1L;

@Override
public void populateItem(Item>
item, String componentId, final IModel rowModel)
{

LabelIconPanel labelIconPanel =
new LabelIconPanel(componentId, rowModel,
new Model(
rowModel.getObject().getPropertyValue()),
"icon-pencil")
{
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target)
{
  // handle the icon being clicked
here...show a dialog to edit property etc.
}
};

item.add(labelIconPanel);
}
}



The issue I am having is that when I sort the table via the header, the icon
in the above panel is no longer receiving the click event (for any rows). 
If I revert the sort, the icons in each row work as expected.  If I refresh
the page after sorting, the icons work as expected.

This is my first post on here as I am new to Wicket development, so any
pointers as to what might be going on or suggestions as to where I might
need to start looking would be appreciated.

dl





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFallbackDefaultDataTable-cell-not-receiving-event-after-sorting-tp4659277.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: UrlResourceReference for images

2013-06-07 Thread Bertrand Guay-Paquet


What you're saying is that a client requests the url 
http://localhost:8080/app1 and the img src attribute has 
app2/image?item-123 but you want it to be 
http://localhost:8080/app2/image?item-123 instead?


Why does it make a difference? The relative url will be resolved to 
http://localhost:8080/app2/image?item-123 so it's actually the very same 
path. Check out the net tab in Firebug and you'll see it.


When and if the image url changes to another Tomcat instance, Wicket 
will render it in full as required. Just change the UrlResourceReference 
to http://localhost:8081/app2 (the http:// is necessary I believe) to 
see it in action.


On 07/06/2013 7:27 AM, bronius wrote:

Relative is not good because resources are served from different application,
just currently both applications are deployed on same tomcat so they have
urls http://localhost:8080/app1 and http://localhost:8080/app2. When "smart"
wicket renders image src i get something like this:
  so it thinks this is url of my main
application (app1), but its not. When i modify with firebug to use full
http://localhost:8080/app2 it works fine. So only solution is to override
UrlRenderer? That would mean I would have to override also RequestCycle?
Just for such simple case? Maybe there is simpler solution?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/UrlResourceReference-for-images-tp4659261p4659271.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



Solved / Re: setResponsePage does not work / on (own) ajax requests

2013-06-07 Thread Patrick Davids
Whem I'm using Wicket.Ajax.get(...) to execute my AjaxCall via 
JavaScript it works.

Previously I used pure jquery $.ajax(...) and that does not work.

kind regards
Patrick

Am 07.06.2013 14:02, schrieb Patrick Davids:
> Runs into WicketRuntimeExceptions (but they are catched).
>
> e.g.
> org.apache.wicket.WicketRuntimeException: Error attaching this container
> for rendering: [Menu [Component id = offices]]
>
> Patrick
>
> Am 07.06.2013 13:33, schrieb Sven Meier:
>> Put a break point on RequestCycle#execute() and debug what's happening
>> when you're Javascript is firing.
>>
>> Sven
>>
>> On 06/07/2013 01:27 PM, Patrick Davids wrote:
>>> Hmm... "select", but is fired via jquery on client side, and I do the
>>> ajax request by $.ajax(){ url: 'bevahior generated callback url' } on my
>>> own.
>>>
>>> (Im working with jquerys autocomplete.)
>>>
>>> Patrick
>>>
>>>
>>>
>>> Am 07.06.2013 12:48, schrieb Sven Meier:
 On what JavaScript event is your behavior listening?

 Sven

 On 06/07/2013 12:38 PM, Patrick Davids wrote:
> Hi all,
> I implemented a panel having its own AbstractAjaxBehavior.
>
> I provided the callback url to my pagepanel, the ajax request works;
> everything seems fine.
>
> Than I implemented an abstract method onSelect() to my panel to let an
> implementation do some custom thinks (the onRequest() of my internal
> behavior just delegates to abstract onSelect() of my panel)
>
> My first test... simply doing a:
>
> add(new MyPanel("foo"){
>   public void onSelect(){
> setResponsePage(some where)
>   }
> )
>
> but nothing happens...
>
> Using AbstractAjaxDefaultBehavior overriding respond() and
> delegating to
> onSelect() does not work, too.
>
> Do I have to do something special, to behave like an e.g. AjaxLink?!?
> setResponsePage() is working there...
>
> kind regards
> Patrick
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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

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

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.dav...@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Re: setResponsePage does not work / on (own) ajax requests

2013-06-07 Thread Patrick Davids
Runs into WicketRuntimeExceptions (but they are catched).

e.g.
org.apache.wicket.WicketRuntimeException: Error attaching this container 
for rendering: [Menu [Component id = offices]]

Patrick

Am 07.06.2013 13:33, schrieb Sven Meier:
> Put a break point on RequestCycle#execute() and debug what's happening
> when you're Javascript is firing.
>
> Sven
>
> On 06/07/2013 01:27 PM, Patrick Davids wrote:
>> Hmm... "select", but is fired via jquery on client side, and I do the
>> ajax request by $.ajax(){ url: 'bevahior generated callback url' } on my
>> own.
>>
>> (Im working with jquerys autocomplete.)
>>
>> Patrick
>>
>>
>>
>> Am 07.06.2013 12:48, schrieb Sven Meier:
>>> On what JavaScript event is your behavior listening?
>>>
>>> Sven
>>>
>>> On 06/07/2013 12:38 PM, Patrick Davids wrote:
 Hi all,
 I implemented a panel having its own AbstractAjaxBehavior.

 I provided the callback url to my pagepanel, the ajax request works;
 everything seems fine.

 Than I implemented an abstract method onSelect() to my panel to let an
 implementation do some custom thinks (the onRequest() of my internal
 behavior just delegates to abstract onSelect() of my panel)

 My first test... simply doing a:

 add(new MyPanel("foo"){
  public void onSelect(){
setResponsePage(some where)
  }
 )

 but nothing happens...

 Using AbstractAjaxDefaultBehavior overriding respond() and
 delegating to
 onSelect() does not work, too.

 Do I have to do something special, to behave like an e.g. AjaxLink?!?
 setResponsePage() is working there...

 kind regards
 Patrick
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org

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

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.dav...@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Re: setResponsePage does not work / on (own) ajax requests

2013-06-07 Thread Sven Meier
Put a break point on RequestCycle#execute() and debug what's happening 
when you're Javascript is firing.


Sven

On 06/07/2013 01:27 PM, Patrick Davids wrote:

Hmm... "select", but is fired via jquery on client side, and I do the
ajax request by $.ajax(){ url: 'bevahior generated callback url' } on my
own.

(Im working with jquerys autocomplete.)

Patrick



Am 07.06.2013 12:48, schrieb Sven Meier:

On what JavaScript event is your behavior listening?

Sven

On 06/07/2013 12:38 PM, Patrick Davids wrote:

Hi all,
I implemented a panel having its own AbstractAjaxBehavior.

I provided the callback url to my pagepanel, the ajax request works;
everything seems fine.

Than I implemented an abstract method onSelect() to my panel to let an
implementation do some custom thinks (the onRequest() of my internal
behavior just delegates to abstract onSelect() of my panel)

My first test... simply doing a:

add(new MyPanel("foo"){
 public void onSelect(){
   setResponsePage(some where)
 }
)

but nothing happens...

Using AbstractAjaxDefaultBehavior overriding respond() and delegating to
onSelect() does not work, too.

Do I have to do something special, to behave like an e.g. AjaxLink?!?
setResponsePage() is working there...

kind regards
Patrick
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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




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



Re: UrlResourceReference for images

2013-06-07 Thread bronius
Relative is not good because resources are served from different application,
just currently both applications are deployed on same tomcat so they have
urls http://localhost:8080/app1 and http://localhost:8080/app2. When "smart"
wicket renders image src i get something like this: 
  so it thinks this is url of my main
application (app1), but its not. When i modify with firebug to use full
http://localhost:8080/app2 it works fine. So only solution is to override
UrlRenderer? That would mean I would have to override also RequestCycle?
Just for such simple case? Maybe there is simpler solution? 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/UrlResourceReference-for-images-tp4659261p4659271.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: setResponsePage does not work / on (own) ajax requests

2013-06-07 Thread Patrick Davids
Hmm... "select", but is fired via jquery on client side, and I do the 
ajax request by $.ajax(){ url: 'bevahior generated callback url' } on my 
own.

(Im working with jquerys autocomplete.)

Patrick



Am 07.06.2013 12:48, schrieb Sven Meier:
> On what JavaScript event is your behavior listening?
>
> Sven
>
> On 06/07/2013 12:38 PM, Patrick Davids wrote:
>> Hi all,
>> I implemented a panel having its own AbstractAjaxBehavior.
>>
>> I provided the callback url to my pagepanel, the ajax request works;
>> everything seems fine.
>>
>> Than I implemented an abstract method onSelect() to my panel to let an
>> implementation do some custom thinks (the onRequest() of my internal
>> behavior just delegates to abstract onSelect() of my panel)
>>
>> My first test... simply doing a:
>>
>> add(new MyPanel("foo"){
>> public void onSelect(){
>>   setResponsePage(some where)
>> }
>> )
>>
>> but nothing happens...
>>
>> Using AbstractAjaxDefaultBehavior overriding respond() and delegating to
>> onSelect() does not work, too.
>>
>> Do I have to do something special, to behave like an e.g. AjaxLink?!?
>> setResponsePage() is working there...
>>
>> kind regards
>> Patrick
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.dav...@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

HRB10145Pi | Amtsgericht Pinneberg

Re: setResponsePage does not work / on (own) ajax requests

2013-06-07 Thread Sven Meier

On what JavaScript event is your behavior listening?

Sven

On 06/07/2013 12:38 PM, Patrick Davids wrote:

Hi all,
I implemented a panel having its own AbstractAjaxBehavior.

I provided the callback url to my pagepanel, the ajax request works;
everything seems fine.

Than I implemented an abstract method onSelect() to my panel to let an
implementation do some custom thinks (the onRequest() of my internal
behavior just delegates to abstract onSelect() of my panel)

My first test... simply doing a:

add(new MyPanel("foo"){
public void onSelect(){
  setResponsePage(some where)
}
)

but nothing happens...

Using AbstractAjaxDefaultBehavior overriding respond() and delegating to
onSelect() does not work, too.

Do I have to do something special, to behave like an e.g. AjaxLink?!?
setResponsePage() is working there...

kind regards
Patrick
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




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



Re: ResourceResponse processing "Accept-Ranges"

2013-06-07 Thread Maxim Solodovnik
Thanks!

will try it


On Fri, Jun 7, 2013 at 5:46 PM, Sven Meier  wrote:

> Hi,
>
> IMHO is would be easier to just extend AbstractResource and catch
> ClientAbortException in a custom WriteCallback.
>
> See "13.6 Custom resources" in the excellent Wicket free guide [1].
>
> Hope this helps
> Sven
>
> [1] 
> http://code.google.com/p/**wicket-guide
>
>
>
> On 06/07/2013 12:30 PM, Maxim Solodovnik wrote:
>
>> Hello Sven,
>>
>> Thanks for the response
>> I was able to implement this:
>> https://svn.apache.org/repos/**asf/openmeetings/trunk/**
>> singlewebapp/src/org/apache/**openmeetings/web/util/**
>> RecordingResourceReference.**java
>>
>> The only issue remains: the following stacktraces while client drops the
>> current connection and requests the next chank: [1]
>>
>> Maybe you know is there any way to suppress them? since we are expecting
>> connection drop I would like not to print this stack trace)
>>
>> Thanks in advance
>>
>> [1]
>> http://mail-archives.apache.**org/mod_mbox/wicket-users/**201306.mbox/%**
>> 3CCAJmbs8hNaWws2ORVURSYU6Bgb%**2BqdNGOPdp6QiJVLyKUVYpe5AQ%**
>> 40mail.gmail.com%3E
>>
>>
>> On Fri, Jun 7, 2013 at 4:45 PM, Sven Meier  wrote:
>>
>>  Hi,
>>>
>>> your dynamic resource can parse a "Range" header from the request and
>>> send
>>> back a "Content-Range" header along the requested content. This should
>>> work
>>> as with any servlet too.
>>>
>>> Let us know how you solved this.
>>>
>>> Regards
>>> Sven
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://apache-wicket.1842946.**n4.nabble.com/**
>>> ResourceResponse-processing-**Accept-Ranges-**tp4659263p4659264.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-h...@wicket.apache.org
>>>
>>>
>>>
>>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
WBR
Maxim aka solomax


Re: ResourceResponse processing "Accept-Ranges"

2013-06-07 Thread Sven Meier

Hi,

IMHO is would be easier to just extend AbstractResource and catch 
ClientAbortException in a custom WriteCallback.


See "13.6 Custom resources" in the excellent Wicket free guide [1].

Hope this helps
Sven

[1] http://code.google.com/p/wicket-guide


On 06/07/2013 12:30 PM, Maxim Solodovnik wrote:

Hello Sven,

Thanks for the response
I was able to implement this:
https://svn.apache.org/repos/asf/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/util/RecordingResourceReference.java

The only issue remains: the following stacktraces while client drops the
current connection and requests the next chank: [1]

Maybe you know is there any way to suppress them? since we are expecting
connection drop I would like not to print this stack trace)

Thanks in advance

[1]
http://mail-archives.apache.org/mod_mbox/wicket-users/201306.mbox/%3CCAJmbs8hNaWws2ORVURSYU6Bgb%2BqdNGOPdp6QiJVLyKUVYpe5AQ%40mail.gmail.com%3E


On Fri, Jun 7, 2013 at 4:45 PM, Sven Meier  wrote:


Hi,

your dynamic resource can parse a "Range" header from the request and send
back a "Content-Range" header along the requested content. This should work
as with any servlet too.

Let us know how you solved this.

Regards
Sven





--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/ResourceResponse-processing-Accept-Ranges-tp4659263p4659264.html
Sent from the Users forum mailing list archive at Nabble.com.

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







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



setResponsePage does not work / on (own) ajax requests

2013-06-07 Thread Patrick Davids
Hi all,
I implemented a panel having its own AbstractAjaxBehavior.

I provided the callback url to my pagepanel, the ajax request works; 
everything seems fine.

Than I implemented an abstract method onSelect() to my panel to let an 
implementation do some custom thinks (the onRequest() of my internal 
behavior just delegates to abstract onSelect() of my panel)

My first test... simply doing a:

add(new MyPanel("foo"){
   public void onSelect(){
 setResponsePage(some where)
   }
)

but nothing happens...

Using AbstractAjaxDefaultBehavior overriding respond() and delegating to 
onSelect() does not work, too.

Do I have to do something special, to behave like an e.g. AjaxLink?!?
setResponsePage() is working there...

kind regards
Patrick
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ResourceResponse processing "Accept-Ranges"

2013-06-07 Thread Maxim Solodovnik
Hello Sven,

Thanks for the response
I was able to implement this:
https://svn.apache.org/repos/asf/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/util/RecordingResourceReference.java

The only issue remains: the following stacktraces while client drops the
current connection and requests the next chank: [1]

Maybe you know is there any way to suppress them? since we are expecting
connection drop I would like not to print this stack trace)

Thanks in advance

[1]
http://mail-archives.apache.org/mod_mbox/wicket-users/201306.mbox/%3CCAJmbs8hNaWws2ORVURSYU6Bgb%2BqdNGOPdp6QiJVLyKUVYpe5AQ%40mail.gmail.com%3E


On Fri, Jun 7, 2013 at 4:45 PM, Sven Meier  wrote:

> Hi,
>
> your dynamic resource can parse a "Range" header from the request and send
> back a "Content-Range" header along the requested content. This should work
> as with any servlet too.
>
> Let us know how you solved this.
>
> Regards
> Sven
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/ResourceResponse-processing-Accept-Ranges-tp4659263p4659264.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
WBR
Maxim aka solomax


Re: Custom markup cache key in hierarchy

2013-06-07 Thread Sven Meier

Hi,

I think your usage should work. Can you create a quickstart and attach 
it to a Jira issue?


Sven

On 06/05/2013 09:27 PM, Bas Gooren wrote:

Hi *,

We've built a platform which hosts dynamic websites. Websites can be 
added/updated/removed on demand, and all run on a single wicket 
application (wicket 1.5-based).


So far we've used custom css to override the look & feel for each 
websites, providing the websites with a selection of themes (css + 
images).


One of the features we're currently researching is to allow a theme to 
provide custom html to the wicket base page which is used for layout.
We've also built a CMS in wicket, so using 
IMarkupResourceStreamProvider and IMarkupCacheKeyProvider is something 
we've done before.

So far, so good.

The problem is that we have various pages in the app which extend our 
base page (WebsiteLayout), and their markup is not refreshed once the 
layout changes it's theme (and thus has different html).
Even though we return a different markup cache key (it's based on the 
theme ID), and a different markup resource stream, the new markup is 
never loaded.


I think it's due to the fact that pages which extend the layout also 
have their entire markup cached (MergedMarkup).


My original idea was to only provide a custom cache key for the 
layout, and let wicket handle everything else. Then, when the theme 
html is updated, we can simply remove that single cache key from the 
wicket markup cache, and it will be reloaded.


I think we can circumvent that by providing a custom markup cache key 
for all pages which extend the layout, but that creates a bit of a 
hassle for cleaning up the markup cache. It's doable (keep track of 
all cache keys generated for a theme, and remove all of them from the 
cache), but before we proceed I'd like some feedback from others: is 
this the way to go?





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



Re: ResourceResponse processing "Accept-Ranges"

2013-06-07 Thread Sven Meier
Hi,

your dynamic resource can parse a "Range" header from the request and send
back a "Content-Range" header along the requested content. This should work
as with any servlet too.

Let us know how you solved this.

Regards
Sven





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ResourceResponse-processing-Accept-Ranges-tp4659263p4659264.html
Sent from the Users forum mailing list archive at Nabble.com.

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



ResourceResponse processing "Accept-Ranges"

2013-06-07 Thread Maxim Solodovnik
Hello All,

Is it possible to create ResourceResponse in wicket able to work with
"ranges" request for resource?
i.e.
initially set "Accept-Ranges: bytes" header
parse "Range: bytes=0-1" request header

add correct
"Content-Range: bytes 0-1/232469"
and
"Content-Length: 2"
headers based on request

Thanks in advance!

-- 
WBR
Maxim aka solomax