Re: Trying to create a calendar - need some guidance

2008-10-24 Thread V. Jenks

Igor, thanks again for the clue on using GridView, I got it figured out and
it works great!  I attached the code in case anyone's interested in drawing
a basic calendar.  It's lean and clean so it's easy to extend.
http://www.nabble.com/file/p20153494/Cal.java Cal.java 
http://www.nabble.com/file/p20153494/Cal.html Cal.html 
http://www.nabble.com/file/p20153494/DayProvider.java DayProvider.java 


V. Jenks wrote:
> 
> Hi all.
> 
> I'm trying to build a component-ized calendar that will be the centerpiece
> of a new application I'm working on.  I built one this morning in JSP and
> was able to do it with very little code.  I kept it simple and I'm hoping
> I can retro-fit the logic into a wicket page cleanly, without too much
> trouble.  I'm a little stuck because in my JSP, I simply loop through the
> days and print until Saturday is reached, then I break to a new table row
> and continue.  Doing this in Wicket seems tough because if I use a
> ListView, I can't be as flexible as far as throwing in a new row while
> looping and outputting table cells.
> 
> Here's the rough idea I came up with today in JSP, can someone give me
> some pointers?
> 
> <%@ page contentType="text/html" pageEncoding="UTF-8" %>
> <%@ page import="java.util.*" %>
>  "http://www.w3.org/TR/html4/loose.dtd";>
> <%
>   //get parameters to change date
>   String monthParam = request.getParameter("month");
>   String yearParam = request.getParameter("year");
>   
>   //create calendar object
>   Calendar cal = Calendar.getInstance();
>   cal.setFirstDayOfWeek(Calendar.SUNDAY); //set first day to Sunday
>   
>   if (monthParam != null)
> cal.set(Calendar.MONTH, (Integer.valueOf(monthParam)-1));
>   
>   if (yearParam != null)
> cal.set(Calendar.YEAR, Integer.valueOf(yearParam));
> 
>   //get total number of days in month
>   int numDaysInMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
> 
>   //get current month name in English
>   String monthName = cal.getDisplayName(Calendar.MONTH, Calendar.LONG,
> Locale.ENGLISH);
> 
>   //get current year
>   int year = cal.get(Calendar.YEAR);
>   
>   //get array of day names
>   String[] headers = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
> %>
> 
>   
> 
> Calendarama!
>   
>   
> 
>   
> 
> <%= monthName + " " + year %>
>   
>   
> 
> <%
>   for (int i=0; i<7; i++)
>   {
> %>
> <%= headers[i] %>
> <%
>   }
> %>
>   
>   
>   
> <%
>   for (int i=1; i<=numDaysInMonth; i++)
>   {
> //re-set calendar day in context of loop
> cal.set(Calendar.DAY_OF_MONTH, i);
> 
> //get the day number of the week
> int day = cal.get(Calendar.DAY_OF_WEEK);
> 
> //days without numbers count
> int blankDays = 0;
> 
> //blank days before 1st of month?
> if (i == 1 && day > 1)
> {
>   blankDays = day - i; //get count
> 
>   //loop through count and print blank day
>   for (int x=1; x<=blankDays; x++)
>   {
> %>
>    
> <%
>   }
> }
> %>
>   <%= i %>
> <%
> if (day == Calendar.SATURDAY)
> {
> %>
>   
>   
> <%
> }  
> 
> //blank days after last day of month?
> if (i == numDaysInMonth && day < 7)
> {
>   blankDays = 7 - day; //get count
> 
>   //loop through count and print blank day
>   for (int x=1; x<=blankDays; x++)
>   {
> %>
>    
> <%
>   }
> }
>   }
> %>
>   
> 
>   
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Trying-to-create-a-calendar---need-some-guidance-tp20138860p20153494.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Trying to create a calendar - need some guidance

2008-10-24 Thread V. Jenks

I'd really appreciate that Edgar, thanks!

As for the GridView - "duh" for me.

On another note, I just finished another one of our corporate sites, using
Wicket.  Check it out, let me know your thoughts, criticisms, etc.  I used
Wicket because I built our storefront a couple years ago with Wicket as well
and eventually they'll be more tightly integrated.

Everything is Wicket + Java EE 5 on Glassfish V2.

http://www.snakeriverfarms.com/


Edgar Merino wrote:
> 
> I've got an abstract calendar already coded, the only problem is that 
> it's using a DataTable (instead of only a gridview), I have to change 
> the code to use the gridview instead, I'll post the code tomorrow if 
> I've got the time and you're still interested.
> 
> Edgar Merino
> 
> 
> 
> 
> 
> John Krasnay escribió:
>> Uh, yeah, that's what I meant to say, just use a GridView :-)
>>
>> jk
>>
>> On Thu, Oct 23, 2008 at 05:14:42PM -0700, Igor Vaynberg wrote:
>>   
>>> all you need is a gridview. set columns to 7 and generate 30 items...
>>>
>>> -igor
>>>
>>> On Thu, Oct 23, 2008 at 1:47 PM, V. Jenks <[EMAIL PROTECTED]> wrote:
>>> 
>>>> Hi all.
>>>>
>>>> I'm trying to build a component-ized calendar that will be the
>>>> centerpiece
>>>> of a new application I'm working on.  I built one this morning in JSP
>>>> and
>>>> was able to do it with very little code.  I kept it simple and I'm
>>>> hoping I
>>>> can retro-fit the logic into a wicket page cleanly, without too much
>>>> trouble.  I'm a little stuck because in my JSP, I simply loop through
>>>> the
>>>> days and print until Saturday is reached, then I break to a new table
>>>> row
>>>> and continue.  Doing this in Wicket seems tough because if I use a
>>>> ListView,
>>>> I can't be as flexible as far as throwing in a new row while looping
>>>> and
>>>> outputting table cells.
>>>>
>>>> Here's the rough idea I came up with today in JSP, can someone give me
>>>> some
>>>> pointers?
>>>>
>>>> <%@ page contentType="text/html" pageEncoding="UTF-8" %>
>>>> <%@ page import="java.util.*" %>
>>>> >>> "http://www.w3.org/TR/html4/loose.dtd";>
>>>> <%
>>>>  //get parameters to change date
>>>>  String monthParam = request.getParameter("month");
>>>>  String yearParam = request.getParameter("year");
>>>>
>>>>  //create calendar object
>>>>  Calendar cal = Calendar.getInstance();
>>>>  cal.setFirstDayOfWeek(Calendar.SUNDAY); //set first day to Sunday
>>>>
>>>>  if (monthParam != null)
>>>>cal.set(Calendar.MONTH, (Integer.valueOf(monthParam)-1));
>>>>
>>>>  if (yearParam != null)
>>>>cal.set(Calendar.YEAR, Integer.valueOf(yearParam));
>>>>
>>>>  //get total number of days in month
>>>>  int numDaysInMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
>>>>
>>>>  //get current month name in English
>>>>  String monthName = cal.getDisplayName(Calendar.MONTH, Calendar.LONG,
>>>> Locale.ENGLISH);
>>>>
>>>>  //get current year
>>>>  int year = cal.get(Calendar.YEAR);
>>>>
>>>>  //get array of day names
>>>>  String[] headers = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
>>>> %>
>>>> 
>>>>  
>>>>
>>>>Calendarama!
>>>>  
>>>>  
>>>>
>>>>  
>>>>
>>>><%= monthName + " " + year
>>>> %>
>>>>  
>>>>  
>>>>
>>>><%
>>>>  for (int i=0; i<7; i++)
>>>>  {
>>>>%>
>>>><%= headers[i] %>
>>>><%
>>>>  }
>>>>%>
>>>>  
>>>>  
>>>>  
>>>><%
>>>>  for (int i=1; i<=numDaysInMonth; i++)
>>>>  {
>>>>//re-set calendar day in context of loop
>>>> 

Re: Trying to create a calendar - need some guidance

2008-10-23 Thread V. Jenks



adrienleroy wrote:
> 
> Hello,
> 
> Take a look at the webical project, they are using Wicket :  
> http://code.google.com/p/webical/
> 

Thanks, but it's important that I build my own, given the nature of this
project.  It took me 1.5 hrs. to do what I did in JSP so it's not like I'm
trying to accomplish a huge task.
-- 
View this message in context: 
http://www.nabble.com/Trying-to-create-a-calendar---need-some-guidance-tp20138860p20140032.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Trying to create a calendar - need some guidance

2008-10-23 Thread V. Jenks

Hi all.

I'm trying to build a component-ized calendar that will be the centerpiece
of a new application I'm working on.  I built one this morning in JSP and
was able to do it with very little code.  I kept it simple and I'm hoping I
can retro-fit the logic into a wicket page cleanly, without too much
trouble.  I'm a little stuck because in my JSP, I simply loop through the
days and print until Saturday is reached, then I break to a new table row
and continue.  Doing this in Wicket seems tough because if I use a ListView,
I can't be as flexible as far as throwing in a new row while looping and
outputting table cells.

Here's the rough idea I came up with today in JSP, can someone give me some
pointers?

<%@ page contentType="text/html" pageEncoding="UTF-8" %>
<%@ page import="java.util.*" %>
http://www.w3.org/TR/html4/loose.dtd";>
<%
  //get parameters to change date
  String monthParam = request.getParameter("month");
  String yearParam = request.getParameter("year");
  
  //create calendar object
  Calendar cal = Calendar.getInstance();
  cal.setFirstDayOfWeek(Calendar.SUNDAY); //set first day to Sunday
  
  if (monthParam != null)
cal.set(Calendar.MONTH, (Integer.valueOf(monthParam)-1));
  
  if (yearParam != null)
cal.set(Calendar.YEAR, Integer.valueOf(yearParam));

  //get total number of days in month
  int numDaysInMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);

  //get current month name in English
  String monthName = cal.getDisplayName(Calendar.MONTH, Calendar.LONG,
Locale.ENGLISH);

  //get current year
  int year = cal.get(Calendar.YEAR);
  
  //get array of day names
  String[] headers = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
%>

  

Calendarama!
  
  

  

<%= monthName + " " + year %>
  
  

<%
  for (int i=0; i<7; i++)
  {
%>
<%= headers[i] %>
<%
  }
%>
  
  
  
