Betr.: Re: Modalwindow with confirm box on close button

2010-10-28 Thread Marieke Vandamme
Hello, 

Thanks for the response!
I already use jquery in my project for other stuff, so I would be a 
solution.

I hoped there was a standard fitted solution in wicket.
We override 'getEventHandler' often to override the onclick for a 
behavior,
so why can't there be something like that to override the onclick of the 
close button? 
Does it exist or should i put it as 'new feature'? 

Thanks, Marieke





Andrea Del Bene adelb...@ciseonweb.it 
27/10/2010 16:23
Antwoord a.u.b. aan
users@wicket.apache.org


Aan
users@wicket.apache.org
Cc

Onderwerp
Re: Modalwindow with confirm box on close button






Hi Marieke,

some times ago I've solved a similar problem using JQuery and a plugin 
called jQuery AOP, but I don't know if exists a simpler solution. I used 
jQuery AOP with close button which is a standard anchor with class 
attribute set to 'w_close'. The following script will ask user to 
confirm before closing window without sending any data to server. I hope 
it could help you:


$('a.w_close').each(function(){
jQuery.aop.around( {target: this, method: 'onclick'},
   function(invocation) {

 if(confirm(Are you REALLY sure?)){
 return invocation.proceed();
 }else{
 return false;
 }
   }
 );
});

bye.
 Hello,

 I want to aks the user if he is sure that he wants to close the
 modalwindow.
 Most of the time we use the modalwindow to edit a bean. But when closing
 the modalwindow with close button, we are not sure if the user wants to
 save the data or not.
 Using 'setCloseButtonCallback' is not an option, because showing the
 confirm-box should be just before going to server (or not if user 
doesn't
 confirm).

 Thanks for any help !
 Kind Regards, Marieke Vandamme
  DISCLAIMER 

 http://www.tvh.com/newen2/emaildisclaimer/default.html

 This message is delivered to all addressees subject to the conditions
 set forth in the attached disclaimer, which is an integral part of this
 message.

 


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


 DISCLAIMER 

http://www.tvh.com/newen2/emaildisclaimer/default.html 

This message is delivered to all addressees subject to the conditions
set forth in the attached disclaimer, which is an integral part of this
message.


Re: Wicket 1.5 and GAE

2010-10-28 Thread Alex Objelean

Issue created: https://issues.apache.org/jira/browse/WICKET-3138
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-GAE-tp3016185p3016762.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



RestartResponseAtInterceptPageException / redirectToInterceptPage with PageParameters

2010-10-28 Thread Vishal Popat
Hi all,

 

I am currently using wicket-auth-roles for all pages required authorization
which is working great.

I have a page where information is shown to the user but to see further
information they are required to login. This page uses
IndexedParamUrlCodingStrategy for the URL.

I haven't to found any way to use wicket-auth-roles to do this so I have
done the following:

 

add(new Link(login) {

@Override

public void onClick() {

throw new
RestartResponseAtInterceptPageException(new Login());

}

 

@Override

public boolean isVisible() {

return
!WiaSession.get().isSignedIn();

}

});

 

In the onSubmit code in the Login page I am using the

if (!continueToOriginalDestination()) {

 
setResponsePage(getApplication().getHomePage());

}

 

When clicking the login link it goes to the login page and then back to the
info page but without the PageParameters. Therefore the url is incorrect- it
has ?wicket:interface=:1:1::: and then some of my data is missing because it
requires the PageParameters.

 

How can pass the PageParameters through?

 

Many thanks

Vishal



Re: NoClassDefFoundError on app undeployment

2010-10-28 Thread Marek Pribyl
thanks martin that's really informative. I thought that this funny thing
is tomcat related, but wasn't sure...

On Wed, 2010-10-27 at 17:19 +0200, Martin Grigorov wrote:
 See this discussion:
 http://mail-archives.apache.org/mod_mbox/wicket-users/201003.mbox/%3c23eb48361003222329s4699aa73yf69a512875b29...@mail.gmail.com%3e
 
 On Wed, Oct 27, 2010 at 4:55 PM, Marek Pribyl mr.pri...@gmail.com wrote:
 
  hi all,
  on wicket app undeployment exception listed below appears. is this a
  classloading problem?
 
  thanks in advance for any hint,
  marek
 
  Oct 27, 2010 4:08:55 PM org.apache.catalina.startup.HostConfig
  checkResources
  WARNING: Error during context [/guardian-web] destroy
  java.lang.NoClassDefFoundError:
  org/apache/wicket/util/lang/PropertyResolver
 at
  org.apache.wicket.Application.internalDestroy(Application.java:887)
 at
 
  org.apache.wicket.protocol.http.WebApplication.internalDestroy(WebApplication.java:449)
 at
  org.apache.wicket.protocol.http.WicketFilter.destroy(WicketFilter.java:145)
 at
 
  org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:332)
 at
 
  org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:3728)
 at
  org.apache.catalina.core.StandardContext.stop(StandardContext.java:4490)
 at
  org.apache.catalina.core.ContainerBase.destroy(ContainerBase.java:1164)
 at
  org.apache.catalina.core.StandardContext.destroy(StandardContext.java:4590)
 at
  org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1041)
 at
  org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)
 at
  org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
 at
 
  org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
 at
 
  org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
 at org.apache.catalina.core.ContainerBase
  $ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
 at org.apache.catalina.core.ContainerBase
  $ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
 at org.apache.catalina.core.ContainerBase
  $ContainerBackgroundProcessor.run(ContainerBase.java:1590)
 at java.lang.Thread.run(Thread.java:619)
 
 
  -
  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: Problem with setResponsePage from a thread

