[Wicket-user] Models and Pages

2007-02-07 Thread Levy, Jeremy
I have a bunch of labels on a page and I have associated the page with a
CompoundPropertyModel, however when I update the values in the model the
page doesn't reflect the change.. See the following code for an example:


 public View() {
super(new CompoundPropertyModel(new WorkRequestModel()));

WorkRequestModel theModel = (WorkRequestModel)getModelObject();
  
theModel.setProject_name(Project Name);

setModelObject(theModel);

Label project_name = new Label(project_name);

project_name.setOutputMarkupId(true);
add(project_name);

}
---

This works with forms usually, can this not be done with a regular page?

Jeremy
 
 
 


Important Notice to Recipients:
It is important that you do not use e-mail to request, authorize or effect the 
purchase or sale of any security or commodity, to send fund transfer 
instructions, or to effect any other transactions. Any such request, orders, or 
instructions that you send will not be accepted and will not be processed by 
Morgan Stanley.
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Models and Pages

2007-02-07 Thread Levy, Jeremy
Uhh, forget it ;)



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Levy,
Jeremy
Sent: Wednesday, February 07, 2007 11:16 AM
To: wicket-user@lists.sourceforge.net
Subject: [Wicket-user] Models and Pages



I have a bunch of labels on a page and I have associated the page with a
CompoundPropertyModel, however when I update the values in the model the
page doesn't reflect the change.. See the following code for an example:

 
 public View() { 
super(new CompoundPropertyModel(new WorkRequestModel())); 

WorkRequestModel theModel = (WorkRequestModel)getModelObject(); 
  
theModel.setProject_name(Project Name); 

setModelObject(theModel); 

Label project_name = new Label(project_name); 

project_name.setOutputMarkupId(true); 
add(project_name); 

} 
--- 

This works with forms usually, can this not be done with a regular page?


Jeremy
 
 
 


Important Notice to Recipients:
It is important that you do not use e-mail to request, authorize or effect the 
purchase or sale of any security or commodity, to send fund transfer 
instructions, or to effect any other transactions. Any such request, orders, or 
instructions that you send will not be accepted and will not be processed by 
Morgan Stanley.
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Modifying form feedback behavior

2006-12-04 Thread Levy, Jeremy
Igor,
 
Thanks, that gets me almost there, in onError() how do I get the
component that the error is being thrown against?
 
form.add(new AjaxSubmitButton(ajax-submit-button, form) {
   ...
protected void onError(AjaxRequestTarget target, Form form)
{
// repaint the feedback panel so errors are shown
   target.addComponent(feedback);
}
});
 
 
Jeremy
 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Igor
Vaynberg
Sent: Monday, December 04, 2006 12:22 PM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] Modifying form feedback behavior


if you want to validate the form via ajax you have to submit the form
via ajax. see AjaxSubmitButton, then in onsubmit(AjaxRequestTarget
target) you can start adding all kinds of javascript - like
scriptaculous effects targetted at the proper form components 

-igor



On 12/4/06, Levy, Jeremy [EMAIL PROTECTED] wrote: 

I would like to change the default behavior for the way form
validation feedback is reported to the end user.  

At the moment this form does two types of validation, one using
the default validatators and the other in the onSubmit method of the
form.  (I can move the later into custom validation, this form was built
while I was first getting started w/ Wicket).  Feedback is reported
using the default FeedBackPanel.  I would like to change the behavior so
that if there is an error, when the page reloads I can modify it's
class/style, specifically the input's border color and size. 

Best case I would like to do it like the Ajax Effect example and
use some script.aculo.us effects without having to reload the page.  I
have trouble figuring out where to get started.  Should I implement
IFeedBack and add that to the components?  Can someone point me in the
right direction?

Jeremy 

 
 
 



Important Notice to Recipients: 
It is important that you do not use e-mail to request, authorize
or effect the purchase or sale of any security or commodity, to send
fund transfer instructions, or to effect any other transactions. Any
such request, orders, or instructions that you send will not be accepted
and will not be processed by Morgan Stanley. 



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance
to share your
opinions on IT  business topics through brief surveys - and
earn cash 

