Re: Attach multiple javascript file to a page

2011-08-24 Thread m.ugues
I tried before, same behaviour.

Where could be the problem?
Maybe I should link my javascript and css directly in my html page, but I
read  https://cwiki.apache.org/WICKET/including-css-resources.html here  
that the best practice is linking them (js and css) server-side.

Massimo

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Attach-multiple-javascript-file-to-a-page-tp3763258p3764628.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



Wicket and Scala

2011-08-24 Thread danisevsky
Hello, I am playing with Scala and Wicket and I am not clear about
using val and var when I am working with JPA entity objects (which
are not serializable). For example:

add(new RefreshingView[User](users){
  override def getItemModels(): java.util.Iterator[IModel[User]] = {
var models = new java.util.ArrayList[IModel[User]]();
for(user - getAllUsers()){
  models.add(new EntityDetachableModel[User](user))
}
models.iterator()
  }
  def populateItem(item: Item[User]) = {
val user = item.getModelObject // is this the same like final
User user = item.getModelObject() in Java?
//...
  }
})

if val user = item.getModelObject is the same like:
final User user = item.getModelObject
then I can't use val for entity objects because they are not
serializable and outer class (RefreshingView) holds reference on its
final fields. Is it true?
So should I use always var for non serializable objects?

Thank you in advance for clarification.

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



Re: AJAXDownload Example Doesn't Support Content-Disposition (Save As)

2011-08-24 Thread Igor Racic
Hi,

It worked in IE7. FF/Chrome option setting to download in fixed directory
played here. I changed to ask on every download and now it works (both
ways !).

Is there a way so that right click propose correct name (currenctly it's
like xyz.htm / xyz.htm.part) ?


Thank you and regards,
Igor


2011/8/23 eugenebalt eugeneb...@yahoo.com

 Igor,

 Don't use the AJAXDownload class. There's another way to do it via Ajax,
 and
 get the Save As dialog.

 Click this page:
 https://cwiki.apache.org/WICKET/best-practices-and-gotchas.html

 Go down to the example that starts with or do it like this: (the 2nd
 example in the section Starting download after form submission (Wicket
 1.2))

 This example is using the WebResource.

 [ WebResource export = new WebResource() { ... etc. ]

 Use this WebResource example. Then, add a ResourceLink backed by this
 WebResource.

 I followed it directly and it works. I get the Save As... dialog box and
 the
 file bytes are constructed at the time the link is clicked.

 CODE:
 --

 // Export to Spreadsheet Link

 // 1. Construct a WebResource from Excel bytes
 WebResource export = new WebResource()
 {
@Override
public IResourceStream getResourceStream() {
 ByteArrayResource bar = new
 ByteArrayResource(application/vnd.ms-excel,
 createExcelBytes());
 return bar.getResourceStream();
 }

@Override
protected void setHeaders(WebResponse response) {
 super.setHeaders(response);
response.setAttachmentHeader(report.xls);
}
 };
 export.setCacheable(false);

 // 2. Add a ResourceLink based on the WebResource
 ResourceLink exportLink = new ResourceLink(exportLink, export);

 add(exportLink);
 --


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AJAXDownload-Example-Doesn-t-Support-Content-Disposition-Save-As-tp3760342p3763726.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: Call urlFor(Class, PageParams) outside of request cycle

2011-08-24 Thread lucast
Hi Alex Swan,
I know the post is a bit old now.
I had a similar problem a couple of months ago and the way I got around it
is by creating a non bookmarkable link at same time I created the main
object via the wicket app and I stored it on the DB. 
Quartz then I would fetch the stored link from the DB and send the email
with that link.
The reason I did it that way was because at the time I wanted  to have a non
bookmarkable link with encoded url to hide the parameters I was passing.

Cheers,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Call-urlFor-Class-PageParams-outside-of-request-cycle-tp3392690p3764774.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: ConcurrentModificationException since Update to 1.4.18

2011-08-24 Thread Martin Grigorov
There are no changes in o.a.w.markup.repeater.data package for an year.
org.apache.wicket.markup.repeater.data.DataViewBase.ModelIterator uses
your IDataProvider.iterator() impl.
Do you share IDataProvider instances between pages ? I see it fails in
unit test which makes it even more strange how this is concurrent.

On Wed, Aug 24, 2011 at 12:14 AM, Johannes Schneider
maili...@cedarsoft.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi guys,

 I tried to upgrade to the latest Wicket version (security issues...).
 But now I suddently get that exception:

 Any hints? I didn't change anything knowingly. So I have no idea where
 to search for the solution...


 Thanks a lot,

 Johannes


 HELLO ERROR [main] org.apache.wicket.markup.html.WebPage -
 ^
 HELLO ERROR [main] org.apache.wicket.RequestCycle - Error attaching this
 container for rendering: [MarkupContainer [Component id = navigationUl]]
 org.apache.wicket.WicketRuntimeException: Error attaching this container
 for rendering: [MarkupContainer [Component id = navigationUl]]
        at
 org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1789)
        at org.apache.wicket.Component.onBeforeRender(Component.java:4000)
        at 
 org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
        at org.apache.wicket.Component.beforeRender(Component.java:1103)
        at
 org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1777)
        at org.apache.wicket.Component.onBeforeRender(Component.java:4000)
        at 
 org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
        at org.apache.wicket.Component.beforeRender(Component.java:1103)
        at
 org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1777)
        at org.apache.wicket.Component.onBeforeRender(Component.java:4000)
        at org.apache.wicket.Page.onBeforeRender(Page.java:1550)
        at 
 org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
        at org.apache.wicket.Component.beforeRender(Component.java:1103)
        at org.apache.wicket.Component.prepareForRender(Component.java:2295)
        at org.apache.wicket.Page.prepareForRender(Page.java:1540)
        at org.apache.wicket.Component.prepareForRender(Component.java:2332)
        at org.apache.wicket.Page.renderPage(Page.java:911)
        at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:261)
        at
 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
        at
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1260)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1331)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1438)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:595)
        at
 org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:502)
        at
 org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:414)
        at
 org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:302)
        at com.cedarsoft.page.CedarsoftTest.testIt(CedarsoftTest.java:20)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:243)
        at junit.framework.TestSuite.run(TestSuite.java:238)
        at junit.framework.TestSuite.runTest(TestSuite.java:243)
        at junit.framework.TestSuite.run(TestSuite.java:238)
        at junit.textui.TestRunner.doRun(TestRunner.java:116)
        at
 com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:139)
        at junit.textui.TestRunner.doRun(TestRunner.java:109)
        at
 com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunner.java:52)
        at
 com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
        at 
 com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
 