2010-10-28 Thread jcgarciam

From the thread you can't request anything to the application server, since
the original request that initiates the threads is already gone, what you
can do is actually create an abstract behavior with a timer that checks the
server (lets say every 5 seconds) for an status and  force a redirection
from there (javascript tricks). Obviously your thread need to update this
status somewhere.



On Thu, Oct 28, 2010 at 5:36 AM, lsm_7 [via Apache Wicket] 
ml-node+3016823-1352866555-65...@n4.nabble.comml-node%2b3016823-1352866555-65...@n4.nabble.com
 wrote:

 Hello everybody,

 I have a form, then when all the fields are filled and I clicked the accept
 button, there's an AJAX event that shows a progress bar in flash and then
 executes onSubmit(). In this event I create a thread to execute other
 internal actions.

 What I want is when the thread finishes, redirect to another WebPage. But
 it seems that I can not interact with redirections from the thread.

 If somebody has any suggestion it would be great!

 The most important part of the code is:

 .

  button.add(new AjaxEventBehavior(onclick){

 @Override
 protected void onEvent(AjaxRequestTarget target) {
 iframe.setVisible(true);
 target.addComponent(iframe);

 onSubmit();

 t = new ThreadXen();
 t.start();
 }
 });
 }

 public void onSubmit() {
 int mem = Integer.parseInt(memory.getValue());
 int swap;

 if (mem  1024)
 swap = mem*2;
 else
 swap = 2048;

 machine = new VirtualMachine();
 machine.setHostname(name.getValue());
 machine.setMemory(mem);
 machine.setDisk(Integer.parseInt(disk.getValue()));
 machine.setSwap(swap);
 machine.setOs(os.getModelObject());
 machine.setPwd(password.getValue());
 machine.setArch(arch.getValue());
 ListString users = assigned.getUsers();
 machine.setAssigned(users);
 }

 public class ThreadXen extends Thread implements Serializable{

 private static final long serialVersionUID =
 6117927184239433259L;

 public void run() {
 XenManager.newMachine(machine);
 setResponsePage(ListMachines.class);
 }
 }

 .


 Thanks in advance


 --
  View message @
 http://apache-wicket.1842946.n4.nabble.com/Problem-with-setResponsePage-from-a-thread-tp3016823p3016823.html
 To start a new topic under Apache Wicket, email
 ml-node+1842946-398011874-65...@n4.nabble.comml-node%2b1842946-398011874-65...@n4.nabble.com
 To unsubscribe from Apache Wicket, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=.





-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
Work smarter, not harder!.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-with-setResponsePage-from-a-thread-tp3016823p3017124.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



Problems displaying a PDF from stream

2010-10-28 Thread Alex Zeit
While trying to display a PDF document from stream following problems
arrise:
IE7:
Resource can not be displaied at all.

Firefox 3.6.12:
PDF is displaied but if Chronk is cleared in Firefox while document is open
then it cannot be displaied again. It is possible only after restarting
Firefox.

No errors in log.

The code:
public class PdfGen extends WebResource {

public PdfGen() {
setCacheable(false);
}

@Override
public IResourceStream getResourceStream() {
IResourceStream resourceStream = new AbstractResourceStreamWriter()
{
private static final long serialVersionUID =
1934248394380163944L;
public void write(OutputStream output) {
testItextDirect(output);
}
public String getContentType() {
return application/pdf;
}
};
return resourceStream;
}

private void testItextDirect(OutputStream output){
try {
Document document = new Document();
PdfWriter.getInstance(document, output);
document.open();
document.add(new Paragraph(Hello World));
document.add(new Paragraph(new Date().toString()));
document.close();
} catch (DocumentException de) {
try {
throw new IOException(de.getMessage());
} catch (IOException e) {
e.printStackTrace();
}
}
}
}


in the init() of AuthenticatedWebApplication SharedResource added like this:
getSharedResources().add(pdfGen, new PdfGen());

Any help would be highly appreciated
Alex


AW: Problems displaying a PDF from stream

2010-10-28 Thread Stefan Lindner
Do you want to open the PDF in a separate window? Klick on some button and open 
a new browser window with pdf?

Stefan

-Ursprüngliche Nachricht-
Von: Alex Zeit [mailto:zeita...@googlemail.com] 
Gesendet: Donnerstag, 28. Oktober 2010 15:14
An: users@wicket.apache.org
Betreff: Problems displaying a PDF from stream

While trying to display a PDF document from stream following problems
arrise:
IE7:
Resource can not be displaied at all.

Firefox 3.6.12:
PDF is displaied but if Chronk is cleared in Firefox while document is open 
then it cannot be displaied again. It is possible only after restarting Firefox.

No errors in log.

The code:
public class PdfGen extends WebResource {

public PdfGen() {
setCacheable(false);
}

@Override
public IResourceStream getResourceStream() {
IResourceStream resourceStream = new AbstractResourceStreamWriter() {
private static final long serialVersionUID = 1934248394380163944L;
public void write(OutputStream output) {
testItextDirect(output);
}
public String getContentType() {
return application/pdf;
}
};
return resourceStream;
}

private void testItextDirect(OutputStream output){
try {
Document document = new Document();
PdfWriter.getInstance(document, output);
document.open();
document.add(new Paragraph(Hello World));
document.add(new Paragraph(new Date().toString()));
document.close();
} catch (DocumentException de) {
try {
throw new IOException(de.getMessage());
} catch (IOException e) {
e.printStackTrace();
}
}
}
}