http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE
V 

___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 


Important Notice to Recipients:
It is important that you do not use e-mail to request, authorize or effect the 
purchase or sale of any security or commodity, to send fund transfer 
instructions, or to effect any other transactions. Any such request, orders, or 
instructions that you send will not be accepted and will not be processed by 
Morgan Stanley.
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Modifying form feedback behavior

2006-12-04 Thread Levy, Jeremy
Igor,
 
Thanks again actually ;),  you already answered my question here:
 
http://www.nabble.com/FeedbackPanel%2C-Form%2C-which-component-is-caousi
ng-feedback--tf2427268.html#a6767963
 
I added this in my onError 
 
form.visitFormComponents(new FormComponent.IVisitor() {
 
public void formComponent(FormComponent
formComponent) {
 log.debug(Doh!   + formComponent.getMarkupId() +
  + formComponent.isValid());  
  }
});
 
I think I got it.. 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Levy,
Jeremy
Sent: Monday, December 04, 2006 2:17 PM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] Modifying form feedback behavior


Igor,
 
Thanks, that gets me almost there, in onError() how do I get the
component that the error is being thrown against?
 
form.add(new AjaxSubmitButton(ajax-submit-button, form) {
   ...
protected void onError(AjaxRequestTarget target, Form form)
{
// repaint the feedback panel so errors are shown
   target.addComponent(feedback);
}
});
 
 
Jeremy
 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Igor
Vaynberg
Sent: Monday, December 04, 2006 12:22 PM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] Modifying form feedback behavior


if you want to validate the form via ajax you have to submit the form
via ajax. see AjaxSubmitButton, then in onsubmit(AjaxRequestTarget
target) you can start adding all kinds of javascript - like
scriptaculous effects targetted at the proper form components 

-igor



On 12/4/06, Levy, Jeremy [EMAIL PROTECTED] wrote: 

I would like to change the default behavior for the way form
validation feedback is reported to the end user.  

At the moment this form does two types of validation, one using
the default validatators and the other in the onSubmit method of the
form.  (I can move the later into custom validation, this form was built
while I was first getting started w/ Wicket).  Feedback is reported
using the default FeedBackPanel.  I would like to change the behavior so
that if there is an error, when the page reloads I can modify it's
class/style, specifically the input's border color and size. 

Best case I would like to do it like the Ajax Effect example and
use some script.aculo.us effects without having to reload the page.  I
have trouble figuring out where to get started.  Should I implement
IFeedBack and add that to the components?  Can someone point me in the
right direction?

Jeremy 

 
 
 



Important Notice to Recipients: 
It is important that you do not use e-mail to request, authorize
or effect the purchase or sale of any security or commodity, to send
fund transfer instructions, or to effect any other transactions. Any
such request, orders, or instructions that you send will not be accepted
and will not be processed by Morgan Stanley. 



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance
to share your
opinions on IT  business topics through brief surveys - and
earn cash 

http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE
V 

___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user





 
 
 


Important Notice to Recipients: 
It is important that you do not use e-mail to request, authorize or
effect the purchase or sale of any security or commodity, to send fund
transfer instructions, or to effect any other transactions. Any such
request, orders, or instructions that you send will not be accepted and
will not be processed by Morgan Stanley.
 
 
 


Important Notice to Recipients:
It is important that you do not use e-mail to request, authorize or effect the 
purchase or sale of any security or commodity, to send fund transfer 
instructions, or to effect any other transactions. Any such request, orders, or 
instructions that you send will not be accepted and will not be processed by 
Morgan Stanley.
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list

Re: [Wicket-user] Unknown Exception -- Wicket 1.2.1

2006-08-09 Thread Levy, Jeremy
I don't think it was someone playing with the URL, I had a user write in
a say that they got the error during registration.

Jeremy

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Eelco
Hillenius
Sent: Wednesday, August 09, 2006 12:22 PM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] Unknown Exception -- Wicket 1.2.1