<%
  for (int i=1; i<=numDaysInMonth; i++)
  {
//re-set calendar day in context of loop
cal.set(Calendar.DAY_OF_MONTH, i);

//get the day number of the week
int day = cal.get(Calendar.DAY_OF_WEEK);

//days without numbers count
int blankDays = 0;

//blank days before 1st of month?
if (i == 1 && day > 1)
{
  blankDays = day - i; //get count

  //loop through count and print blank day
  for (int x=1; x<=blankDays; x++)
  {
%>
   
<%
  }
}
%>
  <%= i %>
<%
if (day == Calendar.SATURDAY)
{
%>
  
  
<%
}  

//blank days after last day of month?
if (i == numDaysInMonth && day < 7)
{
  blankDays = 7 - day; //get count

  //loop through count and print blank day
  for (int x=1; x<=blankDays; x++)
  {
%>
   
<%
  }
}
  }
%>
  

  


-- 
View this message in context: 
http://www.nabble.com/Trying-to-create-a-calendar---need-some-guidance-tp20138860p20138860.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



FileUploadField - value not stored in session?

2008-10-13 Thread V. Jenks

I'm using the FileUploadField and the name of the field is "image".  When the
form model loads, all other form fields appear but the upload field remains
blank.  Why is that?  Any way around it?
-- 
View this message in context: 
http://www.nabble.com/FileUploadField---value-not-stored-in-session--tp19960105p19960105.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: More issues w/ external images and DynamicWebResource

2008-06-25 Thread V. Jenks

Thanks Igor, I'll look into this - not something I've tried yet.  I was
hoping there'd be a short-term tweak to what I already have in place because
there are references to that imageResource lookup URL in several spots in my
code that I'd now have to go and swap out.