in the init() of AuthenticatedWebApplication SharedResource added like this:
getSharedResources().add(pdfGen, new PdfGen());

Any help would be highly appreciated
Alex

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



Re: Problems displaying a PDF from stream

2010-10-28 Thread Alex Zeit
Yes

2010/10/28 Stefan Lindner lind...@visionet.de

 Do you want to open the PDF in a separate window? Klick on some button and
 open a new browser window with pdf?

 Stefan

 -Ursprüngliche Nachricht-
 Von: Alex Zeit [mailto:zeita...@googlemail.com]
 Gesendet: Donnerstag, 28. Oktober 2010 15:14
 An: users@wicket.apache.org
 Betreff: Problems displaying a PDF from stream

 While trying to display a PDF document from stream following problems
 arrise:
 IE7:
 Resource can not be displaied at all.

 Firefox 3.6.12:
 PDF is displaied but if Chronk is cleared in Firefox while document is open
 then it cannot be displaied again. It is possible only after restarting
 Firefox.

 No errors in log.

 The code:
 public class PdfGen extends WebResource {

public PdfGen() {
setCacheable(false);
}

@Override
public IResourceStream getResourceStream() {
IResourceStream resourceStream = new AbstractResourceStreamWriter()
 {
private static final long serialVersionUID =
 1934248394380163944L;
public void write(OutputStream output) {
testItextDirect(output);
}
public String getContentType() {
return application/pdf;
}
};
return resourceStream;
}

private void testItextDirect(OutputStream output){
try {
Document document = new Document();
PdfWriter.getInstance(document, output);
document.open();
document.add(new Paragraph(Hello World));
document.add(new Paragraph(new Date().toString()));
document.close();
} catch (DocumentException de) {
try {
throw new IOException(de.getMessage());
} catch (IOException e) {
e.printStackTrace();
}
}
}
 }


 in the init() of AuthenticatedWebApplication SharedResource added like
 this:
 getSharedResources().add(pdfGen, new PdfGen());

 Any help would be highly appreciated
 Alex

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




AW: Problems displaying a PDF from stream

2010-10-28 Thread Stefan Lindner
Try this:



public class MyResourceStreamWriter extends 
AbstractResourceStreamWriter {
private static final long serialVersionUID = 1L;

public MyResourceStreamWriter() {
}

@Override
public void write(final OutputStream output) {
// ! prduce output here and stream it to output
try {
output.flush();
} catch (Exception e) {
e.printStackTrace();
}
}

@Override
public String getContentType() {
return application/pdf;
}
}





LinkT pdfLink = new LinkT(pdf) {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
ResourceStreamRequestTarget rsrt = new 
ResourceStreamRequestTarget(new MyResourceStreamWriter());
//rsrt.setFileName(file.pdf); // use this if yout 
want your browser to ask you wheter you want to save the cownloaded PDF in fil 
efile.pdf
getRequestCycle().setRequestTarget(rsrt);
}
};


pdfLink.setPopupSettings(new PopupSettings(PopupSettings.RESIZABLE | 
PopupSettings.SCROLLBARS));
add(pdfLink);


Stefan


-Ursprüngliche Nachricht-
Von: Alex Zeit [mailto:zeita...@googlemail.com] 
Gesendet: Donnerstag, 28. Oktober 2010 15:21
An: users@wicket.apache.org
Betreff: Re: Problems displaying a PDF from stream

Yes

2010/10/28 Stefan Lindner lind...@visionet.de

 Do you want to open the PDF in a separate window? Klick on some button 
 and open a new browser window with pdf?

 Stefan

 -Ursprüngliche Nachricht-
 Von: Alex Zeit [mailto:zeita...@googlemail.com]
 Gesendet: Donnerstag, 28. Oktober 2010 15:14
 An: users@wicket.apache.org
 Betreff: Problems displaying a PDF from stream

 While trying to display a PDF document from stream following problems
 arrise:
 IE7:
 Resource can not be displaied at all.

 Firefox 3.6.12:
 PDF is displaied but if Chronk is cleared in Firefox while document is 
 open then it cannot be displaied again. It is possible only after 
 restarting Firefox.

 No errors in log.

 The code:
 public class PdfGen extends WebResource {

public PdfGen() {
setCacheable(false);
}

@Override
public IResourceStream getResourceStream() {
IResourceStream resourceStream = new 
 AbstractResourceStreamWriter() {
private static final long serialVersionUID = 
 1934248394380163944L;
public void write(OutputStream output) {
testItextDirect(output);
}
public String getContentType() {
return application/pdf;
}
};
return resourceStream;
}

private void testItextDirect(OutputStream output){
try {
Document document = new Document();
PdfWriter.getInstance(document, output);
document.open();
document.add(new Paragraph(Hello World));
document.add(new Paragraph(new Date().toString()));
document.close();
} catch (DocumentException de) {
try {
throw new IOException(de.getMessage());
} catch (IOException e) {
e.printStackTrace();
}
}
}
 }


 in the init() of AuthenticatedWebApplication SharedResource added like
 this:
 getSharedResources().add(pdfGen, new PdfGen());

 Any help would be highly appreciated
 Alex

 -
 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: Problems displaying a PDF from stream