Re: Wicket and Scala

2011-08-24 Thread Martin Grigorov
Do you experience problems ?
I see no reason this to fail.
I think the constant (val/final) should be declared outside of the
RepeatingView scope and used inside it, then it will be serialized
with it.

On Wed, Aug 24, 2011 at 10:45 AM, danisevsky danisev...@gmail.com wrote:
 Hello, I am playing with Scala and Wicket and I am not clear about
 using val and var when I am working with JPA entity objects (which
 are not serializable). For example:

    add(new RefreshingView[User](users){
      override def getItemModels(): java.util.Iterator[IModel[User]] = {
        var models = new java.util.ArrayList[IModel[User]]();
        for(user - getAllUsers()){
          models.add(new EntityDetachableModel[User](user))
        }
        models.iterator()
      }
      def populateItem(item: Item[User]) = {
        val user = item.getModelObject // is this the same like final
 User user = item.getModelObject() in Java?
        //...
      }
    })

 if val user = item.getModelObject is the same like:
 final User user = item.getModelObject
 then I can't use val for entity objects because they are not
 serializable and outer class (RefreshingView) holds reference on its
 final fields. Is it true?
 So should I use always var for non serializable objects?

 Thank you in advance for clarification.

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





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

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



Re: AJAXDownload Example Doesn't Support Content-Disposition (Save As)

2011-08-24 Thread Igor Racic
Works by using AttributeModifier for href.
Any objection to use it with AjaxLink ?

Thank you and regards,
Igor


