Re: Wicket migration 1.4 to 1.5.13 issue with WebmarkupContainer /WebComponent/ByteArrayResource

2015-12-22 Thread Martin Grigorov
Hi,

Please provide a mini/quickstart application.
Thanks!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Dec 23, 2015 at 1:11 AM, durairaj t  wrote:

> Hi Martin -
>
> I tried INLINE as you suggested, it is not working.
>
> I need to stream the byteArrayResource in model window not in the browser,
>
>  I'm trying to do the following in wicket 1.5
>
> 1. WebMarkupContainer pdfPanel = new  WebMarkupContainer();
> 2. add(pdfPanel);
> 3. pdfPanel.add(new CustomizedWebComponent("id", new
> BytearrayStreamResource("application/pdf",null)){
>
> // code to return BytearrayStreamResource
> });
>
> 4. resource.onResourceRequested(); replaced with getRequestCycle().
> scheduleRequestHandlerAfterCurrent(newResourceRequestHandler(byteArrayResource,null))
> - its not working in WebMarkupContainer. As you mentioned its streaming
> in browser.
>
>
> *Expected result: *
>
> Hierarchy: Page-> WebMarkupContainer -> WebComponent ->BytearrayStreamResource
> for pdf.
>
> *Actual result:*
>
> Hierarchy: Page->  BytearrayStreamResource for pdf. (Streaming directly
> in the page),
>
> Menu option: It is nothing but a navigation panel with the buttons. It
> will be loaded while doing page authentication.It is default behavior for
> all the authenticated page.
> HTML: I'm using  style="POSITION: absolute;z-index:-1;display:block;" >
>
>
> This issue entirely stopped my progress in migration.
>
> Please let me know if you need more details.
>
>
>
> Thank you!
>
>
> On Tue, Dec 22, 2015 at 3:26 AM, Martin Grigorov 
> wrote:
>
>> Hi,
>>
>> On Mon, Dec 21, 2015 at 5:11 PM, durairaj t 
>> wrote:
>>
>>> Hi Martin,
>>>
>>> Thank you for your response.
>>>
>>> I have tried to explain the issue more clear than before. Please refer
>>> the below details.
>>>
>>>
>>> This is regarding Wicket 1.4 to 1.5 migration.
>>>
>>> *Requirement: *Generate pdf as child within parent - preserve parent
>>> window using onRequestResource.
>>>
>>> *1.4 Code Design:*
>>> I have Form component with WebMarkupContainer (containing Menu options -
>>> buttons) as parent and WebComponent (implementing IResourceListner) as
>>> child.
>>> The WebComponent has onResourceRequested implemented with Custom class
>>> to generate pdf via DynamicWebResource.
>>>
>>> Here is code snippet for onResourceRequested()
>>>
>>> pdfPanel.add(new EmbeddedPDFComponent("pdfReport", null) {
>>>
>>> public void onResourceRequested() {
>>> CustomWebDynamicResource pdfResource = new CustomWebDynamicResource() {
>>>
>>> /**
>>> *
>>> */
>>> private static final long serialVersionUID = 1L;
>>>
>>> @Override
>>> protected ResourceState getResourceState() {
>>> return new ResourceState() {
>>>
>>> @Override
>>> public String getContentType() {
>>> return "application/pdf";
>>> }
>>>
>>> @Override
>>> public byte[] getData() {
>>> data = generatePdfIr();
>>> return data;
>>> }
>>>
>>> };
>>> }
>>>
>>> };
>>> pdfResource.onResourceRequested();
>>>
>>> }
>>> }.setOutputMarkupId(true).setMarkupId("pdfReport"));
>>>
>>> Here is CustomWebDynamicResource() class:
>>>
>>> public abstract class CustomWebDynamicResource extends
>>> DynamicWebResource {
>>>
>>> // Constructor and other default methods for setting
>>> /**
>>> * @see WebResource#setHeaders(WebResponse)
>>> */
>>> protected void setHeaders(WebResponse response)
>>> {
>>> super.setHeaders(response);
>>> response.setDateHeader("Expires", -1);
>>> response.setHeader("Pragma", "public");
>>> response.setHeader("Cache-Control", "public");
>>> }
>>> }
>>>
>>>
>>> *Above is replace as below (with Wicket 1.5):*
>>>
>>> getRequestCycle().scheduleRequestHandlerAfterCurrent(new
>>> ResourceRequestHandler(byteArrayResource, null));
>>>
>>> *Problem:*
>>>
>>> With above code, the pdf is being generated but the parent menu options
>>> are no longer available. It seems the above code is replacing the parent.
>>> If I remove above line, I can see the menu options but pdf is no longer
>>> generated.
>>>
>>
>> What do you mean with "the parent menu are no longer available" ?
>> With "getRequestCycle().scheduleRequestHandlerAfterCurrent(new
>> ResourceRequestHandler(byteArrayResource, null));" you tell Wicket to
>> stream the byteArrayResource to the browser.
>> If you use "Content-Disposition: ATTACHEMENT" then the browser will show
>> a dialog asking the user whether to save the file or to open it with the
>> default software (e.g. Adobe Actobat).
>> If you use "Content-Disposition: INLINE" then the browser will try to
>> show the file by using a plugin, i.e. open the .pdf in the browser if
>> possible.
>> In both cases the parent component should not be affected. Either the
>> page is at its old state (ATTACHMENT) or completely replaced (INLINE).
>>
>>
>>>
>>>
>>>  Thank you!
>>>
>>>
>>> On Mon, Dec 21, 2015 at 9:24 AM, Martin Grigorov 
>>> wrote:
>>>
 Hi,

 To be able to help you I'll have to setup a project with 1.4 and try to
 migrate it.
 It is not clear in your mail what exactly is the probl