igor.vaynberg wrote:
> 
> why not just create a dead simple servlet that streams images? in fact
> there are tons of them online you can just take. it is a much simpler
> solution then dealing with wicket's resources for this particular
> usecase.
> 
> -igor
> 
> On Wed, Jun 25, 2008 at 7:59 AM, V. Jenks <[EMAIL PROTECTED]> wrote:
>>
>> I'm having non-stop issues w/ DynamicWebResource and trying to load
>> images
>> external to my .ear deployment now that I've moved to 1.3.  First off,
>> I'm
>> hoping someone can suggest an easier way to do it because what I have now
>> is
>> code that someone was nice enough to give me, here on the Wicket mailing
>> list.  However, I don't entirely understand how it works and while it
>> worked
>> for 2 years in Wicket 1.2, it is now causing me problem after problem in
>> Wicket 1.3.x - for whatever reason.
>>
>> First what I've got is a class called ImageResource which extends
>> DynamicWebResource:
>>
>> /*/
>> public class ImageResource extends DynamicWebResource
>> {
>>private ImageService imgSrv;
>>
>>public ImageResource()
>>{
>>super();
>>imgSrv = new ImageServiceEngine();
>>}
>>
>>public String getImage(String image)
>>{
>>String retImg = null;
>>
>>try
>>{
>>retImg = imgSrv.getImage(image).toString();
>>}
>>catch (IOException exp)
>>{
>>LogProxy.saveEntry(exp);
>>}
>>
>>return retImg;
>>}
>>
>>protected ResourceState getResourceState()
>>{
>>ImageResourceState state = null;
>>
>>try
>>{
>>ValueMap params = getParameters();
>>
>>byte[] data = null;
>>String imageId = params.getString("file");
>>
>>//Date lastModified = getImageLastMod(imageId);
>>state = new ImageResourceState(Time.valueOf(new
>> Date()));
>>state.setContentType("image/jpeg");
>>
>>//SECURITY PRECAUTION - DO NOT ALLOW ANYTHING BUT
>> IMAGES!
>>if
>> (imageId.contains(PropertyProxy.getExternalImagesRoot()) ||
>>   
>> imageId.contains(PropertyProxy.getExternalImagesAltRoot()))
>>{
>>data = imgSrv.getImage(imageId);
>>}
>>else
>>{
>>//change image to "not found" warning
>> image
>>data =
>> imgSrv.getImage(PropertyProxy.getImageNotFound());
>>
>>//TODO: send email to notify of
>> inappropriate access
>>}
>>
>>state.setData(data);
>>}
>>catch (FileNotFoundException exp)
>>{
>>LogProxy.saveEntry(exp);
>>}
>>catch (IOException exp)
>>{
>>LogProxy.saveEntry(exp);
>>}
>>catch (NullPointerException exp)
>>{
>>LogProxy.saveEntry(exp);
>>}
>>
>>return state;
>>}
>>
>>/**
>> *
>> * @author vjenks
>> *
>> */
>>protected class ImageResourceState extends ResourceState
>>{
>>private String contentType;
>>private byte[] data;
>>private Time lastModified;
>>
>>ImageResourceState(Time lastModified)
>>{

Re: More issues w/ external images and DynamicWebResource

2008-06-25 Thread V. Jenks

Ha!  The author of that article is the guy who gave me that very same code
here on the mailing list.  Look through the code I posted and you'll see the
similarities - it's literally unchanged.  

However, as I described - it's not working now that I have to use a Wicket
Filter in 1.3.


Nino.Martinez wrote:
> 
> Did you try searching the wiki about this?
> 
> http://cwiki.apache.org/WICKET/uploaddownload.html
> 
> There might be more...
> 
> V. Jenks wrote:
>> I'm having non-stop issues w/ DynamicWebResource and trying to load
>> images
>> external to my .ear deployment now that I've moved to 1.3.  First off,
>> I'm
>> hoping someone can suggest an easier way to do it because what I have now
>> is
>> code that someone was nice enough to give me, here on the Wicket mailing
>> list.  However, I don't entirely understand how it works and while it
>> worked
>> for 2 years in Wicket 1.2, it is now causing me problem after problem in
>> Wicket 1.3.x - for whatever reason.
>>
>> First what I've got is a class called ImageResource which extends
>> DynamicWebResource:
>>
>> /*/
>> public class ImageResource extends DynamicWebResource
>> {
>>  private ImageService imgSrv;
>>
>>  public ImageResource()
>>  {
>>  super();
>>  imgSrv = new ImageServiceEngine();
>>  }
>>
>>  public String getImage(String image)
>>  {
>>  String retImg = null;
>>
>>  try
>>  {
>>  retImg = imgSrv.getImage(image).toString();
>>  }
>>  catch (IOException exp)
>>  {
>>  LogProxy.saveEntry(exp);
>>  }
>>
>>  return retImg;
>>  }
>>
>>  protected ResourceState getResourceState()
>>  {
>>  ImageResourceState state = null;
>>  
>>  try
>>  {
>>  ValueMap params = getParameters();
>>
>>  byte[] data = null;
>>  String imageId = params.getString("file");
>>   
>>  //Date lastModified = getImageLastMod(imageId); 
>>  state = new ImageResourceState(Time.valueOf(new 
>> Date()));
>>  state.setContentType("image/jpeg");
>>  
>>  //SECURITY PRECAUTION - DO NOT ALLOW ANYTHING BUT 
>> IMAGES!
>>  if 
>> (imageId.contains(PropertyProxy.getExternalImagesRoot()) || 
>>  
>> imageId.contains(PropertyProxy.getExternalImagesAltRoot()))
>>  {
>>  data = imgSrv.getImage(imageId);
>>  }
>>  else
>>  {
>>  //change image to "not found" warning image
>>  data = 
>> imgSrv.getImage(PropertyProxy.getImageNotFound());
>>  
>>  //TODO: send email to notify of inappropriate 
>> access
>>  }
>>  
>>  state.setData(data);
>>  }
>>  catch (FileNotFoundException exp)
>>  {
>>  LogProxy.saveEntry(exp);
>>  }
>>  catch (IOException exp)
>>  {
>>  LogProxy.saveEntry(exp);
>>  }
>>  catch (NullPointerException exp)
>>  {
>>  LogProxy.saveEntry(exp);
>>  }
>>  
>>  return state;
>>  }
>>
>>  /**
>>   * 
>>   * @author vjenks
>>   * 
>>   */
>>  protected class ImageResourceState extends ResourceState
>>  {
>>  private String contentType;
>>  private byte[] data;
>>  private Time lastModified;
>>
>>  ImageResourceState(Time lastModified)
>>  {
>>  super();
>>  this.lastModified = lastModified;
>>  }
>>
>>  public String getContentType()
>>  {
>>   

More issues w/ external images and DynamicWebResource

2008-06-25 Thread V. Jenks

I'm having non-stop issues w/ DynamicWebResource and trying to load images
external to my .ear deployment now that I've moved to 1.3.  First off, I'm
hoping someone can suggest an easier way to do it because what I have now is
code that someone was nice enough to give me, here on the Wicket mailing
list.  However, I don't entirely understand how it works and while it worked
for 2 years in Wicket 1.2, it is now causing me problem after problem in
Wicket 1.3.x - for whatever reason.

First what I've got is a class called ImageResource which extends
DynamicWebResource:

/*/
public class ImageResource extends DynamicWebResource
{
private ImageService imgSrv;

public ImageResource()
{
super();
imgSrv = new ImageServiceEngine();
}

public String getImage(String image)
{
String retImg = null;

try
{
retImg = imgSrv.getImage(image).toString();
}
catch (IOException exp)
{
LogProxy.saveEntry(exp);
}

return retImg;
}

protected ResourceState getResourceState()
{
ImageResourceState state = null;

try
{
ValueMap params = getParameters();

byte[] data = null;
String imageId = params.getString("file");
  
//Date lastModified = getImageLastMod(imageId); 
state = new ImageResourceState(Time.valueOf(new 
Date()));
state.setContentType("image/jpeg");

//SECURITY PRECAUTION - DO NOT ALLOW ANYTHING BUT 
IMAGES!
if 
(imageId.contains(PropertyProxy.getExternalImagesRoot()) || 

imageId.contains(PropertyProxy.getExternalImagesAltRoot()))
{
data = imgSrv.getImage(imageId);
}
else
{
//change image to "not found" warning image
data = 
imgSrv.getImage(PropertyProxy.getImageNotFound());

//TODO: send email to notify of inappropriate 
access
}

state.setData(data);
}
catch (FileNotFoundException exp)
{
LogProxy.saveEntry(exp);
}
catch (IOException exp)
{
LogProxy.saveEntry(exp);
}
catch (NullPointerException exp)
{
LogProxy.saveEntry(exp);
}

return state;
}

/**
 * 
 * @author vjenks
 * 
 */
protected class ImageResourceState extends ResourceState
{
private String contentType;
private byte[] data;
private Time lastModified;

ImageResourceState(Time lastModified)
{
super();
this.lastModified = lastModified;
}

public String getContentType()
{
return contentType;
}

void setContentType(String contentType)
{
this.contentType = contentType;
}

public byte[] getData()
{
return data;
}

void setData(byte[] data)
{
this.data = data;
}

public int getLength()
{
if (data != null)
return data.length;
else
return 0;
}

public Time lastModifiedTime()
{
return lastModified;
}
}
}
/*/


You can see that it uses a class called ImageServiceEngine:

/*/
public class ImageServiceEngine implements ImageService, Serializable
{
private int thumbnailSize;

public ImageServiceEngine()
{
super();
}

public int getThumbnailSize()
{
return this.thumbnailSize;
}

public void setThumbnailSize(in

Re: DateTextField - what am I missing here?

2008-05-13 Thread V. Jenks

I don't know, would it?  That's what I'm trying to figure out, the example is
very vague.

By that logic, I should name pass in "expiryDate" even though I've already
named the field that?  I tried:

DateTextField expiryDate = new DateTextField(
"expiryDate", 
new PropertyModel(this, "expiryDate"), 
new StyleDateConverter("S-", true));

expiryDate.add(new DatePicker());
expiryDate.setRequired(true);
codeForm.add(expiryDate);


...and it fails:

52560 [httpSSLWorkerThread-80-4] ERROR org.apache.wicket.RequestCycle - No
get method defined for class: class
com.agribeef.abcommerce.ui.admin.EditDiscountCode expression: expiryDate
org.apache.wicket.WicketRuntimeException: No get method defined for class:
class com.agribeef.abcommerce.ui.admin.EditDiscountCode expression:
expiryDate

This seems rather cumbersome, calendars worked really well in 1.2...I can't
make sense of this.

Thanks again...


Gwyn wrote:
> 
> From a very quick look, won't your property model value of "date" will
> mean it'll be doing a "getDate()" not "getExpiryDate()"?
> 
> /Gwyn
> 
> On Tue, May 13, 2008 at 8:38 PM, V. Jenks <[EMAIL PROTECTED]> wrote:
>>
>>  Sorry, I'll clarify, was trying to be as condensed as possible.
>>  "EditDiscountCode" is the name of the page, which inherits WebPage.
>>
>>  The model object of the form, which is my "DiscountCode" entity, does
>> have a
>>  getter/setter for the expiryDate field, which is what I showed you in my
>>  initial post.
>>
>>  @Entity
>>  @Table(name="tbl_discount_code")
>>  public class DiscountCode implements Serializable
>>  {
>>
>>   .
>>
>> @Temporal(value=TemporalType.DATE)
>>   @Column(nullable=false)
>> private Date expiryDate;
>>
>>   .
>>
>> public Date getExpiryDate()
>> {
>> return this.expiryDate;
>> }
>>
>> public void setExpiryDate(Date expiryDate)
>> {
>> this.expiryDate = expiryDate;
>> }
>>  }
>>
>>
>>  So, I suppose I'm not entirely clear on what you're suggesting?
>>
>>
>>
>>
>>  Mr Mean wrote:
>>  >
>>  > Assuming EditDiscountCode is a wicket component, given the new
>>  > PropertyModel(this, "date") You probably want to either use an object
>>  > that has a get/setDate (your model object) or add those methods to
>>  > your component.
>>  >
>>  > Maurice
>>  >
>>  > On Tue, May 13, 2008 at 9:04 PM, V. Jenks <[EMAIL PROTECTED]> wrote:
>>  >>
>>  >>  I must be missing something obvious but I can't spot itI'm using
>> a
>>  >>  DateTextField (Wicket 1.3.2) in my form like so:
>>  >>
>>  >>  Java:
>>  >> DateTextField expiryDate = new DateTextField(
>>  >> "expiryDate",
>>  >> new PropertyModel(this, "date"),
>>  >> new StyleDateConverter("S-", true));
>>  >>
>>  >> expiryDate.add(new DatePicker());
>>  >> expiryDate.setRequired(true);
>>  >> codeForm.add(expiryDate);
>>  >>
>>  >>
>>  >>  HTML:
>>  >>  
>>  >>
>>  >>  My error:
>>  >>  org.apache.wicket.WicketRuntimeException: No get method defined for
>>  >> class:
>>  >>  class com.agribeef.abcommerce.ui.admin.EditDiscountCode expression:
>> date
>>  >> at
>>  >>
>>  >>
>> org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433)
>>  >> at
>>  >>
>>  >>
>> org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
>>  >> at
>>  >>
>>  >>
>> org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
>>  >> at
>>  >>
>>  >>
>> org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113)
>>  >> at
>>  >> org.apache.wicket.Component.getModelObject(Component.java:1551)
>>  >> at
>>  >>
>>  >>
>> org.apache.wicket.extensions.yui.calendar.DatePicker.configure(

Re: DateTextField - what am I missing here?

2008-05-13 Thread V. Jenks

Sorry, I'll clarify, was trying to be as condensed as possible. 
"EditDiscountCode" is the name of the page, which inherits WebPage.

The model object of the form, which is my "DiscountCode" entity, does have a
getter/setter for the expiryDate field, which is what I showed you in my
initial post.

@Entity
@Table(name="tbl_discount_code")
public class DiscountCode implements Serializable
{

  .

@Temporal(value=TemporalType.DATE)
  @Column(nullable=false)
private Date expiryDate;

  .

public Date getExpiryDate()
{
return this.expiryDate;
}

public void setExpiryDate(Date expiryDate)
{
this.expiryDate = expiryDate;
}
}


So, I suppose I'm not entirely clear on what you're suggesting?


Mr Mean wrote:
> 
> Assuming EditDiscountCode is a wicket component, given the new
> PropertyModel(this, "date") You probably want to either use an object
> that has a get/setDate (your model object) or add those methods to
> your component.
> 
> Maurice
> 
> On Tue, May 13, 2008 at 9:04 PM, V. Jenks <[EMAIL PROTECTED]> wrote:
>>
>>  I must be missing something obvious but I can't spot itI'm using a
>>  DateTextField (Wicket 1.3.2) in my form like so:
>>
>>  Java:
>> DateTextField expiryDate = new DateTextField(
>> "expiryDate",
>> new PropertyModel(this, "date"),
>> new StyleDateConverter("S-", true));
>>
>> expiryDate.add(new DatePicker());
>> expiryDate.setRequired(true);
>> codeForm.add(expiryDate);
>>
>>
>>  HTML:
>>  
>>
>>  My error:
>>  org.apache.wicket.WicketRuntimeException: No get method defined for
>> class:
>>  class com.agribeef.abcommerce.ui.admin.EditDiscountCode expression: date
>> at
>> 
>> org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433)
>> at
>> 
>> org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
>> at
>> 
>> org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
>> at
>> 
>> org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113)
>> at
>> org.apache.wicket.Component.getModelObject(Component.java:1551)
>> at
>> 
>> org.apache.wicket.extensions.yui.calendar.DatePicker.configure(DatePicker.java:367)
>> at
>> 
>> org.apache.wicket.extensions.yui.calendar.DatePicker.renderHead(DatePicker.java:208)
>> at org.apache.wicket.Component.renderHead(Component.java:2558)
>>
>>  I'm following the example but not sure what this means.
>>
>>  Thanks!
>>  --
>>  View this message in context:
>> http://www.nabble.com/DateTextField---what-am-I-missing-here--tp17215983p17215983.html
>>  Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>>  -
>>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>>  For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DateTextField---what-am-I-missing-here--tp17215983p17216684.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DateTextField - what am I missing here?

2008-05-13 Thread V. Jenks

I must be missing something obvious but I can't spot itI'm using a
DateTextField (Wicket 1.3.2) in my form like so:

Java:
DateTextField expiryDate = new DateTextField(
"expiryDate", 
new PropertyModel(this, "date"), 
new StyleDateConverter("S-", true));

expiryDate.add(new DatePicker());
expiryDate.setRequired(true);
codeForm.add(expiryDate);


HTML:


My error:
org.apache.wicket.WicketRuntimeException: No get method defined for class:
class com.agribeef.abcommerce.ui.admin.EditDiscountCode expression: date
at
org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433)
at
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
at
org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
at
org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113)
at org.apache.wicket.Component.getModelObject(Component.java:1551)
at
org.apache.wicket.extensions.yui.calendar.DatePicker.configure(DatePicker.java:367)
at
org.apache.wicket.extensions.yui.calendar.DatePicker.renderHead(DatePicker.java:208)
at org.apache.wicket.Component.renderHead(Component.java:2558)

I'm following the example but not sure what this means.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/DateTextField---what-am-I-missing-here--tp17215983p17215983.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DynamicWebResource & ResourceState acting strange in 1.3

2008-05-05 Thread V. Jenks

About 2 years ago (yeah, wow!) someone on this list helped me figure out how
to load external images onto my pages and it worked perfectly, until I
upgraded to 1.3.x from 1.2.4.  I don't know much about the internals of how
it works, it's a lot of code, and I really didn't care how it worked, it
just did!

Now that it's broken due to the upgrade, I'm trying to figure out what's
going on and I think I've pinpointed where it's failing.

The class signature looks like so:

public class ImageResource extends DynamicWebResource

...and in there is a method that gets the ResourceState:

protected ResourceState getResourceState()

In there, I get the params:

ValueMap params = getParameters();

byte[] data = null;
String imageId = params.get("file").toString();
  
  System.out.println("IMAGE ID: " + imageId);
  