2010-10-28 Thread Alex Zeit
Thanks a lot Stefan I will try it right now

2010/10/28 Stefan Lindner lind...@visionet.de

 Try this:



public class MyResourceStreamWriter extends
 AbstractResourceStreamWriter {
private static final long serialVersionUID = 1L;

public MyResourceStreamWriter() {
}

@Override
public void write(final OutputStream output) {
// ! prduce output here and stream it to output
try {
output.flush();
} catch (Exception e) {
e.printStackTrace();
}
}

@Override
 public String getContentType() {
return application/pdf;
}
}





 LinkT pdfLink = new LinkT(pdf) {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
ResourceStreamRequestTarget rsrt = new
 ResourceStreamRequestTarget(new MyResourceStreamWriter());
//rsrt.setFileName(file.pdf); // use this if yout
 want your browser to ask you wheter you want to save the cownloaded PDF in
 fil efile.pdf
getRequestCycle().setRequestTarget(rsrt);
}
};


pdfLink.setPopupSettings(new PopupSettings(PopupSettings.RESIZABLE |
 PopupSettings.SCROLLBARS));
add(pdfLink);


 Stefan


 -Ursprüngliche Nachricht-
 Von: Alex Zeit [mailto:zeita...@googlemail.com]
 Gesendet: Donnerstag, 28. Oktober 2010 15:21
 An: users@wicket.apache.org
 Betreff: Re: Problems displaying a PDF from stream

 Yes

 2010/10/28 Stefan Lindner lind...@visionet.de

  Do you want to open the PDF in a separate window? Klick on some button
  and open a new browser window with pdf?
 
  Stefan
 
  -Ursprüngliche Nachricht-
  Von: Alex Zeit [mailto:zeita...@googlemail.com]
  Gesendet: Donnerstag, 28. Oktober 2010 15:14
  An: users@wicket.apache.org
  Betreff: Problems displaying a PDF from stream
 
  While trying to display a PDF document from stream following problems
  arrise:
  IE7:
  Resource can not be displaied at all.
 
  Firefox 3.6.12:
  PDF is displaied but if Chronk is cleared in Firefox while document is
  open then it cannot be displaied again. It is possible only after
  restarting Firefox.
 
  No errors in log.
 
  The code:
  public class PdfGen extends WebResource {
 
 public PdfGen() {
 setCacheable(false);
 }
 
 @Override
 public IResourceStream getResourceStream() {
 IResourceStream resourceStream = new
  AbstractResourceStreamWriter() {
 private static final long serialVersionUID =
  1934248394380163944L;
 public void write(OutputStream output) {
 testItextDirect(output);
 }
 public String getContentType() {
 return application/pdf;
 }
 };
 return resourceStream;
 }
 
 private void testItextDirect(OutputStream output){
 try {
 Document document = new Document();
 PdfWriter.getInstance(document, output);
 document.open();
 document.add(new Paragraph(Hello World));
 document.add(new Paragraph(new Date().toString()));
 document.close();
 } catch (DocumentException de) {
 try {
 throw new IOException(de.getMessage());
 } catch (IOException e) {
 e.printStackTrace();
 }
 }
 }
  }
 
 
  in the init() of AuthenticatedWebApplication SharedResource added like
  this:
  getSharedResources().add(pdfGen, new PdfGen());
 
  Any help would be highly appreciated
  Alex
 
  -
  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: Problems displaying a PDF from stream

2010-10-28 Thread Alex Zeit
Now it works with IE and this is most important thing. Thank you very much!
However the problem with Firefox remains. After clearing chronik while Pdf
document is open if I click the link comes page expired, after refreshing
the main page with link if I click link again comes empty page.

2010/10/28 Alex Zeit zeita...@googlemail.com

 Thanks a lot Stefan I will try it right now


 2010/10/28 Stefan Lindner lind...@visionet.de

 Try this:



public class MyResourceStreamWriter extends
 AbstractResourceStreamWriter {
private static final long serialVersionUID = 1L;

public MyResourceStreamWriter() {
}

@Override
public void write(final OutputStream output) {
// ! prduce output here and stream it to output
try {
output.flush();
} catch (Exception e) {
e.printStackTrace();
}
}

@Override
 public String getContentType() {
return application/pdf;
}
}





 LinkT pdfLink = new LinkT(pdf) {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
ResourceStreamRequestTarget rsrt = new
 ResourceStreamRequestTarget(new MyResourceStreamWriter());
//rsrt.setFileName(file.pdf); // use this if yout
 want your browser to ask you wheter you want to save the cownloaded PDF in
 fil efile.pdf
getRequestCycle().setRequestTarget(rsrt);
}
};


pdfLink.setPopupSettings(new PopupSettings(PopupSettings.RESIZABLE
 | PopupSettings.SCROLLBARS));