Problem with

2015-12-22 Thread Malte Neumann

Hi all,

I habe a problem with the  element inside a list. If I 
add the element to my markup, the design of the list is broken in 
firefox and Chrome (windows) during designtime. Runs the markup inside 
wicket, everything works.


Here is an example of my Problem. If you open the markup in your 
browser, you see that the two lists looks different, although they 
should look the same.




ul {
list-style-type: none;
display: flex;
flex-wrap: wrap;
}

li {
border: solid red thin;
width: 25vw;
}





Item 1
Item 2
Item 3
Item 4


Item 1

Item 2
Item 3
Item 4






Does anyone have an idea on how to fix that? Otherwise I always get 
problems with my markup designer.


Regards
Malte




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



Re: Regarding Browser/Client info implementation

2015-12-22 Thread Tobias Soloschenko
Hi,

would you be so kind and create a PR - this would make it a lot easier to 
comment code lines and to see changes.

To do so simply fork the wicket git repo push changes against the fork and then 
create the PR.

Thank you!

kind regards

Tobias

> Am 22.12.2015 um 15:52 schrieb Rakesh A :
> 
> I tried to create a patch with the changes on Wicket sources, please find
> them attached.
> 
> Patch#1 - Without renaming HTML files
> Patch#2 - With renaming HTML files
> 
> Note: I did not test/execute these changes.
> 
> wicket6-browser-info-changes-NO-RENAME.patch
> 
>   
> wicket6-browser-info-changes-WITH-RENAME.patch
> 
>   
> 
> Regards,
> Rakesh.A
> 
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Regarding-Browser-Client-info-implementation-tp4673024p4673025.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: Regarding Browser/Client info implementation

2015-12-22 Thread Rakesh A
I tried to create a patch with the changes on Wicket sources, please find
them attached.

Patch#1 - Without renaming HTML files
Patch#2 - With renaming HTML files

Note: I did not test/execute these changes.

wicket6-browser-info-changes-NO-RENAME.patch

  
wicket6-browser-info-changes-WITH-RENAME.patch

  

Regards,
Rakesh.A

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Regarding-Browser-Client-info-implementation-tp4673024p4673025.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



Regarding Browser/Client info implementation

2015-12-22 Thread Rakesh A
Hi,

I was trying to use WebClientInfo to get browser information on the server,
and also extend the implementation in Wicket 6.x, reasons for me to extend
Wicket's implementation are
1. Current implementation does not allow me to detect browser's touch api
support
2. Wanted to use client side implementation library to detect browser
features - like Modernizr.

On a brief look at the implementation I thought it is possible, but I ended
up copy/pasting lot of code to workaround the problems I faced.
Changing the implementation a bit might allow extension to Wicket's
implementation. As changes are more, I created a quick start to show the
changes required in Wicket's implementation. Please find the attached quick
start.
1. I've copied and changed Wicket's implementation and they can be found in
package "in.rakesh.example.wicket.page.browserinfo"
2. Extension to this implementation can be found under package
"in.rakesh.example.wicket.page"