if 
(imageId.contains(PropertyProxy.getExternalImagesRoot()) || 

imageId.contains(PropertyProxy.getExternalImagesAltRoot()))
System.out.println("YES! - STRING CONTAINS IMAGE ROOT CONFIG
PROPERTY!!!");
  else
System.out.println("NO... - STRING DOES NOT CONTAIN IMAGE ROOT
CONFIG PROPERTY.");

So with this, I could make a call in a Wicket page like so:

//get reference to Application's ResourceReference
ResourceReference imageResource = new 
ResourceReference("imageResource");

//build URL of image from file
String imgUrl = RequestCycle.get().urlFor(imageResource) + 
"?file=C:\\MyApp\\assets\\images\\category\\Bundles.jpg";

add(getContainer("bundleThumbImg", "src", imgUrl));

However, now the "file" parameter can't be cast as a String, strangely
enough, I get this output when running what I showed above:

IMAGE ID: [Ljava.lang.String;@25249a
NO... - STRING DOES NOT CONTAIN IMAGE ROOT CONFIG PROPERTY.

This is where everything breaks down for me.  I expected (and always got in
Wicket 1.2.x) the actual value of the "file" param in the URL shown above.  

Can anyone offer any advice?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/DynamicWebResource---ResourceState-acting-strange-in-1.3-tp17067666p17067666.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: WebMarkupContainer - images cannot be found after move to 1.3?

2008-04-11 Thread V. Jenks

Sorry, I forgot to include this class, which someone here on the mailing list
gave to me way back in '06 when I first built this app.  It's been so long
since I had to look at this I forgot it was a custom class:

public class ImageResource extends DynamicWebResource
{
private ImageService imgSrv;

public ImageResource()
{
super();
imgSrv = new ImageServiceEngine();
}

public String getImage(String image)
{
String retImg = null;

try
{
retImg = imgSrv.getImage(image).toString();
}
catch (IOException exp)
{
LogProxy.saveEntry(exp);
}

return retImg;
}

protected ResourceState getResourceState()
{
ImageResourceState state = null;

try
{
ValueMap params = getParameters();

byte[] data = null;
String imageId = params.get("file").toString();
//Date lastModified = getImageLastMod(imageId); 
state = new ImageResourceState(Time.valueOf(new 
Date()));
state.setContentType("image/gif");

//SECURITY PRECAUTION - DO NOT ALLOW ANYTHING BUT 
IMAGES!
if 
(imageId.contains(PropertyProxy.getExternalImagesRoot()) || 

imageId.contains(PropertyProxy.getExternalImagesAltRoot()))
{
data = imgSrv.getImage(imageId);
}
else
{
//change image to "not found" warning image
data = 
imgSrv.getImage(PropertyProxy.getImageNotFound());

//TODO: send email to notify of inappropriate 
access
}

state.setData(data);
}
catch (FileNotFoundException exp)
{
LogProxy.saveEntry(exp);
}
catch (IOException exp)
{
LogProxy.saveEntry(exp);
}
catch (NullPointerException exp)
{
LogProxy.saveEntry(exp);
}

return state;
}

/**
 * 
 * @author vjenks
 * 
 */
protected class ImageResourceState extends ResourceState
{
private String contentType;
private byte[] data;
private Time lastModified;

ImageResourceState(Time lastModified)
{
super();
this.lastModified = lastModified;
}

public String getContentType()
{
return contentType;
}

void setContentType(String contentType)
{
this.contentType = contentType;
}

public byte[] getData()
{
return data;
}

void setData(byte[] data)
{
this.data = data;
}

public int getLength()
{
if (data != null)
return data.length;
else
return 0;
}

public Time lastModifiedTime()
{
return lastModified;
    }
}
}



V. Jenks wrote:
> 
> Hi all,
> 
> I built our storefront almost two years ago now, in Wicket 1.2.x.  I'm now
> upgrading from 1.2.4 to 1.3 and am just about finished but I'm stuck on
> one seemingly simple thing.
> 
> My "init()" looks like this:
> 
>   public void init()
>   {
> //create external images resource
> getSharedResources().add("imageResource", new ImageResource());
>   }
> 
> I've had this method in my own "hepler" class since this project started:
> 
>   public static WebMarkupContainer getImageContainer(String name, String
> image)
>   {
>   //get reference to Application's ResourceReference
>   ResourceReference imageResource = new
> ResourceReference("imageResource");
>   
>

WebMarkupContainer - images cannot be found after move to 1.3?

2008-04-11 Thread V. Jenks

Hi all,

I built our storefront almost two years ago now, in Wicket 1.2.x.  I'm now
upgrading from 1.2.4 to 1.3 and am just about finished but I'm stuck on one
seemingly simple thing.

My "init()" looks like this:

  public void init()
  {
//create external images resource
getSharedResources().add("imageResource", new ImageResource());
  }

I've had this method in my own "hepler" class since this project started:

public static WebMarkupContainer getImageContainer(String name, String
image)
{
//get reference to Application's ResourceReference
ResourceReference imageResource = new 
ResourceReference("imageResource");

//build URL of image from file
String imgUrl = RequestCycle.get().urlFor(imageResource) + 
"?file=" +
image;

return getContainer(name, "src", imgUrl);
}

It just encapsulates my ability to use external images in my app (outside of
the deployed .ear).

I would use it like so, in a Wicket page:

String thumb = 
"C:\\MYApp\\assets\\images\\category\\Bundles.jpg";
add(WicketHelper.getImageContainer("bundleThumbImg", thumb));

This always worked fine until the upgrade to 1.3 and change the filter in
web.xml to look at "/*" instead of "home/*" - which I'm guessing had
something to do with it?

Anyhow, the images are all broken even though my path on disk is correct. 
Am I missing something obvious?

Thanks!

-- 
View this message in context: 
http://www.nabble.com/WebMarkupContainer---images-cannot-be-found-after-move-to-1.3--tp16627879p16627879.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ListView params from 1.2 to 1.3 - detached data

2008-04-04 Thread V. Jenks

I'm having some trouble finding out how to use detached data with a ListView,
as I would have in Wicket 1.2.

In 1.2 I would have used a detachable model:

IModel model = new LoadableDetachableModel()
{
protected Object load()
{
return data;
}
};  

...but ListView doesn't appear to accept IModel as a parameter anymore.  How
would I pass detached data into a ListView in 1.3?
-- 
View this message in context: 
http://www.nabble.com/ListView-params-from-1.2-to-1.3---detached-data-tp16492707p16492707.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket - Session Manamagement

2008-03-20 Thread V. Jenks

I told you it was a stupid question, I figured it out...

  @Override
  public Session newSession(Request request, Response response)
  {
return new UserSession(NavitopiaApp.this);
  }


V. Jenks wrote:
> 
> I've actually been trying that but (and here's a stupid question) - I'm
> not sure what to do with the Request and Response parameters it requires?
> 
> 
> igor.vaynberg wrote:
>> 
>> override newsession() on application
>> 
>> -igor
>> 
>> 
>> On Thu, Mar 20, 2008 at 9:34 PM, V. Jenks <[EMAIL PROTECTED]> wrote:
>>>
>>>  I'm just now trying to upgrade to 1.3 having used 1.2.4 (and earlier)
>>> for
>>>  over a year now.
>>>
>>>  Normally I would have done this, in the WebApplication class:
>>>
>>>   @Override
>>>   public ISessionFactory getSessionFactory()
>>>   {
>>> return new ISessionFactory()
>>> {
>>>   public Session newSession()
>>>   {
>>> return new UserSession(NavitopiaApp.this);
>>>   }
>>> };
>>>   }
>>>
>>>  ...is that concept now entirely gone?  This doesn't appear to be
>>> outlined in
>>>  the migration guide at all and I have no clue how to implement this, at
>>> this
>>>  point.
>>>
>>>  Thanks!
>>>
>>>
>>>
>>>
>>>  Eelco Hillenius wrote:
>>>  >
>>>  >> Thanks..certainly makes sense...just a question on the meta-data
>>> facilty
>>>  >> though, am just wondering as to how would we be using the same in
>>> the
>>>  >> context (as you said) where components are not aware of the Session
>>>  >> type...if you ilustrate it with an example that would be great, am
>>> just
>>>  >> trying to understand the context where the components would need a
>>> direct
>>>  >> interaction with the session..
>>>  >
>>>  > Look at WebRequestCycle#newClientInfo and
>>>  > WebPage#PageMapChecker#renderHead.
>>>  >
>>>  > Eelco
>>>  >
>>>  > -
>>>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>  > For additional commands, e-mail: [EMAIL PROTECTED]
>>>  >
>>>  >
>>>  >
>>>
>>>  --
>>>  View this message in context:
>>> http://www.nabble.com/Wicket---Session-Manamagement-tp13354659p16193777.html
>>>
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>>  -
>>>
>>>
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>  For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>> 
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket---Session-Manamagement-tp13354659p16193919.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket - Session Manamagement

2008-03-20 Thread V. Jenks

I've actually been trying that but (and here's a stupid question) - I'm not
sure what to do with the Request and Response parameters it requires?


igor.vaynberg wrote:
> 
> override newsession() on application
> 
> -igor
> 
> 
> On Thu, Mar 20, 2008 at 9:34 PM, V. Jenks <[EMAIL PROTECTED]> wrote:
>>
>>  I'm just now trying to upgrade to 1.3 having used 1.2.4 (and earlier)
>> for
>>  over a year now.
>>
>>  Normally I would have done this, in the WebApplication class:
>>
>>   @Override
>>   public ISessionFactory getSessionFactory()
>>   {
>> return new ISessionFactory()
>> {
>>   public Session newSession()
>>   {
>> return new UserSession(NavitopiaApp.this);
>>   }
>> };
>>   }
>>
>>  ...is that concept now entirely gone?  This doesn't appear to be
>> outlined in
>>  the migration guide at all and I have no clue how to implement this, at
>> this
>>  point.
>>
>>  Thanks!
>>
>>
>>
>>
>>  Eelco Hillenius wrote:
>>  >
>>  >> Thanks..certainly makes sense...just a question on the meta-data
>> facilty
>>  >> though, am just wondering as to how would we be using the same in the
>>  >> context (as you said) where components are not aware of the Session
>>  >> type...if you ilustrate it with an example that would be great, am
>> just
>>  >> trying to understand the context where the components would need a
>> direct
>>  >> interaction with the session..
>>  >
>>  > Look at WebRequestCycle#newClientInfo and
>>  > WebPage#PageMapChecker#renderHead.
>>  >
>>  > Eelco
>>  >
>>  > -
>>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>>  > For additional commands, e-mail: [EMAIL PROTECTED]
>>  >
>>  >
>>  >
>>
>>  --
>>  View this message in context:
>> http://www.nabble.com/Wicket---Session-Manamagement-tp13354659p16193777.html
>>
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>>  -
>>
>>
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>  For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket---Session-Manamagement-tp13354659p16193882.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket - Session Manamagement

2008-03-20 Thread V. Jenks

I'm just now trying to upgrade to 1.3 having used 1.2.4 (and earlier) for
over a year now.

Normally I would have done this, in the WebApplication class:

  @Override
  public ISessionFactory getSessionFactory()
  {
return new ISessionFactory()
{
  public Session newSession()
  {
return new UserSession(NavitopiaApp.this);
  }
};
  }

...is that concept now entirely gone?  This doesn't appear to be outlined in
the migration guide at all and I have no clue how to implement this, at this
point.

Thanks!


Eelco Hillenius wrote:
> 
>> Thanks..certainly makes sense...just a question on the meta-data facilty
>> though, am just wondering as to how would we be using the same in the
>> context (as you said) where components are not aware of the Session
>> type...if you ilustrate it with an example that would be great, am just
>> trying to understand the context where the components would need a direct
>> interaction with the session..
> 
> Look at WebRequestCycle#newClientInfo and
> WebPage#PageMapChecker#renderHead.
> 
> Eelco
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket---Session-Manamagement-tp13354659p16193777.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reusable search form - help w/ detail...

2007-12-21 Thread V. Jenks

Hello Wicketeers...

I've got a series of pages that all have the same search form and use the
same input class, the only thing different about them is where they redirect
(since every page is different.)

I need a second set of eyes...how do I make this form reusable?  The form
captures the search input and redirects the page back to itself...so I need
a way of parameterizing where it redirects (unless there's a better approach
that I'm unaware of.)

Here's the page that my search pages will derive from, which is already
using markup inheritance (i.e. "BasePage", which derives from WebPage):

public class SearchListPage extends BasePage
{
private static class SearchForm extends Form
{
public SearchForm(String name, SearchInput input, WebPage 
redirectPage)
{
super(name, new CompoundPropertyModel(input));

add(new TextField("searchText")
.setRequired(true)
.add(StringValidator.lengthBetween(2, 
100)));

add(new Button("searchButton")
{
public void onSubmit()
{
try
{
//save form values, redirect
SearchInput input = 
(SearchInput)getParent().getModelObject();
redirectPage. //WHAT DO TO 
HERE??
setResponsePage(new 
WebPage(input.getSearchText())); //WRONG!
}
catch (Exception exp)
{
info(exp.getMessage());
}
}
});
}   
}
}

As you can see, I've gotten as far as trying to figure out what I can do w/
the WebPage param, if anything...any ideas?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Reusable-search-form---help-w--detail...-tp14457665p14457665.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Wicket (advanced) Calendar?

2007-11-26 Thread V. Jenks

I'm beginning a new commercial project with a partner that has good chances
of landing some investment funding in the next year.  We've set out using
Wicket, JPA, Glassfish, and Netbeans as our "toolbox" and platform(s) as it
is what we're experienced in and enjoy building applications with.  We're
not interested in alternative frameworks and solutions...but rather a
widget, if one doesn't already exist.

The central focus of the application will be an editable calendar, a la
Google Calendar.  Everything else is built around the concept of a rich,
preferably Ajax-driven, calendar.  Has anyone written such a control for
Wicket, commercial or free?  Has someone integrated another framework with
Wicket that provides this type of base functionality?  We'd definitely be
interested in purchasing such a component, if the quality and price is
right, and if one does not exist, currently.

Can anyone provide any info on this?

Thanks much!
-- 
View this message in context: 
http://www.nabble.com/Wicket-%28advanced%29-Calendar--tf4876158.html#a13953001
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



What exactly isn't serializable?

2007-11-23 Thread V. Jenks

I'm upgrading from Wicket 1.2.4 to 1.2.6 and there's obviously a change I'm
not able to find concerning the session (or...who knows?)

I've got a simple pair of pages, one for viewing a list of entity beans
(EJB3) and one for editing a chosen entity from the list page.  I'm
comparing it to dozens of pages I've built like this in the past in previous
versions of Wicket and I just can't figure out why I keep getting this
exception:

***
Internal error cloning object. Make sure all dependent objects implement
Serializable. Class: com.myapp.ui.admin.EditPilot
wicket.WicketRuntimeException: Internal error cloning object. Make sure all
dependent objects implement Serializable. Class:
com.myapp.ui.admin.EditPilot
at
wicket.protocol.http.HttpSessionStore.setAttribute(HttpSessionStore.java:63)
at wicket.Session.setAttribute(Session.java:952)
at wicket.PageMap.put(PageMap.java:531)
at wicket.Session.touch(Session.java:744)
at wicket.Page.renderPage(Page.java:414)
at
wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:226)
at
wicket.request.compound.DefaultResponseStrategy.respond(DefaultResponseStrategy.java:49)
at
wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(AbstractCompoundRequestCycleProcessor.java:66)
at
wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:902)
at
wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929)
at wicket.RequestCycle.step(RequestCycle.java:1010)
at wicket.RequestCycle.steps(RequestCycle.java:1084)
at wicket.RequestCycle.request(RequestCycle.java:454)
at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:361)
at
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at
com.sun.enterprise.web.c