add(pdfLink);


 Stefan


 -Ursprüngliche Nachricht-
 Von: Alex Zeit [mailto:zeita...@googlemail.com]
 Gesendet: Donnerstag, 28. Oktober 2010 15:21
 An: users@wicket.apache.org
 Betreff: Re: Problems displaying a PDF from stream

 Yes

 2010/10/28 Stefan Lindner lind...@visionet.de

  Do you want to open the PDF in a separate window? Klick on some button
  and open a new browser window with pdf?
 
  Stefan
 
  -Ursprüngliche Nachricht-
  Von: Alex Zeit [mailto:zeita...@googlemail.com]
  Gesendet: Donnerstag, 28. Oktober 2010 15:14
  An: users@wicket.apache.org
  Betreff: Problems displaying a PDF from stream
 
  While trying to display a PDF document from stream following problems
  arrise:
  IE7:
  Resource can not be displaied at all.
 
  Firefox 3.6.12:
  PDF is displaied but if Chronk is cleared in Firefox while document is
  open then it cannot be displaied again. It is possible only after
  restarting Firefox.
 
  No errors in log.
 
  The code:
  public class PdfGen extends WebResource {
 
 public PdfGen() {
 setCacheable(false);
 }
 
 @Override
 public IResourceStream getResourceStream() {
 IResourceStream resourceStream = new
  AbstractResourceStreamWriter() {
 private static final long serialVersionUID =
  1934248394380163944L;
 public void write(OutputStream output) {
 testItextDirect(output);
 }
 public String getContentType() {
 return application/pdf;
 }
 };
 return resourceStream;
 }
 
 private void testItextDirect(OutputStream output){
 try {
 Document document = new Document();
 PdfWriter.getInstance(document, output);
 document.open();
 document.add(new Paragraph(Hello World));
 document.add(new Paragraph(new Date().toString()));
 document.close();
 } catch (DocumentException de) {
 try {
 throw new IOException(de.getMessage());
 } catch (IOException e) {
 e.printStackTrace();
 }
 }
 }
  }
 
 
  in the init() of AuthenticatedWebApplication SharedResource added like
  this:
  getSharedResources().add(pdfGen, new PdfGen());
 
  Any help would be highly appreciated
  Alex
 
  -
  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





AW: Problems displaying a PDF from stream

2010-10-28 Thread Stefan Lindner
What do you mean with After clearing chronik? Does this mean that the session 
cookie is lost after After clearing chronik?
You may take a look at the generated HTML:


Onclick=.?wicket:interface=:5:.:pdfIcon:pdf::ILinkListener::

This refers to a version oft he page that is no longer valid after the session 
is lost. Refreshing the page starts a new session and it works again.
You must (I don't know how at the moment) produce a sort of bookemarkable url 
for this case I think. My guess would be to use a separate servlet for this.

Stefan

-Ursprüngliche Nachricht-
Von: Alex Zeit [mailto:zeita...@googlemail.com] 
Gesendet: Donnerstag, 28. Oktober 2010 18:21
An: users@wicket.apache.org
Betreff: Re: Problems displaying a PDF from stream

Now it works with IE and this is most important thing. Thank you very much!
However the problem with Firefox remains. After clearing chronik while Pdf 
document is open if I click the link comes page expired, after refreshing the 
main page with link if I click link again comes empty page.

2010/10/28 Alex Zeit zeita...@googlemail.com

 Thanks a lot Stefan I will try it right now


 2010/10/28 Stefan Lindner lind...@visionet.de

 Try this:



public class MyResourceStreamWriter extends 
 AbstractResourceStreamWriter {
private static final long serialVersionUID = 1L;

public MyResourceStreamWriter() {
}

@Override
public void write(final OutputStream output) {
// ! prduce output here and stream it to output
try {
output.flush();
} catch (Exception e) {
e.printStackTrace();
}
}

@Override
 public String getContentType() {
return application/pdf;
}
}





 LinkT pdfLink = new LinkT(pdf) {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
ResourceStreamRequestTarget rsrt = new 
 ResourceStreamRequestTarget(new MyResourceStreamWriter());
//rsrt.setFileName(file.pdf); // use this if 
 yout want your browser to ask you wheter you want to save the 
 cownloaded PDF in fil efile.pdf
getRequestCycle().setRequestTarget(rsrt);
}
};


pdfLink.setPopupSettings(new 
 PopupSettings(PopupSettings.RESIZABLE
 | PopupSettings.SCROLLBARS));
add(pdfLink);


 Stefan


 -Ursprüngliche Nachricht-
 Von: Alex Zeit [mailto:zeita...@googlemail.com]
 Gesendet: Donnerstag, 28. Oktober 2010 15:21
 An: users@wicket.apache.org
 Betreff: Re: Problems displaying a PDF from stream

 Yes

 2010/10/28 Stefan Lindner lind...@visionet.de

  Do you want to open the PDF in a separate window? Klick on some 
  button and open a new browser window with pdf?
 
  Stefan
 
  -Ursprüngliche Nachricht-
  Von: Alex Zeit [mailto:zeita...@googlemail.com]
  Gesendet: Donnerstag, 28. Oktober 2010 15:14
  An: users@wicket.apache.org
  Betreff: Problems displaying a PDF from stream
 
  While trying to display a PDF document from stream following 
  problems
  arrise:
  IE7:
  Resource can not be displaied at all.
 
  Firefox 3.6.12:
  PDF is displaied but if Chronk is cleared in Firefox while document 
  is open then it cannot be displaied again. It is possible only 
  after restarting Firefox.
 
  No errors in log.
 
  The code:
  public class PdfGen extends WebResource {
 
 public PdfGen() {
 setCacheable(false);
 }
 
 @Override
 public IResourceStream getResourceStream() {
 IResourceStream resourceStream = new
  AbstractResourceStreamWriter() {
 private static final long serialVersionUID = 
  1934248394380163944L;
 public void write(OutputStream output) {
 testItextDirect(output);
 }
 public String getContentType() {
 return application/pdf;
 }
 };
 return resourceStream;
 }
 
 private void testItextDirect(OutputStream output){
 try {
 Document document = new Document();
 PdfWriter.getInstance(document, output);
 document.open();
 document.add(new Paragraph(Hello World));
 document.add(new Paragraph(new Date().toString()));
 document.close();
 } catch (DocumentException de) {
 try {
 throw new IOException(de.getMessage());
 } catch (IOException e) {
 e.printStackTrace();
 }
 }
 }
  }
 
 
  in the init() of AuthenticatedWebApplication SharedResource added 
  like
  this:
  getSharedResources().add(pdfGen, new PdfGen());
 
  Any help 