2011/8/24 Igor Racic igor.ra...@gmail.com

 Hi,

 It worked in IE7. FF/Chrome option setting to download in fixed directory
 played here. I changed to ask on every download and now it works (both
 ways !).

 Is there a way so that right click propose correct name (currenctly it's
 like xyz.htm / xyz.htm.part) ?


 Thank you and regards,
 Igor


 2011/8/23 eugenebalt eugeneb...@yahoo.com

 Igor,

 Don't use the AJAXDownload class. There's another way to do it via Ajax,
 and
 get the Save As dialog.

 Click this page:
 https://cwiki.apache.org/WICKET/best-practices-and-gotchas.html

 Go down to the example that starts with or do it like this: (the 2nd
 example in the section Starting download after form submission (Wicket
 1.2))

 This example is using the WebResource.

 [ WebResource export = new WebResource() { ... etc. ]

 Use this WebResource example. Then, add a ResourceLink backed by this
 WebResource.

 I followed it directly and it works. I get the Save As... dialog box and
 the
 file bytes are constructed at the time the link is clicked.

 CODE:
 --

 // Export to Spreadsheet Link

 // 1. Construct a WebResource from Excel bytes
 WebResource export = new WebResource()
 {
@Override
public IResourceStream getResourceStream() {
 ByteArrayResource bar = new
 ByteArrayResource(application/vnd.ms-excel,
 createExcelBytes());
 return bar.getResourceStream();
 }

@Override
protected void setHeaders(WebResponse response) {
 super.setHeaders(response);
response.setAttachmentHeader(report.xls);
}
 };
 export.setCacheable(false);

 // 2. Add a ResourceLink based on the WebResource
 ResourceLink exportLink = new ResourceLink(exportLink, export);

 add(exportLink);
 --


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AJAXDownload-Example-Doesn-t-Support-Content-Disposition-Save-As-tp3760342p3763726.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: Wicket and Scala

2011-08-24 Thread Bruno Borges
Define as var

I had some serialization problems with that too.



On Wed, Aug 24, 2011 at 9:55 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Do you experience problems ?
 I see no reason this to fail.
 I think the constant (val/final) should be declared outside of the
 RepeatingView scope and used inside it, then it will be serialized
 with it.

 On Wed, Aug 24, 2011 at 10:45 AM, danisevsky danisev...@gmail.com wrote:
  Hello, I am playing with Scala and Wicket and I am not clear about
  using val and var when I am working with JPA entity objects (which
  are not serializable). For example:
 
 add(new RefreshingView[User](users){
   override def getItemModels(): java.util.Iterator[IModel[User]] = {
 var models = new java.util.ArrayList[IModel[User]]();
 for(user - getAllUsers()){
   models.add(new EntityDetachableModel[User](user))
 }
 models.iterator()
   }
   def populateItem(item: Item[User]) = {
 val user = item.getModelObject // is this the same like final
  User user = item.getModelObject() in Java?
 //...
   }
 })
 
  if val user = item.getModelObject is the same like:
  final User user = item.getModelObject
  then I can't use val for entity objects because they are not
  serializable and outer class (RefreshingView) holds reference on its
  final fields. Is it true?
  So should I use always var for non serializable objects?
 
  Thank you in advance for clarification.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 



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

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




Ajax-refreshing parent page from modal window with Page content

2011-08-24 Thread lunchbox
Hi all,

This question has been asked here several times before but there is really
no satisfactory answer.

I have a modal window using PageCreator, and I need to ajax-refresh some
components on the parent page from where the modal window is opened, when it
is closed. I'm have a markup container on the parent page which I add to the
AjaxRequestTarget when closing the modal window from an ajax link.

However, when the modal window uses a PageCreator, I see from the Javascript
console it will not find the container, probably because the container lives
in a separate Document. When the modal window uses a Panel instead of Page,
it works correctly.

Here is the error you get when using a Page:
ERROR: Component with id [[container4]] a was not found while trying to
perform markup update. Make sure you called
component.setOutputMarkupId(true) on the component whose markup you are
trying to update. 

I need a Page since the modal window will contain other modal windows.

Usually the proposed solution is to add container.setOutputMarkupId(true);
this is indeed a requirement but it will simply not help when using a Page
(instead of Panel) for the modal window.

*Please, how can I get the parent page's container ajax-refreshed when
closing the modal window (which contains a Page)?*

Thank you,
Lunchbox

Please see:
http://apache-wicket.1842946.n4.nabble.com/modal-window-with-iframe-ajax-refresh-on-parent-page-td1878881.html
http://apache-wicket.1842946.n4.nabble.com/Updating-Main-Page-From-Modal-Using-AJAX-td1874542.html

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-refreshing-parent-page-from-modal-window-with-Page-content-tp3765286p3765286.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: Ajax-refreshing parent page from modal window with Page content

2011-08-24 Thread Martin Grigorov
When a Page is used the modalWindow is loaded in an iframe, that's why
it cannot find the elements in the parent page with the current
implementation of wicket-ajax.js.

What's the problem to load several panel based modalwindows ?

On Wed, Aug 24, 2011 at 4:21 PM, lunchbox lunchbox4s...@gmail.com wrote:
 Hi all,

 This question has been asked here several times before but there is really
 no satisfactory answer.

 I have a modal window using PageCreator, and I need to ajax-refresh some
 components on the parent page from where the modal window is opened, when it
 is closed. I'm have a markup container on the parent page which I add to the
 AjaxRequestTarget when closing the modal window from an ajax link.

 However, when the modal window uses a PageCreator, I see from the Javascript
 console it will not find the container, probably because the container lives
 in a separate Document. When the modal window uses a Panel instead of Page,
 it works correctly.

 Here is the error you get when using a Page:
 ERROR: Component with id [[container4]] a was not found while trying to
 perform markup update. Make sure you called
 component.setOutputMarkupId(true) on the component whose markup you are
 trying to update.

 I need a Page since the modal window will contain other modal windows.

 Usually the proposed solution is to add container.setOutputMarkupId(true);
 this is indeed a requirement but it will simply not help when using a Page
 (instead of Panel) for the modal window.

 *Please, how can I get the parent page's container ajax-refreshed when
 closing the modal window (which contains a Page)?*

 Thank you,
 Lunchbox

 Please see:
 http://apache-wicket.1842946.n4.nabble.com/modal-window-with-iframe-ajax-refresh-on-parent-page-td1878881.html
 http://apache-wicket.1842946.n4.nabble.com/Updating-Main-Page-From-Modal-Using-AJAX-td1874542.html

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Ajax-refreshing-parent-page-from-modal-window-with-Page-content-tp3765286p3765286.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





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

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



Re: Ajax-refreshing parent page from modal window with Page content

2011-08-24 Thread lunchbox
Hi Martin,

Thank you for your reply. I cannot recall what problem there was nesting
Panel-based modal windows, but there was something :(

Let me try that solution -- I'll get right back with my findings for any
extra advice. A small POC seemed to work OK though.

Thanks,
Lunchbox

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-refreshing-parent-page-from-modal-window-with-Page-content-tp3765286p3765550.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: Ajax-refreshing parent page from modal window with Page content

2011-08-24 Thread lunchbox
Hi again Martin,

I tried using Panels now, it seems I get some other problem now:

78Wicket.Ajax: Wicket.Ajax.Call.submitFormById: Trying to submit form with
id 'form3b' that is not in document.

This is not the problem I ran into before though :[

I'm finished for today so I'll have to get back to this tomorrow. But thanks
for your advice, and hopefully you will have some time tomorrow to check my
progress :)

Best regards,
Lunchbox

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-refreshing-parent-page-from-modal-window-with-Page-content-tp3765286p3765615.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



wicket include in test

2011-08-24 Thread Alexander Gubin

I saw similar post about 2 years ago, but seems that the question was
left unaswered.

http://wicket-users.markmail.org/message/o6ub7gjxrheevlo4?q=test+include

I have a page with Include, works fine, however when testing I get:

org.apache.wicket.util.resource.ResourceStreamNotFoundException:
Resource http://localhost/BasePageTestCase$1/static/footer.html could
not be opened


Maurice Marrick mentioned setting correct path to WicketTester, so it
can resolve static resources. How would one do that?

I tried / or /static with no luck - same error

please advise

Sincerely,

Alexander

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



Problem with setCacheable(false) (No-Cache Header in WebResource)

2011-08-24 Thread eugenebalt
I have an issue with the setCacheable(false) header in a WebResource (Excel
file).

When the download link for the WebResource is clicked from a secure site
(SSL), there is an error: Internet Explorer cannot find the site. I found
an explanation for this on MS's support site,
http://support.microsoft.com/kb/316431

When Internet Explorer communicates with a secure Web site through SSL,
Internet Explorer enforces any no-cache request. If the header or headers
are present, Internet Explorer does not cache the file. Consequently, Office
cannot open the file. 

Web sites that want to allow this type of operation should remove the
no-cache header or headers. 


However if I remove setCacheable(false), I get a different issue: whenever I
try clicking the download link a 2nd or 3rd time, I get a File Locked for
Editing error even though I closed Excel properly on the 1st time. The 1st
time is fine, it opens the Excel file after the prompt without problems, but
any download of the same file after that, I get the File Locked for
Editing error and there is no other instance of Excel running, I exit Excel
normally after each download.

Maybe this isn't a Wicket issue, but an Excel issue, but I couldn't find any
explanation for why Excel would show a File Locked error when there is no
other instance of Excel running, and no one is holding a lock on the file.
Any ideas?

(Here, we are caching the file, it's coming from the local Temp Internet
Files folder. I removed the setCacheable(false) to get rid of the SSL
error.)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-with-setCacheable-false-No-Cache-Header-in-WebResource-tp3765955p3765955.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



Book covering 1.5

2011-08-24 Thread Fabian Schwarzer
Hi!

Does anyone know if there is anyone out there writing a book covering the 
upcoming Wicket release 1.5?
Or is e.g. Wicket in Action planing a new edition?

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



Re: Wizard step - adding multiple addresses to one client

2011-08-24 Thread nebojsa.nedic


I will definitely go to that direction and then we will see what will
happen.

Thank you Sven for your help.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wizard-step-adding-multiple-addresses-to-one-client-tp3763189p3765991.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: Problem with setCacheable(false) (No-Cache Header in WebResource)

2011-08-24 Thread eugenebalt
Guys, what exactly happens when I do setCacheable(false) on a WebResource?

Does that mean the downloaded file isn't cached locally? That can't be true,
because I am getting a file called report[1].xls where the [1] indicates
that it was saved in my Temp Internet Files folder, even when I do
setCacheable(false).

So what's the functionality of this command, with respect to files getting
stored in the Temp Internet folder?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-with-setCacheable-false-No-Cache-Header-in-WebResource-tp3765955p3766312.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: Problem with setCacheable(false) (No-Cache Header in WebResource)

2011-08-24 Thread eugenebalt
So to summarize:

1) When I do setCacheable(false), I can open my Excel link multiple times by
clicking the same link, no problems

2) When I do setCacheable(true), I get File Locked on my Excel any time
after the 1st download, and then I have to Delete Temporary Internet Files.
Once I delete my temp IE files, it's fine again, and I can download once
more, until I do it a second time, etc.