Another problem I'd while doing these changes is regarding 'WebClientInfo'
object creation. Current implementation creates instances in multiple
places, making it difficult to have a subclass/extension to it.

Adding a method to WebSession (WebSession#createClientInfo()), and using it
to create instance gives lot of flexibility to extend it.

In the attached quick start, I've added TODOs which need to be
updated/corrected, if we've a method in WebSession.

Can you please provide your views on this change.

browserinfo.7z
  

Regards,
Rakesh.A

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Regarding-Browser-Client-info-implementation-tp4673024.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: Delete old feedback messages

2015-12-22 Thread Marco Di Sabatino Di Diodoro



Il 22/12/2015 13:01, Martin Grigorov ha scritto:

Just set a default cleanup filter that clears all messages, not just the
rendered ones.

Thanks for your help. It's works
Marco


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Dec 22, 2015 at 12:54 PM, Marco Di Sabatino Di Diodoro <
marco.disabat...@tirasa.net> wrote:


Hi Martin,

Il 22/12/2015 12:14, Martin Grigorov ha scritto:


Hi,

By default Wicket removes all _rendered_ messages. If they are not
rendered
in the previous request cycle then they stay for the next one.
See
org.apache.wicket.settings.ApplicationSettings#setFeedbackMessageCleanupFilter()
and org.apache.wicket.feedback.DefaultCleanupFeedbackMessageFilter


thanks for your help. but how can I force the cleaning. I saw the two
methods, but it's not clear to me how I should do.

Marco


Martin Grigorov

Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Dec 22, 2015 at 11:25 AM, Marco Di Sabatino Di Diodoro <
marco.disabat...@tirasa.net> wrote:

Hi all,

how can I delete old feedback messagesfor a new request?The previous
feedback messages are not deleted from the list.

Regards
Marco

--
Dott. Marco Di Sabatino Di Diodoro
Tel. +39 3939065570

Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973
http://www.tirasa.net

Apache Syncope PMC Member
http://people.apache.org/~mdisabatino/




--
Dott. Marco Di Sabatino Di Diodoro
Tel. +39 3939065570

Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973
http://www.tirasa.net

Apache Syncope PMC Member
http://people.apache.org/~mdisabatino/




--
Dott. Marco Di Sabatino Di Diodoro
Tel. +39 3939065570

Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973
http://www.tirasa.net

Apache Syncope PMC Member
http://people.apache.org/~mdisabatino/


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



Re: Delete old feedback messages

2015-12-22 Thread Martin Grigorov
Just set a default cleanup filter that clears all messages, not just the
rendered ones.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Dec 22, 2015 at 12:54 PM, Marco Di Sabatino Di Diodoro <
marco.disabat...@tirasa.net> wrote:

> Hi Martin,
>
> Il 22/12/2015 12:14, Martin Grigorov ha scritto:
>
>> Hi,
>>
>> By default Wicket removes all _rendered_ messages. If they are not
>> rendered
>> in the previous request cycle then they stay for the next one.
>> See
>> org.apache.wicket.settings.ApplicationSettings#setFeedbackMessageCleanupFilter()
>> and org.apache.wicket.feedback.DefaultCleanupFeedbackMessageFilter
>>
> thanks for your help. but how can I force the cleaning. I saw the two
> methods, but it's not clear to me how I should do.
>
> Marco
>
>
> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Tue, Dec 22, 2015 at 11:25 AM, Marco Di Sabatino Di Diodoro <
>> marco.disabat...@tirasa.net> wrote:
>>
>> Hi all,
>>>
>>> how can I delete old feedback messagesfor a new request?The previous
>>> feedback messages are not deleted from the list.
>>>
>>> Regards
>>> Marco
>>>
>>> --
>>> Dott. Marco Di Sabatino Di Diodoro
>>> Tel. +39 3939065570
>>>
>>> Tirasa S.r.l.
>>> Viale D'Annunzio 267 - 65127 Pescara
>>> Tel +39 0859116307 / FAX +39 085973
>>> http://www.tirasa.net
>>>
>>> Apache Syncope PMC Member
>>> http://people.apache.org/~mdisabatino/
>>>
>>>
>>>
> --
> Dott. Marco Di Sabatino Di Diodoro
> Tel. +39 3939065570
>
> Tirasa S.r.l.
> Viale D'Annunzio 267 - 65127 Pescara
> Tel +39 0859116307 / FAX +39 085973
> http://www.tirasa.net
>
> Apache Syncope PMC Member
> http://people.apache.org/~mdisabatino/
>
>


Re: Delete old feedback messages

2015-12-22 Thread Marco Di Sabatino Di Diodoro

Hi Martin,

Il 22/12/2015 12:14, Martin Grigorov ha scritto:

Hi,

By default Wicket removes all _rendered_ messages. If they are not rendered
in the previous request cycle then they stay for the next one.
See 
org.apache.wicket.settings.ApplicationSettings#setFeedbackMessageCleanupFilter()
and org.apache.wicket.feedback.DefaultCleanupFeedbackMessageFilter
thanks for your help. but how can I force the cleaning. I saw the two 
methods, but it's not clear to me how I should do.


Marco


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Dec 22, 2015 at 11:25 AM, Marco Di Sabatino Di Diodoro <
marco.disabat...@tirasa.net> wrote:


Hi all,

how can I delete old feedback messagesfor a new request?The previous
feedback messages are not deleted from the list.

Regards
Marco

--
Dott. Marco Di Sabatino Di Diodoro
Tel. +39 3939065570

Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973
http://www.tirasa.net

Apache Syncope PMC Member
http://people.apache.org/~mdisabatino/




--
Dott. Marco Di Sabatino Di Diodoro
Tel. +39 3939065570

Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973
http://www.tirasa.net

Apache Syncope PMC Member
http://people.apache.org/~mdisabatino/



Re: Delete old feedback messages

2015-12-22 Thread Martin Grigorov
Hi,

By default Wicket removes all _rendered_ messages. If they are not rendered
in the previous request cycle then they stay for the next one.
See 
org.apache.wicket.settings.ApplicationSettings#setFeedbackMessageCleanupFilter()
and org.apache.wicket.feedback.DefaultCleanupFeedbackMessageFilter

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Dec 22, 2015 at 11:25 AM, Marco Di Sabatino Di Diodoro <
marco.disabat...@tirasa.net> wrote:

> Hi all,
>
> how can I delete old feedback messagesfor a new request?The previous
> feedback messages are not deleted from the list.
>
> Regards
> Marco
>
> --
> Dott. Marco Di Sabatino Di Diodoro
> Tel. +39 3939065570
>
> Tirasa S.r.l.
> Viale D'Annunzio 267 - 65127 Pescara
> Tel +39 0859116307 / FAX +39 085973
> http://www.tirasa.net
>
> Apache Syncope PMC Member
> http://people.apache.org/~mdisabatino/
>
>


Delete old feedback messages

2015-12-22 Thread Marco Di Sabatino Di Diodoro

Hi all,

how can I delete old feedback messagesfor a new request?The previous 
feedback messages are not deleted from the list.


Regards
Marco

--
Dott. Marco Di Sabatino Di Diodoro
Tel. +39 3939065570

Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973
http://www.tirasa.net

Apache Syncope PMC Member
http://people.apache.org/~mdisabatino/



Re: Wicket migration 1.4 to 1.5.13 issue with WebmarkupContainer /WebComponent/ByteArrayResource

2015-12-22 Thread Martin Grigorov
Hi,

On Mon, Dec 21, 2015 at 5:11 PM, durairaj t  wrote:

> Hi Martin,
>
> Thank you for your response.
>
> I have tried to explain the issue more clear than before. Please refer the
> below details.
>
>
> This is regarding Wicket 1.4 to 1.5 migration.
>
> *Requirement: *Generate pdf as child within parent - preserve parent
> window using onRequestResource.
>
> *1.4 Code Design:*
> I have Form component with WebMarkupContainer (containing Menu options -
> buttons) as parent and WebComponent (implementing IResourceListner) as
> child.
> The WebComponent has onResourceRequested implemented with Custom class to
> generate pdf via DynamicWebResource.
>
> Here is code snippet for onResourceRequested()
>
> pdfPanel.add(new EmbeddedPDFComponent("pdfReport", null) {
>
> public void onResourceRequested() {
> CustomWebDynamicResource pdfResource = new CustomWebDynamicResource() {
>
> /**
> *
> */
> private static final long serialVersionUID = 1L;
>
> @Override
> protected ResourceState getResourceState() {
> return new ResourceState() {
>
> @Override
> public String getContentType() {
> return "application/pdf";
> }
>
> @Override
> public byte[] getData() {
> data = generatePdfIr();
> return data;
> }
>
> };
> }
>
> };
> pdfResource.onResourceRequested();
>
> }
> }.setOutputMarkupId(true).setMarkupId("pdfReport"));
>
> Here is CustomWebDynamicResource() class:
>
> public abstract class CustomWebDynamicResource extends DynamicWebResource {
>
> // Constructor and other default methods for setting
> /**
> * @see WebResource#setHeaders(WebResponse)
> */
> protected void setHeaders(WebResponse response)
> {
> super.setHeaders(response);
> response.setDateHeader("Expires", -1);
> response.setHeader("Pragma", "public");
> response.setHeader("Cache-Control", "public");
> }
> }
>
>
> *Above is replace as below (with Wicket 1.5):*
>
> getRequestCycle().scheduleRequestHandlerAfterCurrent(new
> ResourceRequestHandler(byteArrayResource, null));
>
> *Problem:*
>
> With above code, the pdf is being generated but the parent menu options
> are no longer available. It seems the above code is replacing the parent.
> If I remove above line, I can see the menu options but pdf is no longer
> generated.
>

What do you mean with "the parent menu are no longer available" ?
With "getRequestCycle().scheduleRequestHandlerAfterCurrent(new
ResourceRequestHandler(byteArrayResource, null));" you tell Wicket to
stream the byteArrayResource to the browser.
If you use "Content-Disposition: ATTACHEMENT" then the browser will show a
dialog asking the user whether to save the file or to open it with the
default software (e.g. Adobe Actobat).
If you use "Content-Disposition: INLINE" then the browser will try to show
the file by using a plugin, i.e. open the .pdf in the browser if possible.
In both cases the parent component should not be affected. Either the page
is at its old state (ATTACHMENT) or completely replaced (INLINE).