Wicket product on set-top boxes

2010-10-28 Thread nino martinez wael
Hi

Im working on a product where we are pushing a wicket site/product to some
set-top boxes. And I want to make the displayed page more resilient, so if
the server for some reason are down or the box are unable to connect it will
keep trying to connect until successful. Also if I hit the exception page
for some reason I want to go back to the originating page after a while to
try again.

So any suggestions?

I have a couple of ideas, but wanted to hear other angels on it..

regards Nino


Re: Wicket product on set-top boxes

2010-10-28 Thread Jeremy Thomerson
On Thu, Oct 28, 2010 at 12:40 PM, nino martinez wael 
nino.martinez.w...@gmail.com wrote:

 Hi

 Im working on a product where we are pushing a wicket site/product to
 some
 set-top boxes. And I want to make the displayed page more resilient, so if
 the server for some reason are down or the box are unable to connect it
 will
 keep trying to connect until successful.


I would think that this would be more a function of the network layer on the
settop box.  Unless you are using all AJAX (after the initial page load), in
which case you could add some JS that adds redundancy.


 Also if I hit the exception page
 for some reason I want to go back to the originating page after a while to
 try again.


Create custom error page(s), add JS to this page to history.go(-1) after a
settimeout.


 So any suggestions?

 I have a couple of ideas, but wanted to hear other angels on it..


No angels on this list.  Although, occasionally we have obtuse angles.

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Re: Wicket product on set-top boxes

2010-10-28 Thread Martin Makundi
Hi!

Yes, we did this kind of settop with wicket. We use ajax timer to
update page and keep session alive. The originating page problem we
had to resolve using a cookie because wicket does not support multi
homing.

**
Martin

2010/10/28 nino martinez wael nino.martinez.w...@gmail.com:
 Hi

 Im working on a product where we are pushing a wicket site/product to some
 set-top boxes. And I want to make the displayed page more resilient, so if
 the server for some reason are down or the box are unable to connect it will
 keep trying to connect until successful. Also if I hit the exception page
 for some reason I want to go back to the originating page after a while to
 try again.

 So any suggestions?

 I have a couple of ideas, but wanted to hear other angels on it..

 regards Nino


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



Re: Wicket product on set-top boxes

2010-10-28 Thread nino martinez wael
hehe.. Sometimes I do spell wrong usually when tired, angels are nice but
was thinking of angle or perspective :)

We are actually using ajax after the initial page so i'll go for some ajax
intelligence, which was my initial idea.

2010/10/28 Jeremy Thomerson jer...@wickettraining.com

 On Thu, Oct 28, 2010 at 12:40 PM, nino martinez wael 
 nino.martinez.w...@gmail.com wrote:

  Hi
 
  Im working on a product where we are pushing a wicket site/product to
  some
  set-top boxes. And I want to make the displayed page more resilient, so
 if
  the server for some reason are down or the box are unable to connect it
  will
  keep trying to connect until successful.


 I would think that this would be more a function of the network layer on
 the
 settop box.  Unless you are using all AJAX (after the initial page load),
 in
 which case you could add some JS that adds redundancy.


  Also if I hit the exception page
  for some reason I want to go back to the originating page after a while
 to
  try again.
 

 Create custom error page(s), add JS to this page to history.go(-1) after a
 settimeout.


  So any suggestions?
 
  I have a couple of ideas, but wanted to hear other angels on it..
 

 No angels on this list.  Although, occasionally we have obtuse angles.

 --
 Jeremy Thomerson
 http://wickettraining.com
 *Need a CMS for Wicket?  Use Brix! http://brixcms.org*



Re: JFreeChart with clickable imagemap

2010-10-28 Thread jwray


Hi,

A little late maybe but since I wrote that wiki page I've improved the code
to use models and so be responsive to data changes. 

Here's a link to a gist providing a wicket component that allows a
JFreeChart to be displayed with both tooltips and clickable entities. 

http://gist.github.com/647285

Jonny
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JFreeChart-with-clickable-imagemap-tp2720220p3017976.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 scalability

2010-10-28 Thread Jan Luehr
Hello,

I'm still trying to get into wicket - this time, I stumbled up on:
http://javathoughts.capesugarbird.com/2008/01/year-of-wicket.html

It says:
The application was a management console for an enterprise application. It did 
not require high user traffic, so were weren't concerned about what people talk 
about as the biggest issue with Wicket, namely scalability. We certainly have 
had no performance problems ourselves.