It looks like BOTH of these write a temp file into the temp IE directory.

But maybe the browser, or server, is still holding a lock in the 2nd case?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-with-setCacheable-false-No-Cache-Header-in-WebResource-tp3765955p3766351.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



Create Url for Application Homepage

2011-08-24 Thread Christian Huber

Hi,

the method Component#urlFor(Class pageClass, PageParameters parameters) 
allows you to create an application relative link that could be used as 
dynamic links or stored in a database to be accessed later. Now I 
noticed that links created for the page set as the applications HomePage 
the result does not contain the wicket:bookmarkablePage portion. I 
figure this is an optimization.


Those links work fine as long as the HomePage class does not change. But 
what if due to some refactoring you want to set another page as 
application HomePage? Since those links usually contain page dependent 
parameters the chance old bookmark links won't work or even cause an 
application error are pretty high.


So I would like to avoid this optimization to kick in and have all links 
created in the same way. Does anyone know if this can be done?


Thanks, Chris

--
The Sanity Resort http://sanityresort.blogspot.com/


Re: ConcurrentModificationException since Update to 1.4.18

2011-08-24 Thread Johannes Schneider
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thanks for your answer.

On 24.08.2011 14:43, Martin Grigorov wrote:
 There are no changes in o.a.w.markup.repeater.data package for an year.
 org.apache.wicket.markup.repeater.data.DataViewBase.ModelIterator uses
 your IDataProvider.iterator() impl.
 Do you share IDataProvider instances between pages ? I see it fails in
 unit test which makes it even more strange how this is concurrent.

So I think it is a bug within my software. Propably another dependency
that has been updated or some other strange side effect.
I will investigate that stuff further...


Regards,

Johannes

 
 On Wed, Aug 24, 2011 at 12:14 AM, Johannes Schneider
 maili...@cedarsoft.com wrote:
 Hi guys,
 
 I tried to upgrade to the latest Wicket version (security issues...).
 But now I suddently get that exception:
 
 Any hints? I didn't change anything knowingly. So I have no idea where
 to search for the solution...
 
 
 Thanks a lot,
 
 Johannes
 
 
 HELLO ERROR [main] org.apache.wicket.markup.html.WebPage -
 ^
 HELLO ERROR [main] org.apache.wicket.RequestCycle - Error attaching this
 container for rendering: [MarkupContainer [Component id = navigationUl]]
 org.apache.wicket.WicketRuntimeException: Error attaching this container
 for rendering: [MarkupContainer [Component id = navigationUl]]
at
 org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1789)
at org.apache.wicket.Component.onBeforeRender(Component.java:4000)
at 
 org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
at org.apache.wicket.Component.beforeRender(Component.java:1103)
at
 org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1777)
at org.apache.wicket.Component.onBeforeRender(Component.java:4000)
at 
 org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
at org.apache.wicket.Component.beforeRender(Component.java:1103)
at
 org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1777)
at org.apache.wicket.Component.onBeforeRender(Component.java:4000)
at org.apache.wicket.Page.onBeforeRender(Page.java:1550)
at 
 org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
at org.apache.wicket.Component.beforeRender(Component.java:1103)
at org.apache.wicket.Component.prepareForRender(Component.java:2295)
at org.apache.wicket.Page.prepareForRender(Page.java:1540)
at org.apache.wicket.Component.prepareForRender(Component.java:2332)
at org.apache.wicket.Page.renderPage(Page.java:911)
at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:261)
at
 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
at
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1260)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1331)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1438)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:595)
at
 org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:502)
at
 org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:414)
at
 org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:302)
at com.cedarsoft.page.CedarsoftTest.testIt(CedarsoftTest.java:20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at
 com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:139)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at
 com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunner.java:52)
at
 

Re: Create Url for Application Homepage

2011-08-24 Thread Martin Grigorov
mount your home page
for HomePage1: /home1
for HomePage2: /home2

voila!