Yep. I think someone was just playing around a bit. Maybe we shouldn't
log big fat stacktraces for that unless in debug and/ or development
mode?

Eelco

On 8/9/06, Johan Compagner [EMAIL PROTECTED] wrote:
 that shouldn't matter
 What eelco says is that somebody is messing with the urls and tries to

 alter them and then sends them to the browser.

 johan


-
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 


Important Notice to Recipients:
It is important that you do not use e-mail to request, authorize or effect the 
purchase or sale of any security or commodity, to send fund transfer 
instructions, or to effect any other transactions. Any such request, orders, or 
instructions that you send will not be accepted and will not be processed by 
Morgan Stanley.

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Issue with reusing a form/page

2006-08-01 Thread Levy, Jeremy
Title: Issue with reusing a form/page






The following code is used to display the results using a table/repeating view.


The last column is used to add a link to do another lookup. I am having two problems.


1. When the link getTasks is called regardless of which iteratation user[0] always returns the last value in the users arraylist.

2. On the subsequent page that it gets passed off to, GetTasksPanel runs another query and if the resultset of that is empty I call error(Not results found) which throws the following exception:

java.lang.IllegalStateException: No Page found for component [MarkupContainer [Component id = getTasksForm, page = No Page, path = getTasksForm.GetTasksPanelForm]]

The call to error works fine if you go directly to that page and use the input field there


Any suggestions?



 public LookUpUserResults(String id, ArrayList users) {

 super(id);

 if (users != null){

 RepeatingView repeating = new RepeatingView(repeating);

 add(repeating);

 

 for (int x = 0; x  users.size(); x++){

 

 WebMarkupContainer item = new WebMarkupContainer(repeating.newChildId());

 repeating.add(item);

 

 user = (String[] )users.get(x);

 

 item.add(new Label(username,user[0] ));

 item.add(new Label(osname,user[2] ));

 item.add(new Label(email, user[1]));

 

 item.add(new Link(getTasks) {

 public void onClick() {

 log.debug(Setting up link for  + user[0]);

 MarkupContainer p = this.getParent();

 

 for (int x=0; x  10; x++){

 

 if (p instanceof UtilitiesPanel){

 String username = user[0] ;

 log.debug(Setting up button for  + user[0]);

 p.replace(new GetTasksPanel(mainContent,username));

 

 break;

 }else{

 p = p.getParent();

 }

 }

 

 }

 });

 }

 

 

 

 }

 }


Jeremy Levy

Morgan Stanley

75 Varick Street - 7th Floor

New York, NY 10013

212-219-4737

[EMAIL PROTECTED]










Important Notice to Recipients:


It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley.

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Downloading a file generated on the fly

2006-07-11 Thread Levy, Jeremy




I 
would like to create a text file on the fly and then create a link which will 
initiate a download of this file.

I 
checked out the exampleat http://www.wicket-wiki.org.uk/wiki/index.php/UploadDownload#Downloading_Images. 
I am thinking that I can do something similar but extend 
DynamicWebResource. Then use ResourceLink to link to it... Would this 
work? Is there a better way to do it? 

J







Important Notice to Recipients:


It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley.


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Downloading a file generated on the fly

2006-07-11 Thread Levy, Jeremy




Thanks Sean and Igor, based on both your responses I've 
come up with roughly the following which is working:

 final 
String filename = 
"thefile.csv"; 
final String contentType = 
"text/csv"; 
final String content = "the,content,is,this";
 
add(new 
Link("link"){ 
public void 
onClick(){ 
 
 
RequestCycle.get().setRequestTarget(EmptyRequestTarget.getInstance()); 
WebResponse response = (WebResponse) 
getResponse(); 
response.setContentType(contentType); 
response.setAttachmentHeader(filename); 
response.setHeader("Cache-Control", 
"max-age=0"); 
OutputStream out = 
response.getOutputStream(); 
 
try 
{ 
out.write(content.getBytes()); 
out.flush(); 
} catch (IOException ex) 
{ 
// 
ignore 
} 


 
} 
});