Although this article was written some months ago, I didn't notice any concerns 
refering to scalability.
Do you know, what the author is referring to? 

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



Re: Wicket scalability

2010-10-28 Thread Jeremy Thomerson
On Thu, Oct 28, 2010 at 3:54 PM, Jan Luehr mailinglists_in...@arcor.dewrote:

 Hello,

 I'm still trying to get into wicket - this time, I stumbled up on:
 http://javathoughts.capesugarbird.com/2008/01/year-of-wicket.html

 It says:
 The application was a management console for an enterprise application. It
 did not require high user traffic, so were weren't concerned about what
 people talk about as the biggest issue with Wicket, namely scalability. We
 certainly have had no performance problems ourselves.

 Although this article was written some months ago, I didn't notice any
 concerns refering to scalability.
 Do you know, what the author is referring to?


That should be worded as expected, we did not encounter what people often
cite as a common misconception about Wicket, namely, that it does not scale
well.

People commonly spread FUD about whatever framework doesn't seem to fit
their needs.  The common thing to say about Wicket is that it doesn't scale
well.  They say that holding state in the session kills scalability.
 However, to clarify the simplest: that's wrong, and has been disproven by
numerous examples and benchmarks.  Can you write a Wicket application that
won't scale?  Certainly!  But give me any framework and I'll write you an
application that will crash.  The real question is: can you write a Wicket
application that scales well?  The answer is: ABSOLUTELY!

Here are some really great benchmarks that you may find useful:
http://ptrthomas.wordpress.com/2009/01/14/seam-jsf-vs-wicket-performance-comparison/
http://ptrthomas.wordpress.com/2009/09/14/perfbench-update-tapestry-5-and-grails/

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Disable button double-click without breaking Form.setDefaultButton

2010-10-28 Thread Alex Grant
Hello,

I have had problems with users double-clicking the Finish button in one of our 
wizards, which caused duplicate objects to be created.

So I want to prevent the (non-ajax) buttons from being clicked more than once. 
I found what I thought was a good solution, using a SimpleAttributeModifier to 
add this to all the regular buttons
input ... onclick=this.onclick=function(){return false;};/

This worked fine, until someone discovered pressing Enter in a textfield in a 
wizard stopped working, not only did it not submit the form, but it prevented 
clicking the button manually. Wizard makes uses of Form.setDefaultButton, which 
adds a hidden button at the start of the form, with an onclick handler that 
looks like this:

input ... onclick=var b=document.getElementById('next2d'); if 
(b!=nullb.onclick!=nulltypeof(b.onclick) != 'undefined') {  var r = 
b.onclick.bind(b)(); if (r != false) b.click(); } else { b.click(); };  return 
false; /

This meant that the onclick() method of my button was invoked (disabling the 
button), and then the button was clicked (doing nothing).

Has anyone found a way of disabling double-click on regular buttons without 
tripping over this?

Thank you,
Alex


Re: Updating inmethod grid from the server

2010-10-28 Thread Adz

Ah yes, it occurred to me last night that my implementation of equals for my
object must be the problem, thanks for the help.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Updating-inmethod-grid-from-the-server-tp3015007p3018162.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



Replacing markup generated by a Behavior

2010-10-28 Thread Clint Checketts
I have a Visitor that iterates through my forms and adds a Behavior that
writes out to the Response a div and any feedback messages that belong to
that component. This is really great because it gives me inline feedback
panels. Here is the problem: if the component is ever updated via ajax, the
component the behavior is tied to get replaced in the DOM, but the feedback
messages get written out in another div again.

My core need is to create some sort of auto-adding inline feedbackpanel.

Any good recommendations on how to work around this? It's such a good design
pratice to have error messages next to the offending input fields, I'm sure
others have had to deal with this.


Re: Replacing markup generated by a Behavior

2010-10-28 Thread Jeremy Thomerson
On Thu, Oct 28, 2010 at 5:19 PM, Clint Checketts checke...@gmail.comwrote:

 I have a Visitor that iterates through my forms and adds a Behavior that
 writes out to the Response a div and any feedback messages that belong to
 that component. This is really great because it gives me inline feedback
 panels. Here is the problem: if the component is ever updated via ajax, the
 component the behavior is tied to get replaced in the DOM, but the feedback
 messages get written out in another div again.

 My core need is to create some sort of auto-adding inline feedbackpanel.

 Any good recommendations on how to work around this? It's such a good
 design
 pratice to have error messages next to the offending input fields, I'm sure
 others have had to deal with this.


A couple options:

   - Use a Border.  Of course, then it's harder to add this automatically
   because a border will look for the html in the parent container.
   - in your behavior, in the div you render, render the div with the markup
   ID of the component you are wrapping, and then call setOutputMarkupId(false)
   on the component you are wrapping.  thus, you are moving the markup id up to
   the wrapping div.
   - if you are using wicket 1.4.10 or greater,
   implement IAjaxRegionMarkupIdProvider, which allows you to override the id
   of the markup region that will updated via ajax

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Seeing sporadic ClassNotFoundExceptions after upgrading from 1.4.9 or 1.4.11

2010-10-28 Thread Anthony DePalma
I was wondering if this was a known issue, or if it is something
specific to my application. I have made minimal changes besides
upgrading to 1.4.12, and now I am seeing some of these logs appear
(although I havent been able to reproduce them myself)