>
>
>  Thank you!
>
>
> On Mon, Dec 21, 2015 at 9:24 AM, Martin Grigorov 
> wrote:
>
>> Hi,
>>
>> To be able to help you I'll have to setup a project with 1.4 and try to
>> migrate it.
>> It is not clear in your mail what exactly is the problem. The code
>> snippets are rather long and it hard to guess.
>> Also the code snippets are hard to read. It would be better to use some
>> pastebin service with proper indents and maybe even code coloring.
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Mon, Dec 21, 2015 at 3:14 PM, durairaj t 
>> wrote:
>>
>>> Can any one help on this issue?
>>>
>>>
>>>
>>>
>>> -- Forwarded message --
>>> From: durairaj t 
>>> Date: Fri, Dec 18, 2015 at 4:29 PM
>>> Subject: Wicket migration 1.4 to 1.5.13 issue with WebmarkupContainer
>>> /WebComponent/ByteArrayResource
>>> To: users@wicket.apache.org
>>>
>>>
>>> Hi Team -
>>>
>>>
>>> How to change the below wicket version1.4 code to 1.5.13 , I tried
>>> with WebComponent(String ,IModel model), it doesn't work.
>>>
>>> When I'm using the below code its placing the pdf content in the form
>>> component but not in the WebmarkupContainer.
>>> *getRequestCycle().scheduleRequestHandlerAfterCurrent(new
>>> ResourceRequestHandler(byteArrayResource,null));*
>>>
>>> Thanks for any help.
>>>
>>> *xyzPage.java*
>>>
>>> *--*
>>>
>>> pdfPanel = new WebMarkupContainer("pdfPanel") {
>>> public boolean isVisible() {
>>> return irMode != IRMODE.EDIT;
>>> }
>>> };
>>> pdfPanel.setOutputMarkupId(true);
>>> pdfPanel.setMarkupId("pdfPanel");
>>> pdfPanel.setOutputMarkupPlaceholderTag(true);
>>> add(pdfPanel);
>>>
>>> pdfPanel.add(new EmbeddedPDFComponent("pdfReport", null) {
>>> /**
>>> *
>>> */
>>> private static final long serialVersionUID = 1L;
>>> transient byte[] data = null;
>>>
>>> public boolean isVisible() {
>>> return irMode != IRMODE.EDIT;
>>> }
>>>
>>> @Override
>>> public boolean showToolbar() {
>>> return false;// irMode =