From: Sean Sullivan 
[mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 11:16 
AMTo: Levy, JeremySubject: Re: [Wicket-user] Downloading a 
file generated on the fly
Here's an application that I wrote.The application 
retrieves data from a database and converts it to an Excel XLS file.I am 
sending the XLS file to the web browser via the 
ServletOutputStream.Note: DatabaseQueryForm extends 
BaseFormhttp://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/DatabaseQueryForm.java?view=markuprev=91http://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/BaseForm.java?view=markuprev=60Levy, 
Jeremy wrote: 

  
  
  I 
  would like to create a text file on the fly and then create a link which will 
  initiate a download of this file.
  
  I 
  checked out the exampleat http://www.wicket-wiki.org.uk/wiki/index.php/UploadDownload#Downloading_Images. 
  I am thinking that I can do something similar but extend 
  DynamicWebResource. Then use ResourceLink to link to it... Would this 
  work? Is there a better way to do it? 
  
  J
  
  
  
  
  
  
  Important Notice to Recipients: 
  It is important that you do not use e-mail to request, 
  authorize or effect the purchase or sale of any security or commodity, to send 
  fund transfer instructions, or to effect any other transactions. Any such 
  request, orders, or instructions that you send will not be accepted and will 
  not be processed by Morgan Stanley. 

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
  
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
  







Important Notice to Recipients:


It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley.


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Downloading a file generated on the fly

2006-07-11 Thread Levy, Jeremy




I'd like to do it the clean way... When I do 
this:

 
RequestCycle.get().setRequestTarget(new 
StringRequestTarget("hello"){ 
public void 
respond(){ 
String txt = 
"content"; 
WebResponse r=(WebResponse) 
WebRequestCycle.get().getResponse(); 
r.setAttachmentHeader(filename); 
r.setContentType(contentType); 
 
try 
{ 
Streams.copy(new StringInputStream(txt), r.getOutputStream() 
); 
} catch (IOException ex) 
{ 
ex.printStackTrace(); 
} 
 
 
} 
 
});

The content shows up as "hello" and opens in the browser 
not as the correct content type, I'm sure I'm using the wrong kind of IRequestTarget, which one should I use? 
I can't figure out the syntax for EmptyRequestTarget and still override 
respond().

J


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Igor 
VaynbergSent: Tuesday, July 11, 2006 12:21 PMTo: 
wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] 
Downloading a file generated on the fly
while this works it is a bit hacky. it would be better to let the 
requesttarget's response method produce the output.-Igor
On 7/11/06, Levy, Jeremy 
[EMAIL PROTECTED] 
wrote:

  
  
  
  Thanks 
  Sean and Igor, based on both your responses I've come up with roughly the 
  following which is working:
  
   
  final String filename = 
  "thefile.csv"; 
  final String contentType = 
  "text/csv"; 
  final String content = "the,content,is,this";
   
  add(new 
  Link("link"){ 
  public void 
  onClick(){ 
   
   
  RequestCycle.get().setRequestTarget(EmptyRequestTarget.getInstance()); 
  WebResponse response = (WebResponse) 
  getResponse(); 
  response.setContentType(contentType); 
  response.setAttachmentHeader(filename); 
  response.setHeader("Cache-Control", 
  "max-age=0"); 
  OutputStream out = 
  response.getOutputStream(); 
   
  try 
  { 
  out.write(content.getBytes()); 
  out.flush(); 
  } catch (IOException ex) 
  { 
  // 
  ignore 
  } 
  
  
   
  } 
  });
  
  
  From: Sean Sullivan [mailto:[EMAIL PROTECTED]] 
  Sent: Tuesday, July 11, 2006 11:16 AMTo: Levy, 
  JeremySubject: Re: [Wicket-user] Downloading a file generated on 
  the fly
  Here's an application that I wrote.The 
  application retrieves data from a database and converts it to an Excel XLS 
  file.I am sending the XLS file to the web browser via the 
  ServletOutputStream.Note: DatabaseQueryForm extends 
  BaseFormhttp://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/DatabaseQueryForm.java?view=markuprev=91http://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/BaseForm.java?view=markuprev=60
  Levy, Jeremy wrote: 
  