On Wed, Aug 24, 2011 at 10:28 PM, Christian Huber hub...@butterbrot.org wrote:
 Hi,

 the method Component#urlFor(Class pageClass, PageParameters parameters)
 allows you to create an application relative link that could be used as
 dynamic links or stored in a database to be accessed later. Now I noticed
 that links created for the page set as the applications HomePage the result
 does not contain the wicket:bookmarkablePage portion. I figure this is an
 optimization.

 Those links work fine as long as the HomePage class does not change. But
 what if due to some refactoring you want to set another page as application
 HomePage? Since those links usually contain page dependent parameters the
 chance old bookmark links won't work or even cause an application error are
 pretty high.

 So I would like to avoid this optimization to kick in and have all links
 created in the same way. Does anyone know if this can be done?

 Thanks, Chris

 --
 The Sanity Resort http://sanityresort.blogspot.com/




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

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



Re: Create Url for Application Homepage

2011-08-24 Thread Christian Huber

Aaaahh.. cool. Works great. Thanks :-)

The Sanity Resort http://sanityresort.blogspot.com/

Am 24.08.2011 21:44, schrieb Martin Grigorov:

mount your home page
for HomePage1: /home1
for HomePage2: /home2

voila!

On Wed, Aug 24, 2011 at 10:28 PM, Christian Huberhub...@butterbrot.org  wrote:

Hi,

the method Component#urlFor(Class pageClass, PageParameters parameters)
allows you to create an application relative link that could be used as
dynamic links or stored in a database to be accessed later. Now I noticed
that links created for the page set as the applications HomePage the result
does not contain the wicket:bookmarkablePage portion. I figure this is an
optimization.

Those links work fine as long as the HomePage class does not change. But
what if due to some refactoring you want to set another page as application
HomePage? Since those links usually contain page dependent parameters the
chance old bookmark links won't work or even cause an application error are
pretty high.

So I would like to avoid this optimization to kick in and have all links
created in the same way. Does anyone know if this can be done?

Thanks, Chris

--
The Sanity Resorthttp://sanityresort.blogspot.com/






Re: Sorting Feedback Messages

2011-08-24 Thread Peter Ertl
actually the message property for FeedbackMessage is of type 
java.io.Serializable, not java.lang.String. So you can can add your own custom 
error message class instead of a plain string.

e.g. inside your page

  error(new MessageWithSortCriteria(foobar, 4711))

with 

public class MessageWithSortCriteria implements Serializable
{
  public MessageWithSortCriteria(String message, int sortOrder)
  {
  }

 // ...
}

this useless sample is just to give you an impression :-)

then use a message sorter as Martin said that uses the attribute if present...

only thing you have to care about is that toString() is overridden and returns 
a user-readable string for rendering messages to the screen.

Am 23.08.2011 um 20:39 schrieb Christian Huber:

 Yes, as i wrote this would be the way to impose a custom sorting on messages 
 but at the moment the FilterMessage class does not provide dedicated fields 
 that could be used for a sorting metric. So i was wondering if there are 
 plans to provide such a thing or if we will be bound to incooperate this kind 
 of information into the messages themselves.
 
 The Sanity Resort http://sanityresort.blogspot.com/
 
 Am 23.08.2011 19:21, schrieb Martin Grigorov:
 I think 
 org.apache.wicket.markup.html.panel.FeedbackPanel.setSortingComparator(ComparatorFeedbackMessage)
 is for that
 
 On Tue, Aug 23, 2011 at 8:10 PM, Christian Huberhub...@butterbrot.org  
 wrote:
 Hi,
 
 I was wondering if there is a way to have feedback messages show up in
 certain order. Like, when you have multiple messages for the user you might
 want to have the most general one (e.g. success/failure) at the top and
 other detail messages shown below.
 
 From what I have seen so far it looks like this is not possible (at least
 not with 1.4.18)
 
 As a default messages are rendered in the order they have been provided, so
 usually you can just collect the messages you want to display and then add
 them at the end of your request in the desired order. But there can be
 circumstances where this is not feasible or at least pretty anoying.
 
 I have seen that a FeedbackPanel can be given a comparator to sort the
 messages but the feedback messages only provide a level field to distinguish
 between info, debug, errror etc. To impose a proper priority order one would
 need a metric orthogonal to message levels preferrably represented by a
 primitive (double would give the biggest freedom here).
 
 The Component class could be extended to provide additional methods like
 Component#info(String message, double priority) and messages which do not
 have a priority get assigned a default value specified in the Application
 class (could be 0 in the standard implementation).
 
 Would this be a useful/sensible addition? Is such a thing planned for future
 releases or maybe already available and I just did not see it?
 
 One workaround/hack to implement this with the current version could be to
 prefix all messages with a numeric string and use a Comparator to parse this
 string and sort accordingly.
 
 Cheers, Chris
 
 --
 The Sanity Resorthttp://sanityresort.blogspot.com/
 
 
 


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



Re: Sorting Feedback Messages

2011-08-24 Thread Peter Ertl
seems like this works only for error(Serializable)

the required methods for info() and warn() accepting serializable are missing

changing these in 1.4 would mean an api break

however you can add any kind of message easily with

   Session.get().getFeedbackMessages().add(new FeedbackMessage(reporter, 
message, level))

...