2010-10-27 14:36:05,070 ERROR [TP-Processor11]
org.apache.wicket.request.target.resource.SharedResourceRequestTarget
- unable to lazily register shared resource
org.apache.wicket.ajax.wicketajaxreference/wicket-ajax.js
java.lang.ClassNotFoundException: org.apache.wicket.ajax.wicketajaxreference
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484)
~[catalina.jar:na]
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
~[catalina.jar:na]
at java.lang.Class.forName0(Native Method) ~[na:1.6.0_21]
at java.lang.Class.forName(Class.java:247) ~[na:1.6.0_21]
at 
org.apache.wicket.application.DefaultClassResolver.resolveClass(DefaultClassResolver.java:114)
~[wicket-1.4.12.jar:1.4.12]

I also see some similar exception traces, but with different class names:

java.lang.ClassNotFoundException:
org.apache.wicket.extensions.ajax.markup.html.modal.modalwindow
java.lang.ClassNotFoundException:
org.apache.wicket.markup.html.wicketeventreference

These classes are on the classpath of course, but the odd thing is the
class names seem to be converted to lowercase somewhere in the app
which I am guessing why the classNotFound exceptions are being thrown.
Has anyone seen this before?

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



Re: Disable button double-click without breaking Form.setDefaultButton

2010-10-28 Thread Alexander Morozov

Check this thread
http://apache-wicket.1842946.n4.nabble.com/Preventing-double-click-of-AjaxButtons-in-ModalWindow-td2289480.html
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-click-without-breaking-Form-setDefaultButton-tp3018140p3018370.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: Disable button double-click without breaking Form.setDefaultButton

2010-10-28 Thread Alex Grant
Thanks,

That was actually me asking that question. :)
That worked perfectly for AjaxButtons, but what I'm trying to do now is disable 
double-click for non-ajax buttons.

Alex

-Original Message-
From: Alexander Morozov [mailto:alexander.v.moro...@gmail.com] 
Sent: Friday, 29 October 2010 3:31 p.m.
To: users@wicket.apache.org
Subject: Re: Disable button double-click without breaking Form.setDefaultButton


Check this thread
http://apache-wicket.1842946.n4.nabble.com/Preventing-double-click-of-AjaxButtons-in-ModalWindow-td2289480.html
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-click-without-breaking-Form-setDefaultButton-tp3018140p3018370.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: Disable button double-click without breaking Form.setDefaultButton

2010-10-28 Thread Jeremy Thomerson
Do it in your form itself.  For instance, you can save a boolean flag that
tells you that the form has already been submitted and not accept a second
submit, or whatever.

On Thu, Oct 28, 2010 at 9:58 PM, Alex Grant alex.gr...@unimarket.comwrote:

 Thanks,

 That was actually me asking that question. :)
 That worked perfectly for AjaxButtons, but what I'm trying to do now is
 disable double-click for non-ajax buttons.

 Alex

 -Original Message-
 From: Alexander Morozov [mailto:alexander.v.moro...@gmail.com]
 Sent: Friday, 29 October 2010 3:31 p.m.
 To: users@wicket.apache.org
 Subject: Re: Disable button double-click without breaking
 Form.setDefaultButton


 Check this thread

 http://apache-wicket.1842946.n4.nabble.com/Preventing-double-click-of-AjaxButtons-in-ModalWindow-td2289480.html
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-click-without-breaking-Form-setDefaultButton-tp3018140p3018370.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




-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Re: Replacing markup generated by a Behavior

2010-10-28 Thread Clint Checketts
Elegant! I'd been trying to think of ways to add my own markup ID and
piggyback off any render requests that redraw the component to trigger and
render the feedback, just using the component markupId will work great!

Instead of setOutputMarkupId(false), I'll detect that to decide to add the
ID or not and just remove the ID attribute in the onComponentTag() method.
I'll code it up tomorrow. I've got a good feeling about this.

Thanks for the help. Also I'll check out the IAjaxRegionMarkupIdProvider.
Always good to check out the new interfaces.

-Clint


On Thu, Oct 28, 2010 at 5:28 PM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 On Thu, Oct 28, 2010 at 5:19 PM, Clint Checketts checke...@gmail.com
 wrote:

  I have a Visitor that iterates through my forms and adds a Behavior that
  writes out to the Response a div and any feedback messages that belong
 to
  that component. This is really great because it gives me inline feedback
  panels. Here is the problem: if the component is ever updated via ajax,
 the
  component the behavior is tied to get replaced in the DOM, but the
 feedback
  messages get written out in another div again.
 
  My core need is to create some sort of auto-adding inline feedbackpanel.
 
  Any good recommendations on how to work around this? It's such a good
  design
  pratice to have error messages next to the offending input fields, I'm
 sure
  others have had to deal with this.
 

 A couple options:

   - Use a Border.  Of course, then it's harder to add this automatically
   because a border will look for the html in the parent container.
   - in your behavior, in the div you render, render the div with the markup
   ID of the component you are wrapping, and then call
 setOutputMarkupId(false)
   on the component you are wrapping.  thus, you are moving the markup id up
 to
   the wrapping div.
   - if you are using wicket 1.4.10 or greater,
   implement IAjaxRegionMarkupIdProvider, which allows you to override the
 id
   of the markup region that will updated via ajax

 --
 Jeremy Thomerson
 http://wickettraining.com
 *Need a CMS for Wicket?  Use Brix! http://brixcms.org*