I would like to create a 
text file on the fly and then create a link which will initiate a download 
of this file.

I checked out the 
exampleat http://www.wicket-wiki.org.uk/wiki/index.php/UploadDownload#Downloading_Images 
. I am thinking that I can do something similar but extend 
DynamicWebResource. Then use ResourceLink to link to it... Would this 
work? Is there a better way to do it? 

J






Important Notice to Recipients: 
It is important that you do not use e-mail to request, 
authorize or effect the purchase or sale of any security or commodity, to 
send fund transfer instructions, or to effect any other transactions. Any 
such request, orders, or instructions that you send will not be accepted and 
will not be processed by Morgan Stanley. 

-Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
  
___Wicket-user mailing listWicket-user@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
  
  
  
  
  
  
  
  Important Notice to Recipients: 
  It is important that you do not use e-mail to request, 
  authorize or effect the purchase or sale of any security or commodity, to send 
  fund transfer instructions, or to effect any other transactions. Any such 
  request, orders, or instructions that you send will not be accepted and will 
  not be processed by Morgan Stanley. 
  -Using 
  Tomcat but need to do more? Need to support web services, security?Get 
  stuff done quickly with pre-integrated technology to make your job easier 
  Download IBM WebSphere Application Server v.1.0.1 based on Apache 
  Geronimohttp://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user 
  mailing listWicket-user@lists.sourceforge.nethttps://

Re: [Wicket-user] Downloading a file generated on the fly

2006-07-11 Thread Levy, Jeremy




Cool thanks, I used the anonymous IRequestTarget 
strategy...


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Igor 
VaynbergSent: Tuesday, July 11, 2006 1:11 PMTo: 
wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] 
Downloading a file generated on the fly
string target already does the streams.copy thing in its respond so 
you can just dorespond() { ... r.setattachmentheader(..); 
r.setContentType(..) super.respond(); }or do how i showed you in the 
first place using an anonymous imple of IRequestTarget directly. 
IRequestTarget.detach() { } IRequestTarget.getLock() { return null; 
}-Igor
On 7/11/06, Levy, 
Jeremy  
[EMAIL PROTECTED] wrote:

  
  
  
  I'd like 
  to do it the clean way... When I do this:
  
   
  RequestCycle.get().setRequestTarget(new 
  StringRequestTarget("hello"){ 
  public void 
  respond(){ 
  String txt = 
  "content"; 
  WebResponse r=(WebResponse) 
  WebRequestCycle.get().getResponse(); 
  r.setAttachmentHeader(filename); 
  r.setContentType(contentType); 
   
  try 
  { 
  Streams.copy(new StringInputStream(txt), r.getOutputStream() 
  ); 
  } catch (IOException ex) 
  { 
  ex.printStackTrace(); 
  } 
   
   
  } 
   
  });
  
  The 
  content shows up as "hello" and opens in the browser not as the correct 
  content type, I'm sure I'm using the wrong kind of IRequestTarget, 
  which one should I use? I can't figure out the syntax for EmptyRequestTarget 
  and still override respond().
  
  J
  
  
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of 
  Igor VaynbergSent: Tuesday, July 11, 2006 12:21 
  PMTo: wicket-user@lists.sourceforge.net
  Subject: Re: [Wicket-user] Downloading a file generated on 
  the fly
  
  
  while this works it is a bit hacky. it would be better to let the 
  requesttarget's response method produce the output.-Igor
  On 7/11/06, Levy, 
  Jeremy [EMAIL PROTECTED] wrote: 
  



Thanks 
Sean and Igor, based on both your responses I've come up with roughly the 
following which is working:

 
final String filename = 
"thefile.csv"; 
final String contentType = 
"text/csv"; 
final String content = "the,content,is,this";
 