Am 25.08.2011 um 00:18 schrieb Peter Ertl:

 actually the message property for FeedbackMessage is of type 
 java.io.Serializable, not java.lang.String. So you can can add your own 
 custom error message class instead of a plain string.
 
 e.g. inside your page
 
  error(new MessageWithSortCriteria(foobar, 4711))
 
 with 
 
 public class MessageWithSortCriteria implements Serializable
 {
  public MessageWithSortCriteria(String message, int sortOrder)
  {
  }
 
 // ...
 }
 
 this useless sample is just to give you an impression :-)
 
 then use a message sorter as Martin said that uses the attribute if present...
 
 only thing you have to care about is that toString() is overridden and 
 returns a user-readable string for rendering messages to the screen.
 
 Am 23.08.2011 um 20:39 schrieb Christian Huber:
 
 Yes, as i wrote this would be the way to impose a custom sorting on messages 
 but at the moment the FilterMessage class does not provide dedicated fields 
 that could be used for a sorting metric. So i was wondering if there are 
 plans to provide such a thing or if we will be bound to incooperate this 
 kind of information into the messages themselves.
 
 The Sanity Resort http://sanityresort.blogspot.com/
 
 Am 23.08.2011 19:21, schrieb Martin Grigorov:
 I think 
 org.apache.wicket.markup.html.panel.FeedbackPanel.setSortingComparator(ComparatorFeedbackMessage)
 is for that
 
 On Tue, Aug 23, 2011 at 8:10 PM, Christian Huberhub...@butterbrot.org  
 wrote:
 Hi,
 
 I was wondering if there is a way to have feedback messages show up in
 certain order. Like, when you have multiple messages for the user you might
 want to have the most general one (e.g. success/failure) at the top and
 other detail messages shown below.
 
 From what I have seen so far it looks like this is not possible (at least
 not with 1.4.18)
 
 As a default messages are rendered in the order they have been provided, so
 usually you can just collect the messages you want to display and then add
 them at the end of your request in the desired order. But there can be
 circumstances where this is not feasible or at least pretty anoying.
 
 I have seen that a FeedbackPanel can be given a comparator to sort the
 messages but the feedback messages only provide a level field to 
 distinguish
 between info, debug, errror etc. To impose a proper priority order one 
 would
 need a metric orthogonal to message levels preferrably represented by a
 primitive (double would give the biggest freedom here).
 
 The Component class could be extended to provide additional methods like
 Component#info(String message, double priority) and messages which do not
 have a priority get assigned a default value specified in the Application
 class (could be 0 in the standard implementation).
 
 Would this be a useful/sensible addition? Is such a thing planned for 
 future
 releases or maybe already available and I just did not see it?
 
 One workaround/hack to implement this with the current version could be to
 prefix all messages with a numeric string and use a Comparator to parse 
 this
 string and sort accordingly.
 
 Cheers, Chris
 
 --
 The Sanity Resorthttp://sanityresort.blogspot.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: Sorting Feedback Messages

2011-08-24 Thread Igor Vaynberg
there is a long standing issue in jira to address this. something to
queue for 1.6

-igor


On Wed, Aug 24, 2011 at 3:24 PM, Peter Ertl pe...@gmx.org wrote:
 seems like this works only for error(Serializable)

 the required methods for info() and warn() accepting serializable are missing

 changing these in 1.4 would mean an api break

 however you can add any kind of message easily with

   Session.get().getFeedbackMessages().add(new FeedbackMessage(reporter, 
 message, level))

 ...

 Am 25.08.2011 um 00:18 schrieb Peter Ertl:

 actually the message property for FeedbackMessage is of type 
 java.io.Serializable, not java.lang.String. So you can can add your own 
 custom error message class instead of a plain string.

 e.g. inside your page

  error(new MessageWithSortCriteria(foobar, 4711))

 with

 public class MessageWithSortCriteria implements Serializable
 {
  public MessageWithSortCriteria(String message, int sortOrder)
  {
  }

 // ...
 }

 this useless sample is just to give you an impression :-)

 then use a message sorter as Martin said that uses the attribute if 
 present...

 only thing you have to care about is that toString() is overridden and 
 returns a user-readable string for rendering messages to the screen.

 Am 23.08.2011 um 20:39 schrieb Christian Huber:

 Yes, as i wrote this would be the way to impose a custom sorting on 
 messages but at the moment the FilterMessage class does not provide 
 dedicated fields that could be used for a sorting metric. So i was 
 wondering if there are plans to provide such a thing or if we will be bound 
 to incooperate this kind of information into the messages themselves.

 The Sanity Resort http://sanityresort.blogspot.com/

 Am 23.08.2011 19:21, schrieb Martin Grigorov:
 I think 
 org.apache.wicket.markup.html.panel.FeedbackPanel.setSortingComparator(ComparatorFeedbackMessage)
 is for that

 On Tue, Aug 23, 2011 at 8:10 PM, Christian Huberhub...@butterbrot.org  
 wrote:
 Hi,

 I was wondering if there is a way to have feedback messages show up in
 certain order. Like, when you have multiple messages for the user you 
 might
 want to have the most general one (e.g. success/failure) at the top and
 other detail messages shown below.

 From what I have seen so far it looks like this is not possible (at least
 not with 1.4.18)

 As a default messages are rendered in the order they have been provided, 
 so
 usually you can just collect the messages you want to display and then add
 them at the end of your request in the desired order. But there can be
 circumstances where this is not feasible or at least pretty anoying.

 I have seen that a FeedbackPanel can be given a comparator to sort the
 messages but the feedback messages only provide a level field to 
 distinguish
 between info, debug, errror etc. To impose a proper priority order one 
 would
 need a metric orthogonal to message levels preferrably represented by a
 primitive (double would give the biggest freedom here).

 The Component class could be extended to provide additional methods like
 Component#info(String message, double priority) and messages which do not
 have a priority get assigned a default value specified in the Application
 class (could be 0 in the standard implementation).

 Would this be a useful/sensible addition? Is such a thing planned for 
 future
 releases or maybe already available and I just did not see it?

 One workaround/hack to implement this with the current version could be to
 prefix all messages with a numeric string and use a Comparator to parse 
 this
 string and sort accordingly.

 Cheers, Chris

 --
 The Sanity Resorthttp://sanityresort.blogspot.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



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



Re: Sorting Feedback Messages

2011-08-24 Thread Peter Ertl
igor, you mean the sorting criteria or supporting java.io.Serializable for 
info(), warn(), error(), success() ?

1.5 accepts Serializable for these methods already...

So one more nice feature when you upgrade to 1.5 :-)