Re: Mystery problem w/ Wicket + Glassfish v2?

2007-11-05 Thread V. Jenks

OOps!  Sorry, in the Glassfish log-viewer they separate the top line of the
stack from the rest, for some reason.  Here it is:

null java.lang.NullPointerException at
wicket.markup.html.DynamicWebResource$1.getContentType(DynamicWebResource.java



Johan Compagner wrote:
> 
> you miss the most importand part of the error:  the top!
> 
> 
> On 11/5/07, V. Jenks <[EMAIL PROTECTED]> wrote:
>>
>>
>> Occasionally, my application will "just start doing this" - throwing this
>> error.  I am using Wicket 1.2.4 because my application is "stuck" at that
>> version for the time being.  I do not have the time to make the changes
>> to
>> upgrade to the latest version, right now.
>>
>> Rebooting the app server (Glassfish v2) usually "fixes" it but when it
>> does
>> happen, it prevents orders from going through and frustrates
>> customers.  Not
>> a good thing...
>>
>> I have no idea what causes this and don't know the internals of Glassfish
>> to
>> even begin to try and troubleshoot.  All I know for sure is; this NEVER
>> happened on JBoss 4.0.x with Wicket.  I figured it was safe to assume
>> this
>> had nothing to do with my code - nowhere in the stack does it point to
>> anything in my application (or any application running on it, for that
>> matter.)
>>
>> I realize this is vague so hopefully someone else is experiencing this
>> and
>> can help troubleshoot.
>>
>> Here's the error:
>>
>> ***
>>
>> 156) at wicket.Resource.onResourceRequested(Resource.java:119) at
>> wicket.request.target.resource.SharedResourceRequestTarget.respond(
>> SharedResourceRequestTarget.java:192)
>> at
>> wicket.request.compound.DefaultResponseStrategy.respond(
>> DefaultResponseStrategy.java:49)
>> at
>> wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(
>> AbstractCompoundRequestCycleProcessor.java:66)
>> at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:902)
>> at
>> wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:934) at
>> wicket.RequestCycle.step(RequestCycle.java:1010) at
>> wicket.RequestCycle.steps(RequestCycle.java:1084) at
>> wicket.RequestCycle.request(RequestCycle.java:454) at
>> wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219) at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:718) at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at
>> org.apache.catalina.core.ApplicationFilterChain.servletService(
>> ApplicationFilterChain.java:411)
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(
>> StandardWrapperValve.java:290)
>> at
>> org.apache.catalina.core.StandardContextValve.invokeInternal(
>> StandardContextValve.java:271)
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(
>> StandardContextValve.java:202)
>> at
>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
>> :632)
>> at
>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
>> :577)
>> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
>> :206)
>> at
>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
>> :632)
>> at
>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
>> :577)
>> at
>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
>> :571)
>> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
>> at
>> org.apache.catalina.core.StandardEngineValve.invoke(
>> StandardEngineValve.java:150)
>> at
>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
>> :632)
>> at
>> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
>> :577)
>> at
>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
>> :571)
>> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
>> at
>> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
>> at
>>
>> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter
>> (DefaultProcessorTask.java:637)
>> at
>> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(
>> DefaultProcessorTask.java:568)
>> at
>> com.sun.enterprise.web.co

Mystery problem w/ Wicket + Glassfish v2?

2007-11-05 Thread V. Jenks

Occasionally, my application will "just start doing this" - throwing this
error.  I am using Wicket 1.2.4 because my application is "stuck" at that
version for the time being.  I do not have the time to make the changes to
upgrade to the latest version, right now.  

Rebooting the app server (Glassfish v2) usually "fixes" it but when it does
happen, it prevents orders from going through and frustrates customers.  Not
a good thing...

I have no idea what causes this and don't know the internals of Glassfish to
even begin to try and troubleshoot.  All I know for sure is; this NEVER
happened on JBoss 4.0.x with Wicket.  I figured it was safe to assume this
had nothing to do with my code - nowhere in the stack does it point to
anything in my application (or any application running on it, for that
matter.)

I realize this is vague so hopefully someone else is experiencing this and
can help troubleshoot.

Here's the error:

***

156) at wicket.Resource.onResourceRequested(Resource.java:119) at
wicket.request.target.resource.SharedResourceRequestTarget.respond(SharedResourceRequestTarget.java:192)
at
wicket.request.compound.DefaultResponseStrategy.respond(DefaultResponseStrategy.java:49)
at
wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(AbstractCompoundRequestCycleProcessor.java:66)
at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:902) at
wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:934) at
wicket.RequestCycle.step(RequestCycle.java:1010) at
wicket.RequestCycle.steps(RequestCycle.java:1084) at
wicket.RequestCycle.request(RequestCycle.java:454) at
wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:718) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270) at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:361)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)

***

Any help would be appreciated.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Mystery-problem-w--Wicket-%2B-Glassfish-v2--tf4752337.html#a13589050
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: CheckBox is misbehaving...