add(new 
Link("link"){ 
public void 
onClick(){ 
 
 
RequestCycle.get().setRequestTarget(EmptyRequestTarget.getInstance()); 
WebResponse response = (WebResponse) 
getResponse(); 
response.setContentType(contentType); 
response.setAttachmentHeader(filename); 
response.setHeader("Cache-Control", 
"max-age=0"); 
OutputStream out = 
response.getOutputStream(); 
 
try 
{ 
out.write(content.getBytes()); 
out.flush(); 
} catch (IOException ex) 
{ 
// 
ignore 
} 


 
} 
});


From: Sean Sullivan [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 11, 2006 11:16 AMTo: Levy, 
JeremySubject: Re: [Wicket-user] Downloading a file generated on 
the fly
Here's an application that I wrote.The 
application retrieves data from a database and converts it to an Excel XLS 
file.I am sending the XLS file to the web browser via the 
ServletOutputStream.Note: DatabaseQueryForm extends 
BaseFormhttp://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/DatabaseQueryForm.java?view=markuprev=91http://svn.sourceforge.net/viewcvs.cgi/oscon2006/oscon2006/src/java/oscon2006/web/BaseForm.java?view=markuprev=60
Levy, Jeremy wrote: 

  
  I would like to create a 
  text file on the fly and then create a link which will initiate a download 
  of this file.
  
  I checked out the 
  exampleat http://www.wicket-wiki.org.uk/wiki/index.php/UploadDownload#Downloading_Images 
  . I am thinking that I can do something similar but extend 
  DynamicWebResource. Then use ResourceLink to link to it... Would 
  this work? Is there a better way to do it? 

  
  J
  
  
  
  
  
  
  Important Notice to Recipients: 
  It is important that you do not use e-mail to request, 
  authorize or effect the purchase or sale of any security or commodity, to 
  send fund transfer instructions, or to effect any other transactions. Any 
  such request, orders, or instructions that you send will not be accepted 
  and will not be processed by Morgan Stanley. 

-Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo

http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
  
___Wicket-user mailing listW

Re: [Wicket-user] RadioChoice, default selection

2006-07-05 Thread Levy, Jeremy
You could just set the option in your model.

Jeremy 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sean
Sullivan
Sent: Wednesday, July 05, 2006 2:31 PM
To: wicket-user@lists.sourceforge.net
Subject: [Wicket-user] RadioChoice, default selection


I am using the RadioChoice class in Wicket 1.2

import wicket.markup.html.form.*;

RadioChoice radio = new RadioChoice(choice);

ListString choices = new ArrayListString();
choices.add(a);
choices.add(b);
choices.add(c);

radio.setModel(new CompoundPropertyModel(this));
radio.setChoices(choices);


When the page is displayed to the user, I want the a option to be
selected by default.

How can I do this with RadioChoice?

I'm looking for a Java method like this:

radio.setSelection(0);

Cheers,

Sean




Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 


Important Notice to Recipients:
It is important that you do not use e-mail to request, authorize or effect the 
purchase or sale of any security or commodity, to send fund transfer 
instructions, or to effect any other transactions. Any such request, orders, or 
instructions that you send will not be accepted and will not be processed by 
Morgan Stanley.

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Wicket and Websphere

2006-06-23 Thread Levy, Jeremy




But Websphere 5.02 doesn't :)


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Paolo Di 
TommasoSent: Friday, June 23, 2006 4:19 PMTo: 
wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] Wicket 
and Websphere
So it is.
On 6/23/06, Ingo 
Adler [EMAIL PROTECTED] 
wrote:
I 
  think WebSphere 5.1 uses Java 
1.4.Ingo.







Important Notice to Recipients:


It is important that you do not use e-mail to request, authorize or effect the purchase or sale of any security or commodity, to send fund transfer instructions, or to effect any other transactions. Any such request, orders, or instructions that you send will not be accepted and will not be processed by Morgan Stanley.

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user