Am 25.08.2011 um 00:31 schrieb Igor Vaynberg:

 there is a long standing issue in jira to address this. something to
 queue for 1.6
 
 -igor
 
 
 On Wed, Aug 24, 2011 at 3:24 PM, Peter Ertl pe...@gmx.org wrote:
 seems like this works only for error(Serializable)
 
 the required methods for info() and warn() accepting serializable are missing
 
 changing these in 1.4 would mean an api break
 
 however you can add any kind of message easily with
 
   Session.get().getFeedbackMessages().add(new FeedbackMessage(reporter, 
 message, level))
 
 ...
 
 Am 25.08.2011 um 00:18 schrieb Peter Ertl:
 
 actually the message property for FeedbackMessage is of type 
 java.io.Serializable, not java.lang.String. So you can can add your own 
 custom error message class instead of a plain string.
 
 e.g. inside your page
 
  error(new MessageWithSortCriteria(foobar, 4711))
 
 with
 
 public class MessageWithSortCriteria implements Serializable
 {
  public MessageWithSortCriteria(String message, int sortOrder)
  {
  }
 
 // ...
 }
 
 this useless sample is just to give you an impression :-)
 
 then use a message sorter as Martin said that uses the attribute if 
 present...
 
 only thing you have to care about is that toString() is overridden and 
 returns a user-readable string for rendering messages to the screen.
 
 Am 23.08.2011 um 20:39 schrieb Christian Huber:
 
 Yes, as i wrote this would be the way to impose a custom sorting on 
 messages but at the moment the FilterMessage class does not provide 
 dedicated fields that could be used for a sorting metric. So i was 
 wondering if there are plans to provide such a thing or if we will be 
 bound to incooperate this kind of information into the messages themselves.
 
 The Sanity Resort http://sanityresort.blogspot.com/
 
 Am 23.08.2011 19:21, schrieb Martin Grigorov:
 I think 
 org.apache.wicket.markup.html.panel.FeedbackPanel.setSortingComparator(ComparatorFeedbackMessage)
 is for that
 
 On Tue, Aug 23, 2011 at 8:10 PM, Christian Huberhub...@butterbrot.org  
 wrote:
 Hi,
 
 I was wondering if there is a way to have feedback messages show up in
 certain order. Like, when you have multiple messages for the user you 
 might
 want to have the most general one (e.g. success/failure) at the top and
 other detail messages shown below.
 
 From what I have seen so far it looks like this is not possible (at least
 not with 1.4.18)
 
 As a default messages are rendered in the order they have been provided, 
 so
 usually you can just collect the messages you want to display and then 
 add
 them at the end of your request in the desired order. But there can be
 circumstances where this is not feasible or at least pretty anoying.
 
 I have seen that a FeedbackPanel can be given a comparator to sort the
 messages but the feedback messages only provide a level field to 
 distinguish
 between info, debug, errror etc. To impose a proper priority order one 
 would
 need a metric orthogonal to message levels preferrably represented by a
 primitive (double would give the biggest freedom here).
 
 The Component class could be extended to provide additional methods like
 Component#info(String message, double priority) and messages which do not
 have a priority get assigned a default value specified in the Application
 class (could be 0 in the standard implementation).
 
 Would this be a useful/sensible addition? Is such a thing planned for 
 future
 releases or maybe already available and I just did not see it?
 
 One workaround/hack to implement this with the current version could be 
 to
 prefix all messages with a numeric string and use a Comparator to parse 
 this
 string and sort accordingly.
 
 Cheers, Chris
 
 --
 The Sanity Resorthttp://sanityresort.blogspot.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
 
 
 
 -
 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: Sorting Feedback Messages

2011-08-24 Thread Peter Ertl
here's the related ticket:

https://issues.apache.org/jira/browse/WICKET-2986


Am 25.08.2011 um 00:47 schrieb Peter Ertl:

 igor, you mean the sorting criteria or supporting java.io.Serializable for 
 info(), warn(), error(), success() ?
 
 1.5 accepts Serializable for these methods already...
 
 So one more nice feature when you upgrade to 1.5 :-)
 
 Am 25.08.2011 um 00:31 schrieb Igor Vaynberg:
 
 there is a long standing issue in jira to address this. something to
 queue for 1.6
 
 -igor
 
 
 On Wed, Aug 24, 2011 at 3:24 PM, Peter Ertl pe...@gmx.org wrote:
 seems like this works only for error(Serializable)
 
 the required methods for info() and warn() accepting serializable are 
 missing
 
 changing these in 1.4 would mean an api break
 
 however you can add any kind of message easily with
 
  Session.get().getFeedbackMessages().add(new FeedbackMessage(reporter, 
 message, level))
 
 ...
 
 Am 25.08.2011 um 00:18 schrieb Peter Ertl:
 
 actually the message property for FeedbackMessage is of type 
 java.io.Serializable, not java.lang.String. So you can can add your own 
 custom error message class instead of a plain string.
 
 e.g. inside your page
 
 error(new MessageWithSortCriteria(foobar, 4711))
 
 with
 
 public class MessageWithSortCriteria implements Serializable
 {
 public MessageWithSortCriteria(String message, int sortOrder)
 {
 }
 
 // ...
 }
 
 this useless sample is just to give you an impression :-)
 
 then use a message sorter as Martin said that uses the attribute if 
 present...
 
 only thing you have to care about is that toString() is overridden and 
 returns a user-readable string for rendering messages to the screen.
 
 Am 23.08.2011 um 20:39 schrieb Christian Huber:
 
 Yes, as i wrote this would be the way to impose a custom sorting on 
 messages but at the moment the FilterMessage class does not provide 
 dedicated fields that could be used for a sorting metric. So i was 
 wondering if there are plans to provide such a thing or if we will be 
 bound to incooperate this kind of information into the messages 
 themselves.
 
 The Sanity Resort http://sanityresort.blogspot.com/
 
 Am 23.08.2011 19:21, schrieb Martin Grigorov:
 I think 
 org.apache.wicket.markup.html.panel.FeedbackPanel.setSortingComparator(ComparatorFeedbackMessage)
 is for that
 
 On Tue, Aug 23, 2011 at 8:10 PM, Christian Huberhub...@butterbrot.org  
 wrote:
 Hi,
 
 I was wondering if there is a way to have feedback messages show up in
 certain order. Like, when you have multiple messages for the user you 
 might
 want to have the most general one (e.g. success/failure) at the top and
 other detail messages shown below.
 
 From what I have seen so far it looks like this is not possible (at 
 least
 not with 1.4.18)
 
 As a default messages are rendered in the order they have been 
 provided, so
 usually you can just collect the messages you want to display and then 
 add
 them at the end of your request in the desired order. But there can be
 circumstances where this is not feasible or at least pretty anoying.
 
 I have seen that a FeedbackPanel can be given a comparator to sort the
 messages but the feedback messages only provide a level field to 
 distinguish
 between info, debug, errror etc. To impose a proper priority order one 
 would
 need a metric orthogonal to message levels preferrably represented by a
 primitive (double would give the biggest freedom here).
 
 The Component class could be extended to provide additional methods like
 Component#info(String message, double priority) and messages which do 
 not
 have a priority get assigned a default value specified in the 
 Application
 class (could be 0 in the standard implementation).
 
 Would this be a useful/sensible addition? Is such a thing planned for 
 future
 releases or maybe already available and I just did not see it?
 
 One workaround/hack to implement this with the current version could be 
 to
 prefix all messages with a numeric string and use a Comparator to parse 
 this
 string and sort accordingly.
 
 Cheers, Chris
 
 --
 The Sanity Resorthttp://sanityresort.blogspot.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
 
 
 
 -
 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 