2007-10-03 Thread V. Jenks

Ah ha, that makes sense...I understand now.  I reorganized the code so I
could pre-load the input class first and it works.

Thanks much!


igor.vaynberg wrote:
> 
> you are not tying your checkbox's model to the form's model object so it
> saves into its own model..
> 
> as you can see here:
> IModel checkedModel = new Model(customer.isOptedForNewsletter());
> form.add(new CheckBox("optedForNewsletter", checkedModel));
> you are giving it its own model...
> 
> so in your onsubmit you have to call checkbox.getmodelobject() to retrieve
> the value, or give it a model that is properly tied to the form's model
> object via a propertymodel or something else
> 
> -igor
> 
> 
> On 10/3/07, V. Jenks <[EMAIL PROTECTED]> wrote:
>>
>>
>> NOTE: I'm stuck at Wicket 1.2.4 and cannot upgrade yet.
>>
>> I've got a very simple form with an input class that looks like this:
>>
>> 
>> public class PaymentInfoInput implements Serializable
>> {
>> private Boolean optedForNewsletter;
>>
>> .
>>
>> public Boolean isOptedForNewsletter()
>> {
>> return this.optedForNewsletter;
>> }
>>
>> public void setOptedForNewsletter(Boolean optedForNewsletter)
>> {
>> this.optedForNewsletter = optedForNewsletter;
>> }
>> }
>> 
>>
>> When the page loads I load a boolean value into my CheckBox from an
>> entity,
>> like so:
>>
>> 
>> //model for checkbox value
>> IModel checkedModel = new Model(
>> customer.isOptedForNewsletter());
>>
>> //newsletter opt-in checkbox
>> form.add(new CheckBox("optedForNewsletter",
>> checkedModel));
>> 
>>
>> ...I've walked through this portion in the debugger, it loads the correct
>> value.
>>
>> Now, when I submit the form, regardless of whether or not the CheckBox is
>> checked, the value is null:
>>
>> 
>> //create form
>> final Form form = new Form("paymentInfoForm", new
>> CompoundPropertyModel(new PaymentInfoInput()));
>>
>> ...
>>
>> //submit button
>> form.add(new Button("completeOrderButton")
>> {
>> public void onSubmit()
>> {
>> try
>> {
>> //get form input
>> PaymentInfoInput input =
>> (PaymentInfoInput)form.getModelObject();
>> Boolean opted =
>> input.isOptedForNewsletter(); //WHY IS THIS NULL?
>> }
>> catch (Exception exp)
>> {
>> LogProxy.saveEntry(exp);
>> }
>> }
>> });
>>
>> ...in the HTML:
>>
>> 
>> 
>>
>> ...what's up with that?  I must be missing something painfully simple.
>>
>> Thanks!
>> --
>> View this message in context:
>> http://www.nabble.com/CheckBox-is-misbehaving...-tf4563018.html#a13022997
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/CheckBox-is-misbehaving...-tf4563018.html#a13025669
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: CheckBox is misbehaving...

2007-10-03 Thread V. Jenks

I apologize if this is a dumb question but can anyone offer any advice?  A
work-around would be fine, if necessary.  I'm unable to figure this thing
out.  It's the last issue before I can put my app into production today.

Thanks!


V. Jenks wrote:
> 
> NOTE: I'm stuck at Wicket 1.2.4 and cannot upgrade yet.
> 
> I've got a very simple form with an input class that looks like this:
> 
> 
> public class PaymentInfoInput implements Serializable
> {
>   private Boolean optedForNewsletter;
> 
> .
> 
>   public Boolean isOptedForNewsletter()
>   {
>   return this.optedForNewsletter;
>   }
>   
>   public void setOptedForNewsletter(Boolean optedForNewsletter)
>   {
>   this.optedForNewsletter = optedForNewsletter;
>   }
> }
> 
> 
> When the page loads I load a boolean value into my CheckBox from an
> entity, like so:
> 
> 
>   //model for checkbox value
>   IModel checkedModel = new 
> Model(customer.isOptedForNewsletter());
>   
>   //newsletter opt-in checkbox
>   form.add(new CheckBox("optedForNewsletter", checkedModel));
> 
> 
> ...I've walked through this portion in the debugger, it loads the correct
> value.
> 
> Now, when I submit the form, regardless of whether or not the CheckBox is
> checked, the value is null:
> 
> 
>   //create form   
>   final Form form = new Form("paymentInfoForm", new
> CompoundPropertyModel(new PaymentInfoInput()));
> 
> ...
> 
>   //submit button
>   form.add(new Button("completeOrderButton")
>   {
>   public void onSubmit()
>   {
>   try
>   {
>   //get form input
>   PaymentInfoInput input = 
> (PaymentInfoInput)form.getModelObject();
> Boolean opted =
> input.isOptedForNewsletter(); //WHY IS THIS NULL?
>   }
>   catch (Exception exp)
>   {
>   LogProxy.saveEntry(exp);
>   }
>   }
>   });
> 
> ...in the HTML:
> 
> 
> 
> 
> ...what's up with that?  I must be missing something painfully simple.
> 
> Thanks!
> 

-- 
View this message in context: 
http://www.nabble.com/CheckBox-is-misbehaving...-tf4563018.html#a13025097
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



CheckBox is misbehaving...

2007-10-03 Thread V. Jenks

NOTE: I'm stuck at Wicket 1.2.4 and cannot upgrade yet.

I've got a very simple form with an input class that looks like this:


public class PaymentInfoInput implements Serializable
{
private Boolean optedForNewsletter;

.

public Boolean isOptedForNewsletter()
{
return this.optedForNewsletter;
}

public void setOptedForNewsletter(Boolean optedForNewsletter)
{
this.optedForNewsletter = optedForNewsletter;
}
}


When the page loads I load a boolean value into my CheckBox from an entity,
like so:


//model for checkbox value
IModel checkedModel = new 
Model(customer.isOptedForNewsletter());

//newsletter opt-in checkbox
form.add(new CheckBox("optedForNewsletter", checkedModel));


...I've walked through this portion in the debugger, it loads the correct
value.

Now, when I submit the form, regardless of whether or not the CheckBox is
checked, the value is null:


//create form   
final Form form = new Form("paymentInfoForm", new
CompoundPropertyModel(new PaymentInfoInput()));

...

//submit button
form.add(new Button("completeOrderButton")
{
public void onSubmit()
{
try
{
//get form input
PaymentInfoInput input = 
(PaymentInfoInput)form.getModelObject();
Boolean opted =
input.isOptedForNewsletter(); //WHY IS THIS NULL?
}
catch (Exception exp)
{
LogProxy.saveEntry(exp);
}
}
});

...in the HTML:




...what's up with that?  I must be missing something painfully simple.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/CheckBox-is-misbehaving...-tf4563018.html#a13022997
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Displaying images remotely - HTML email

2007-09-28 Thread V. Jenks

Correct, I had to actually go back and scan through the class since it's been
a year since I've even looked at it!

ImageResource derives from DynamicWebResource.  So, in the
getResourceState() method I hard-coded a line that tests for a specific path
(i.e. "C:\\MyApp\\assets\\images") - if it does not contain it I feed an
alternate image into it that says "Resource could not be found...etc.".

Hopefully this ensures that as long as there are nothing but images in the
path being tested for, there should be no risk of someone discovering other
resources outside of that path, correct?

Does this seem safe enough?

Thanks again, very helpful!!


Eelco Hillenius wrote:
> 
>> I don't see how I'd be able to do that sort of path?  I need to provide
>> the
>> full path for the reference to be found, since it's an external resource.
>> Obviously, I get a NullPointerException if I just type in what you show
>> in
>> your example.
> 
> You have imageResource registered as a shared resource, right? Unless
> I'm missing something, that class is something you or your collegues
> created yourselves, and it reads the "file" parameter to determine
> what needs to be served. All I'm proposing is to prepend whatever that
> file parameter returns with your base directory (just C:\ here).
> 
>> I must be missing something.  Either way, this could be a huge security
>> problem as I store other "assets" in these folders that definitely do
>> *not*
>> want users discovering or gaining access to.
> 
> Have that imageResource implementation check that the resource may be
> accessed. Deny by default. You're potentially opening up your whole
> server if you don't so be very careful with this.
> 
> Eelco
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Displaying-images-remotely---HTML-email-tf4535313.html#a12949524
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Displaying images remotely - HTML email

2007-09-28 Thread V. Jenks

I don't see how I'd be able to do that sort of path?  I need to provide the
full path for the reference to be found, since it's an external resource. 
Obviously, I get a NullPointerException if I just type in what you show in
your example.

I must be missing something.  Either way, this could be a huge security
problem as I store other "assets" in these folders that definitely do *not*
want users discovering or gaining access to.

Thanks again...


Eelco Hillenius wrote:
> 
>> By reusing the same code that I have been using to serve images inside of
>> the application, I can use to get a reference to the images w/ a full
>> URL,
>> like so:
>>
>> http://myurl/MyApp/home/resources/wicket.Application/imageResource?file=C:\\assets\\newsletter\\my_photo.jpg
>>
>> ...which I was able to discover because of this line in my init() in my
>> app
>> class:
>>
>> getSharedResources().add("imageResource", new ImageResource());
>>
>> Eelco's post got me thinking of that and it works.  Any reason I
>> shouldn't
>> do it this way?
> 
> No, that's pretty much what I meant. The only thing still is that you
> might want to use logical paths (e.g. relative to a root dir) so that
> you'll have
> 
> http://myurl/MyApp/home/resources/wicket.Application/imageResource?file=assets/newsletter/my_photo.jpg
> instead of exposing where on your server those images are exactly
> located.
> 
> Eelco
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Displaying-images-remotely---HTML-email-tf4535313.html#a12946158
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Displaying images remotely - HTML email

2007-09-28 Thread V. Jenks

Yes, sorry, I figured it out and I didn't need a servlet.

By reusing the same code that I have been using to serve images inside of
the application, I can use to get a reference to the images w/ a full URL,
like so:

http://myurl/MyApp/home/resources/wicket.Application/imageResource?file=C:\\assets\\newsletter\\my_photo.jpg

...which I was able to discover because of this line in my init() in my app
class:

getSharedResources().add("imageResource", new ImageResource());

Eelco's post got me thinking of that and it works.  Any reason I shouldn't
do it this way?

Thanks all, sorry for the ramble on such a simple thing...I don't get to use
Wicket much anymore...I'm a little rusty.


igor.vaynberg wrote:
> 
> wow, such a long thread for something so trivial
> 
> just create a servlet that streams files from some place on the harddrive,
> then have your designers upload images there. done and done.
> 
> -igor
> 
> 
> On 9/28/07, V. Jenks <[EMAIL PROTECTED]> wrote:
>>
>>
>> No, this is not the case.  I specifically need these images to be
>> *outside*
>> of the packaged .ear application because I need our designers to have
>> access
>> to them.  Wicket access these resources and actually sends the contents
>> of
>> the html template.
>>
>> I am also stuck at Wicket 1.2.4 because upgrading has thrown a bunch of
>> errors and I just do not have time to figure out the differences in the
>> later releases, this app has to be done today and I'm on the very last
>> feature, which is getting remote images to resolve through an HTML email,
>> which do not reside in the .ear (and therefore do not have their own
>> hard-coded, publicly-available URL).
>>
>> I can send the email, I'm just at the point where I need how to figure
>> out
>> how to get the non-packaged image resources to show up to customers who
>> receive it.
>>
>>
>> Craig Tataryn wrote:
>> >
>> > If I'm understanding this correctly you simply want a set of images
>> > available on the same server that your wicket app is on.  Just make an
>> > "images" folder at the same level as WEB-INF (that is, a sibling of).
>> >
>> > If you are using wicket 1.2.x, you would have mounted your wicket app
>> > to some path under your context: for instance /app.  A link to a
>> > wicket page mounted to /home would look like this:
>> >
>> > http://yourserver.com/yourcontext/app/home
>> >
>> > A link to an image would look like this:
>> > http://yourserver.com/yourcontext/images/myimage.jpg
>> >
>> > On Wicket 1.3, you use a filter instead, and the filter is smart
>> > enough to know what content to handle so technically you don't need
>> > the extra /app path you can reference your application and static
>> > images like so:
>> >
>> > http://yourserver.com/yourcontext/home
>> >
>> > http://yourserver.com/yourcontext/images/myimage.jpg (it's the same as
>> > before)
>> >
>> > Again, not sure if that's what you are asking, but hopefully it is!
>> >
>> > Craig.
>> >
>> > On 9/28/07, V. Jenks <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Basically, yes.  I wasn't sure if there was a Wicket solution to this
>> >> problem
>> >> or not.  I wasn't sure if there was a way to make a hard-coded
>> reference
>> >> to
>> >> a resource outside of the webroot, for the purposes of doing what I
>> >> explained.
>> >>
>> >>
>> >> Eelco Hillenius wrote:
>> >> >
>> >> >> Interesting...  This might work, however I don't understand what
>> the
>> >> >> class
>> >> >> would be?  Would it be the Application class?  The images reside in
>> >> >> C:\AppName\images, which is obviously outside of the app.
>> >> >
>> >> > Oh, ok, I didn't understand what you meant. So you don't want to
>> just
>> >> > put these images in a path than can be served by a web server?
>> >> >
>> >> > Eelco
>> >> >
>> >> >
>> -
>> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >
>> >> >
>> >> >
>> >>
>> >> --
>> >> View thi

Re: Displaying images remotely - HTML email

2007-09-28 Thread V. Jenks

I've tried searching "FileResourceStream" and "shared resource" but there
isn't anything helpful...or even relevant, so far as I can tell.

Is there a wiki article by any chance?  Anything that might help?  I'm not
sure what this servlet would do or how to implement this.


Eelco Hillenius wrote:
> 
>> Basically, yes.  I wasn't sure if there was a Wicket solution to this
>> problem
>> or not.  I wasn't sure if there was a way to make a hard-coded reference
>> to
>> a resource outside of the webroot, for the purposes of doing what I
>> explained.
> 
> What you can do is create a shared resource and let it resolve to your
> files using e.g. FileResourceStream. Or even create a simple Servlet.
> We've had discussions on this a few times on the list so maybe you can
> try to find a solution in the archives.
> 
> Eelco
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Displaying-images-remotely---HTML-email-tf4535313.html#a12945343
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Displaying images remotely - HTML email

2007-09-28 Thread V. Jenks

No, this is not the case.  I specifically need these images to be *outside*
of the packaged .ear application because I need our designers to have access
to them.  Wicket access these resources and actually sends the contents of
the html template.

I am also stuck at Wicket 1.2.4 because upgrading has thrown a bunch of
errors and I just do not have time to figure out the differences in the
later releases, this app has to be done today and I'm on the very last
feature, which is getting remote images to resolve through an HTML email,
which do not reside in the .ear (and therefore do not have their own
hard-coded, publicly-available URL).

I can send the email, I'm just at the point where I need how to figure out
how to get the non-packaged image resources to show up to customers who
receive it.


Craig Tataryn wrote:
> 
> If I'm understanding this correctly you simply want a set of images
> available on the same server that your wicket app is on.  Just make an
> "images" folder at the same level as WEB-INF (that is, a sibling of).
> 
> If you are using wicket 1.2.x, you would have mounted your wicket app
> to some path under your context: for instance /app.  A link to a
> wicket page mounted to /home would look like this:
> 
> http://yourserver.com/yourcontext/app/home
> 
> A link to an image would look like this:
> http://yourserver.com/yourcontext/images/myimage.jpg
> 
> On Wicket 1.3, you use a filter instead, and the filter is smart
> enough to know what content to handle so technically you don't need
> the extra /app path you can reference your application and static
> images like so:
> 
> http://yourserver.com/yourcontext/home
> 
> http://yourserver.com/yourcontext/images/myimage.jpg (it's the same as
> before)
> 
> Again, not sure if that's what you are asking, but hopefully it is!
> 
> Craig.
> 
> On 9/28/07, V. Jenks <[EMAIL PROTECTED]> wrote:
>>
>> Basically, yes.  I wasn't sure if there was a Wicket solution to this
>> problem
>> or not.  I wasn't sure if there was a way to make a hard-coded reference
>> to
>> a resource outside of the webroot, for the purposes of doing what I
>> explained.
>>
>>
>> Eelco Hillenius wrote:
>> >
>> >> Interesting...  This might work, however I don't understand what the
>> >> class
>> >> would be?  Would it be the Application class?  The images reside in
>> >> C:\AppName\images, which is obviously outside of the app.
>> >
>> > Oh, ok, I didn't understand what you meant. So you don't want to just
>> > put these images in a path than can be served by a web server?
>> >
>> > Eelco
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Displaying-images-remotely---HTML-email-tf4535313.html#a12944856
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Displaying-images-remotely---HTML-email-tf4535313.html#a12945183
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Displaying images remotely - HTML email

2007-09-28 Thread V. Jenks

Basically, yes.  I wasn't sure if there was a Wicket solution to this problem
or not.  I wasn't sure if there was a way to make a hard-coded reference to
a resource outside of the webroot, for the purposes of doing what I
explained.


Eelco Hillenius wrote:
> 
>> Interesting...  This might work, however I don't understand what the
>> class
>> would be?  Would it be the Application class?  The images reside in
>> C:\AppName\images, which is obviously outside of the app.
> 
> Oh, ok, I didn't understand what you meant. So you don't want to just
> put these images in a path than can be served by a web server?
> 
> Eelco
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Displaying-images-remotely---HTML-email-tf4535313.html#a12944856
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Display HTML markup inside of Label

2007-09-28 Thread V. Jenks

THAT'S it, thank you...


igor.vaynberg wrote:
> 
> label.setescapemodelstrings(false)
> 
> -igor
> 
> On 9/28/07, V. Jenks <[EMAIL PROTECTED]> wrote:
>>
>>
>> Seems like a simple question and I thought I had done this before...but I
>> simply need to display HTML *as* html, on a page, using a Label.
>> --
>> View this message in context:
>> http://www.nabble.com/Display-HTML-markup-inside-of-Label-tf4535575.html#a12944119
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Display-HTML-markup-inside-of-Label-tf4535575.html#a12944821
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Display HTML markup inside of Label

2007-09-28 Thread V. Jenks

Seems like a simple question and I thought I had done this before...but I
simply need to display HTML *as* html, on a page, using a Label.
-- 
View this message in context: 
http://www.nabble.com/Display-HTML-markup-inside-of-Label-tf4535575.html#a12944119
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Displaying images remotely - HTML email

2007-09-28 Thread V. Jenks



Eelco Hillenius wrote:
> 
> Not sure if it is the answer you are looking for, but paths to shared
> resources (which packaged resources such as images are) are
> predictable. Basically:
> 
> http://your.com/yourapp/resources/com.your.another.package.SomeClass/your_image_next_to_your_class.gif
> 
> So there is /resources/ which is a reserved path for shared resources
> in Wicket. Then there is the name of the class you want to use to
> relatively reference your resource, and then there is the resource
> relative to that class. And that can be in a subdir, but you can't use
> '..' etc.
> 
> Eelco
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

Interesting...  This might work, however I don't understand what the class
would be?  Would it be the Application class?  The images reside in
C:\AppName\images, which is obviously outside of the app.

I suppose I don't quite understand how that would work?

-- 
View this message in context: 
http://www.nabble.com/Displaying-images-remotely---HTML-email-tf4535313.html#a12943828
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Displaying images remotely - HTML email

2007-09-28 Thread V. Jenks



Sam Hough wrote:
> 
> The other is, as you say, to put the images on a public facing server. Do
> you have some key that you can use to reference the images from within
> editing and for the live server? Maybe have a non-ear webapp for serving
> the images? or serve them out of the database?
> 

This sounds like the way to go.  I could just have them assemble the
newsletter using an HTML editor and before they publish it, they'd have to
upload the images to a directory on one of the web sites, hardcoding that
URL into the email.

Thanks Sam.
-- 
View this message in context: 
http://www.nabble.com/Displaying-images-remotely---HTML-email-tf4535313.html#a12943721
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Displaying images remotely - HTML email

2007-09-28 Thread V. Jenks

I've got a question concerning how I might be able to display remote images
in an HTML email.