Re: Sorting Feedback Messages

2011-08-24 Thread Igor Vaynberg
yep, that was the one...i forgot we fixed it.

-igor


On Wed, Aug 24, 2011 at 3:52 PM, Peter Ertl pe...@gmx.org wrote:
 here's the related ticket:

 https://issues.apache.org/jira/browse/WICKET-2986


 Am 25.08.2011 um 00:47 schrieb Peter Ertl:

 igor, you mean the sorting criteria or supporting java.io.Serializable for 
 info(), warn(), error(), success() ?

 1.5 accepts Serializable for these methods already...

 So one more nice feature when you upgrade to 1.5 :-)

 Am 25.08.2011 um 00:31 schrieb Igor Vaynberg:

 there is a long standing issue in jira to address this. something to
 queue for 1.6

 -igor


 On Wed, Aug 24, 2011 at 3:24 PM, Peter Ertl pe...@gmx.org wrote:
 seems like this works only for error(Serializable)

 the required methods for info() and warn() accepting serializable are 
 missing

 changing these in 1.4 would mean an api break

 however you can add any kind of message easily with

  Session.get().getFeedbackMessages().add(new FeedbackMessage(reporter, 
 message, level))

 ...

 Am 25.08.2011 um 00:18 schrieb Peter Ertl:

 actually the message property for FeedbackMessage is of type 
 java.io.Serializable, not java.lang.String. So you can can add your own 
 custom error message class instead of a plain string.

 e.g. inside your page

 error(new MessageWithSortCriteria(foobar, 4711))

 with

 public class MessageWithSortCriteria implements Serializable
 {
 public MessageWithSortCriteria(String message, int sortOrder)
 {
 }

 // ...
 }

 this useless sample is just to give you an impression :-)

 then use a message sorter as Martin said that uses the attribute if 
 present...

 only thing you have to care about is that toString() is overridden and 
 returns a user-readable string for rendering messages to the screen.

 Am 23.08.2011 um 20:39 schrieb Christian Huber:

 Yes, as i wrote this would be the way to impose a custom sorting on 
 messages but at the moment the FilterMessage class does not provide 
 dedicated fields that could be used for a sorting metric. So i was 
 wondering if there are plans to provide such a thing or if we will be 
 bound to incooperate this kind of information into the messages 
 themselves.

 The Sanity Resort http://sanityresort.blogspot.com/

 Am 23.08.2011 19:21, schrieb Martin Grigorov:
 I think 
 org.apache.wicket.markup.html.panel.FeedbackPanel.setSortingComparator(ComparatorFeedbackMessage)
 is for that

 On Tue, Aug 23, 2011 at 8:10 PM, Christian Huberhub...@butterbrot.org 
  wrote:
 Hi,

 I was wondering if there is a way to have feedback messages show up in
 certain order. Like, when you have multiple messages for the user you 
 might
 want to have the most general one (e.g. success/failure) at the top and
 other detail messages shown below.

 From what I have seen so far it looks like this is not possible (at 
 least
 not with 1.4.18)

 As a default messages are rendered in the order they have been 
 provided, so
 usually you can just collect the messages you want to display and then 
 add
 them at the end of your request in the desired order. But there can be
 circumstances where this is not feasible or at least pretty anoying.

 I have seen that a FeedbackPanel can be given a comparator to sort the
 messages but the feedback messages only provide a level field to 
 distinguish
 between info, debug, errror etc. To impose a proper priority order one 
 would
 need a metric orthogonal to message levels preferrably represented by a
 primitive (double would give the biggest freedom here).

 The Component class could be extended to provide additional methods 
 like
 Component#info(String message, double priority) and messages which do 
 not
 have a priority get assigned a default value specified in the 
 Application
 class (could be 0 in the standard implementation).

 Would this be a useful/sensible addition? Is such a thing planned for 
 future
 releases or maybe already available and I just did not see it?

 One workaround/hack to implement this with the current version could 
 be to
 prefix all messages with a numeric string and use a Comparator to 
 parse this
 string and sort accordingly.

 Cheers, Chris

 --
 The Sanity Resorthttp://sanityresort.blogspot.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



 -
 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