In Wicket, I've built a small utility where our designers use a plain html
page to format our email newsletter.  The html template page and images
reside outside of the webroot because my app is deployed as an ear file. 
They have a maintenance page where they define a newsletter.  This page
reads the html file and saves the contents into a field in the Newsletter
table.  The newsletter contents which have been saved to the database is
what is sent to customers.

The problem arises when these newsletters are sent to customers.  Since the
images within the newsletter do not reside in the webroot, how would they be
displayed remotely?  After editing, when they preview the newsletter locally
I use the ResourceReference method of displaying the images outside of the
webroot.  Is there a way I can hard-code a remote URL to the images before I
persist it to the db?

What it boils down to is; I'm not familiar w/ HTML emails and I'm trying to
figure out how I should proceed so remote images can be displayed once the
email is sent to a customer.  

The answer may be obvious but I'm out of ideas at this point.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Displaying-images-remotely---HTML-email-tf4535313.html#a12943139
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: BookmarkablePage URL

2007-09-11 Thread V. Jenks

Can anyone help out w/ this?  I'm stumped.  The images are somehow being
passes as parameters?  It isn't all of the images on the page because some
of them show up...and they're all in the same folder.  This makes no sense
to me.

I could wrap this thing up and put it away (thanks to everyone's help here)
- if I could get past this issue.

Thanks again!


V. Jenks wrote:
> 
> Thanks guys, this has all been really helpful.
> 
> I'm having some bizarre results, even though the page is loading now. 
> Some of the images aren't loading and I'm getting exceptions that appear
> to tell me that the images are being passed as the parameter values, as
> well?
> 
> I mounted the url like so (in app's init() method):
> 
> mountBookmarkablePage("/category", CatalogCategory.class);
> 
> And I called up the url, w/ parameter, like so:
> 
> http://localhost:8080/MyApp/products/category/catid/1
> 
> I see the data I should be seeing, save for a few of the images not
> loading.
> 
> Here's my stack trace:
> 
> 
> 12:54:41,893 ERROR [RequestCycle] Can't instantiate page using constructor
> public com.myapp.CatalogCategory(wicket.PageParameters) and argument
> images = "background.jpg" catid = "assets"
> wicket.WicketRuntimeException: Can't instantiate page using constructor
> public com.myapp.CatalogCategory(wicket.PageParameters) and argument
> images = "background.jpg" catid = "assets"
>   at 
> wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:175)
>   at wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:96)
>   at
> wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:271)
>   at
> wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:286)
>   at
> wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:205)
>   at
> wicket.request.compound.DefaultEventProcessorStrategy.processEvents(DefaultEventProcessorStrategy.java:65)
>   at
> wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents(AbstractCompoundRequestCycleProcessor.java:57)
>   at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:896)
>   at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929)
>   at wicket.RequestCycle.step(RequestCycle.java:1010)
>   at wicket.RequestCycle.steps(RequestCycle.java:1084)
>   at wicket.RequestCycle.request(RequestCycle.java:454)
>   at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>   at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>   at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>   at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>   at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>   at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>   at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>   at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>   at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
>   at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
>   at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>   at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>   at
> org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
>   at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>   at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>   at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>   at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>   at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>   at
> org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
>

Re: BookmarkablePage URL

2007-09-10 Thread V. Jenks

TEST - I tried to reply to this again, about an hour ago...but the message
still hasn't appeared.  Should I just post it again?


V. Jenks wrote:
> 
> I'm sure this has been asked 1000x but I'm unable to find the answer...and
> don't have enough time left to keep digging.
> 
> I simply want to call a bookmarkable page and pass it a parameter value...
> 
> I got this far but my guesses have so far been wrong:
> 
> ?wicket:bookmarkablePage=:com.myapp.BookmarkedPage&catid=1
> 
> I get this error:
> 
> "ERROR [RequestCycle] Can't instantiate page using constructor public
> com.myapp.BookmarkedPage(wicket.PageParameters) and argument catid = "1""
> 
> It seems strange that I'm unable to quickly find an example of the URL
> format.  I've been away from Wicket for a few months and when I tried to
> use 1.2.6, I had a bunch of failures on code that currently works in
> 1.2.4, so I've stuck w/ that until I have time to figure out what's
> changed.
> 
> Thanks!
> 

-- 
View this message in context: 
http://www.nabble.com/BookmarkablePage-URL-tf4362196.html#a12604056
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: BookmarkablePage URL

2007-09-10 Thread V. Jenks
a.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.valueOf(Integer.java:553)
at com.myapp.CatalogCategory.(CatalogCategory.java:31)
... 38 more



V. Jenks wrote:
> 
> I'm sure this has been asked 1000x but I'm unable to find the answer...and
> don't have enough time left to keep digging.
> 
> I simply want to call a bookmarkable page and pass it a parameter value...
> 
> I got this far but my guesses have so far been wrong:
> 
> ?wicket:bookmarkablePage=:com.myapp.BookmarkedPage&catid=1
> 
> I get this error:
> 
> "ERROR [RequestCycle] Can't instantiate page using constructor public
> com.myapp.BookmarkedPage(wicket.PageParameters) and argument catid = "1""
> 
> It seems strange that I'm unable to quickly find an example of the URL
> format.  I've been away from Wicket for a few months and when I tried to
> use 1.2.6, I had a bunch of failures on code that currently works in
> 1.2.4, so I've stuck w/ that until I have time to figure out what's
> changed.
> 
> Thanks!
> 

-- 
View this message in context: 
http://www.nabble.com/BookmarkablePage-URL-tf4362196.html#a12602107
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: BookmarkablePage URL

2007-09-10 Thread V. Jenks

Where is this mounting done?  What about parameter values?

What I've got is really quite simple.  I have a static HTML page on an old
web site that needs to link to a wicket page.  The wicket page pulls up a
list of products based on the category provided in the querystring parameter
in the URL.

?catid=1
?catid=2
etc

It seems like a simple problem but I can't find a good example...


Matej Knopp-2 wrote:
> 
> it's simple :)
> 
> application.mountBookmarkablePage("/home/page", HomePage.class);
> 
> and the url can look like
> http://server.com/context/home/page/cat/4
> 
> -Matej
> 
> On 8/31/07, V. Jenks <[EMAIL PROTECTED]> wrote:
>>
>>
>> I guess I'm completely confused.  I'm pretty sure I've done it this way
>> before and it worked fine...but it's been a while.  I've never mounted a
>> URL
>> before, I'm not familiar w/ it.
>>
>> I've been going through the Reference Library on the wiki and I can't
>> find
>> an example of how to do this and what the URL actually looks like...can
>> you
>> maybe point me to some instructions?
>>
>> Thanks!
>>
>>
>> Eelco Hillenius wrote:
>> >
>> > On 8/31/07, V. Jenks <[EMAIL PROTECTED]> wrote:
>> >>
>> >> I'm sure this has been asked 1000x but I'm unable to find the
>> >> answer...and
>> >> don't have enough time left to keep digging.
>> >>
>> >> I simply want to call a bookmarkable page and pass it a parameter
>> >> value...
>> >>
>> >> I got this far but my guesses have so far been wrong:
>> >>
>> >> ?wicket:bookmarkablePage=:com.myapp.BookmarkedPage&catid=1
>> >>
>> >> I get this error:
>> >>
>> >> "ERROR [RequestCycle] Can't instantiate page using constructor public
>> >> com.myapp.BookmarkedPage(wicket.PageParameters) and argument catid =
>> "1""
>> >
>> > That looks like there is a problem constructing your page, not so much
>> > the format. Could you look further in your stack trace? Does
>> > BookmarkedPage has a public default constructor or one with just a
>> > page parameters argument?
>> >
>> > Btw, if you mount your pages (per package or individually), it is a
>> > bit easier to test.
>> >
>> > Eelco
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/BookmarkablePage-URL-tf4362196.html#a12434374
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/BookmarkablePage-URL-tf4362196.html#a12598227
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: BookmarkablePage URL

2007-08-31 Thread V. Jenks

I guess I'm completely confused.  I'm pretty sure I've done it this way
before and it worked fine...but it's been a while.  I've never mounted a URL
before, I'm not familiar w/ it.

I've been going through the Reference Library on the wiki and I can't find
an example of how to do this and what the URL actually looks like...can you
maybe point me to some instructions?

Thanks!


Eelco Hillenius wrote:
> 
> On 8/31/07, V. Jenks <[EMAIL PROTECTED]> wrote:
>>
>> I'm sure this has been asked 1000x but I'm unable to find the
>> answer...and
>> don't have enough time left to keep digging.
>>
>> I simply want to call a bookmarkable page and pass it a parameter
>> value...
>>
>> I got this far but my guesses have so far been wrong:
>>
>> ?wicket:bookmarkablePage=:com.myapp.BookmarkedPage&catid=1
>>
>> I get this error:
>>
>> "ERROR [RequestCycle] Can't instantiate page using constructor public
>> com.myapp.BookmarkedPage(wicket.PageParameters) and argument catid = "1""
> 
> That looks like there is a problem constructing your page, not so much
> the format. Could you look further in your stack trace? Does
> BookmarkedPage has a public default constructor or one with just a
> page parameters argument?
> 
> Btw, if you mount your pages (per package or individually), it is a
> bit easier to test.
> 
> Eelco
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/BookmarkablePage-URL-tf4362196.html#a12434374
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



BookmarkablePage URL

2007-08-31 Thread V. Jenks

I'm sure this has been asked 1000x but I'm unable to find the answer...and
don't have enough time left to keep digging.

I simply want to call a bookmarkable page and pass it a parameter value...

I got this far but my guesses have so far been wrong:

?wicket:bookmarkablePage=:com.myapp.BookmarkedPage&catid=1

I get this error:

"ERROR [RequestCycle] Can't instantiate page using constructor public
com.myapp.BookmarkedPage(wicket.PageParameters) and argument catid = "1""

It seems strange that I'm unable to quickly find an example of the URL
format.  I've been away from Wicket for a few months and when I tried to use
1.2.6, I had a bunch of failures on code that currently works in 1.2.4, so
I've stuck w/ that until I have time to figure out what's changed.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/BookmarkablePage-URL-tf4362196.html#a12433271
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]