Object in PageParameters

2008-08-21 Thread venky221

How can I pass an object in PageParameters.

I am doing like this

onSubmit(){
 UserVO user = (userVO)getModelObject();
 PageParameters params = new PageParameters();
 params.put(user,user);

 setRedirect(true);
 setResponsePage(ValidateUser.class, params);
}

ValidateUser's constructor:

ValidateUser(PageParameters params){
 UserVO user = (UserVO) params.get(user);
}

 and its throwing InvocationTargetException.

I can use the constructor of ValidateUser to accept UserVO object and
redirect after instantiating but I want to send the object through
PageParameters.

Some pointers please on how can I achieve this and what URLCodingStratergy I
need to use??
-- 
View this message in context: 
http://www.nabble.com/Object-in-PageParameters-tp19096413p19096413.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]



Form validation

2008-08-14 Thread venky221

Hi All,

Can we use any client side validation of forms in wicket.
I searched the archive and at some point Igor said we can't.
Another question is, can we plug-in Commons Validator into wicket instead of
using wicket's validation, if so some pointers please.

Thanks,
Venky
-- 
View this message in context: 
http://www.nabble.com/Form-validation-tp18989354p18989354.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]



mountBookmarkablePage is throwing error when using sitemesh

2008-04-30 Thread venky221

Hi All,

We are using Sitemesh2.2.1 along with wicket1.3.1 in our product.

The sitemesh JSP page contains SCRIPT and LINK tags to include styles and
functions that will determine the header and footer for the wicket pages.

When I use the URL like http://localhost.../helpDetails?topic=xyz where as
helpDetails is the page, it works fine.
But when I try using http://localhost../helpDetails/topic/xyz/, wicket
throws error for all the entries like SCRIPT and LINK tags in the sitemesh
jsp page.

We are using mountBookmarkablePage as the url stratergy.

The error message is as follows

ERROR - RequestCycle.logRuntimeException(1399) | URL fragment has unmatched
key/value pair: subtopic/display_css/style.css
java.lang.IllegalStateException: URL fragment has unmatched key/value pair:
subtopic/display_css/style.css
at
org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy.decodeParameters(AbstractRequestTargetUrlCodingStrategy.java:174)
at
org.apache.wicket.request.target.coding.BookmarkablePageRequestTargetUrlCodingStrategy.decode(BookmarkablePageRequestTargetUrlCodingStrategy.java:76)
at
org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.targetForRequest(WebRequestCodingStrategy.java:475)
at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:175)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1224)



ERROR - RequestCycle.logRuntimeException(1399) | URL fragment has unmatched
key/value pair: subtopic/js/jquery-1.2.3.js
java.lang.IllegalStateException: URL fragment has unmatched key/value pair:
subtopic/js/jquery-1.2.3.js
at
org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy.decodeParameters(AbstractRequestTargetUrlCodingStrategy.java:174)
at
org.apache.wicket.request.target.coding.BookmarkablePageRequestTargetUrlCodingStrategy.decode(BookmarkablePageRequestTargetUrlCodingStrategy.java:76)
at
org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.targetForRequest(WebRequestCodingStrategy.java:475)
at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:175)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1224)


Thanks,
Venkat.
-- 
View this message in context: 
http://www.nabble.com/mountBookmarkablePage-is-throwing-error-when-using-sitemesh-tp16992714p16992714.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]



input type=text tag is adding background-color attribute while rendering

2008-01-03 Thread venky221

Hi,

I am constructing an input text box as
input type=text wicketId=abc STYLE=position:absolute; width:120px;
height:15px;

This markup, I am making available using the getMarkupResourceStream()
method.
Now the problem is, when the content is rendered, the STYLE element will be
appended with background-color: rgb(255, 255, 160) attibute to it(which
fills the text box with yellow).
I am using plain html(no css is used).
Is there any way I can avoid this ??

Thanks,
Venkat
-- 
View this message in context: 
http://www.nabble.com/%3Cinput-type%3Dtext%3E-tag-is-adding-background-color-attribute-while-rendering-tp14610176p14610176.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: How to flush the markup stream in getMarkupResourceStream() method

2007-12-21 Thread venky221

Thanks Igor,

I tired by returning null in getCacheKey() method and is working great.
Even 'Matthijs Wensveen' replied to my mail with the same explanation.

Thanks,
Venkat


igor.vaynberg wrote:
 
 public class DisplayPage extends WebPage implements
 IMarkupResourceStreamProvider, **IMarkupCacheKeyProvider** {...}
 
 -igor
 
 
 On Dec 19, 2007 11:34 PM, Gabor Szokoli [EMAIL PROTECTED] wrote:
 Me Too!

 Well, not exactly, but similar issue:

 We read markup files from the file systems, and consider implementing
 a JMX trigger for reloading them, but what should the triggered method
 actually do?

 (In the mean time I realised the solution to my problem is probably
 different from vekys, but I assume mine resembles flush more, so
 dibs on his subject line! :-) )


 Gabor Szokoli

 On Dec 19, 2007 9:26 PM, venky221 [EMAIL PROTECTED] wrote:
 
  If I restart my tomcat between the two requests, it works fine but I
 can not
  flush the markup content that I was getting from
 getMarkupResourceStream()
  method if I am making the two requests without restarting my server.


 -
 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/How-to-flush-the-markup-stream-in-getMarkupResourceStream%28%29-method-tp14424660p14460441.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]



How to flush the markup stream in getMarkupResourceStream() method

2007-12-19 Thread venky221

Hi,

I am trying to create the markup(generating html) using
IMarkupResourceStreamProvider at runtime.
The scenario is as follows.

I am using a java class called DisplayPage

public class DisplayPage extends WebPage implements
IMarkupResourceStreamProvider{

String HTMLString=;

public DisplayPage () {
String type= getRequest().getParameter(type);
HTMLString = generateHTML(type);
}

 public IResourceStream getMarkupResourceStream(MarkupContainer
container, java.lang.Class

   
containerClass){
return new StringResourceStream(HTMLString);
}

   public String generateHTML(String type){
if(type.equalsIgnoreCase(image)){
  createImage(image1);
  add(new Image(image1));
}else if(type.equalsIgnoreCase(text)){
  createLabel(text1);
 add(new Label(text1));
}
}
}

These methods creaImage() and creteLabel() will construct the html tags for
Image and label with wicket-ids image1 and text1 respectually.

The problem now here is, when I call this class from my browser using the
url
http://localhost:8080/myapp/displaypage?type=image
It displays the image that I am returning in my createImage() method.

If I again call by passing the text parameter using the url
http://localhost:8080/myapp/displaypage?type=text
it gives the error saying that the component with id 'image1' is not found.

If I restart my tomcat between the two requests, it works fine but I can not
flush the markup content that I was getting from getMarkupResourceStream()
method if I am making the two requests without restarting my server.
I tried to debug the content that getMarkupResourceStream() is returning,
but the method will be called only once when the first request is made. The
second time this method will not be called.

Is there any way I can solve this problem.

Thanks,
Venkat


-- 
View this message in context: 
http://www.nabble.com/How-to-flush-the-markup-stream-in-getMarkupResourceStream%28%29-method-tp14424660p14424660.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]



How to call the clear() method on MarkupCache class from my webpage

2007-12-19 Thread venky221

Hi, 
I am trying to clear the markupstream as my markup content will keep
changing but the container remains same. How can I get the handle to this
MarkupCache class to call the clear() method in my webpage.

Thanks,
Venky
-- 
View this message in context: 
http://www.nabble.com/How-to-call-the-clear%28%29-method-on-MarkupCache-class-from-my-webpage-tp14427528p14427528.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: How to create the webpage(html) on the fly

2007-12-05 Thread venky221

Oh ... you mean to say that once we have a html page with certain components
then it is not possible to add new components to that existing page at
runtime.

~Venkat


Eelco Hillenius wrote:
 
 That's an entirely wrong way of doing things. You should view your
 templates like you would view Java files. Once you deploy your
 application, you don't change those. Instead learn how to use panels
 and maybe component replacement.
 
 Eelco
 
 On Dec 4, 2007 4:47 PM, venky221 [EMAIL PROTECTED] wrote:

 Hi,

 I am new to wicket.
 I am working on a small scenario, where in I am trying to change the
 contents of an html page and navigating to that page while the
 application
 is running.

 The code is as follows .
 My first page is Demo.html, in which I am adding a simple link element.

 html
   body
 div  Message goes here /div
 Just testbr
 Test page
   /body
 /html




 In Demo.java, inside the onclick() event of the 'link' I am trying to add
 content to a html file called ShowEnty.html with a component and
 initializing the corresponding ShowEnty.java.

 public class Demo extends WebPage
 {
   File outputFile = new File(C:\\web\\pages\\ShowEntry.html);
   public Demo()
   {
IModel messageModel = new Model(Hello World!);
final String compName = msgInputForm;
Link link = new Link(link) {
public void onClick() {

  ShowEntry showEntry = new ShowEntry(compName);
 try{
 FileWriter out = new FileWriter(outputFile);
 out.append(htmlform wicket:id=+compName+input
 type=\text\
   wicket:id=\messageInput\/input type=\submit\
 value=\update\//form/html);
 out.close();
 }catch(IOException iox){iox.printStackTrace();}
 setResponsePage(showEntry);
 }
 };
 add(link);
 Label message = new Label(message, messageModel);
 link.add(message);
 }



 Now the ShowEntry.html looks like the following code with a form, having
 a
 input text field and a submit button (as the contents I was adding from
 the
 onclick() method in the above Demo.java)...

 html
   form wicket:id=msgInputForm
  input type=text wicket:id=messageInput/
  input type=submit value=update/
   /form
 /html



 Similarly the ShowEntry.java is as follows

 public class ShowEntry extends WebPage{

   public ShowEntry(String component) {
 IModel messageModel = new Model(Hello World!);
 add(new MessageForm(component, messageModel));
   }
   private final class MessageForm extends Form
   {
  public MessageForm(String id, IModel model)
 {
 super(id);
 add(new TextField(messageInput, model));
 }

 protected void onSubmit()
 {
  System.out.println(inside submit);
 }

}
 }

 My problem now is, as I was writing the html text into the file, I need
 to
 wait to see the contents or probably restart my tomacat.
 Is there any way that we can write this html content to the in-memory
 file
 to have the immediate effect instead of writing it to a file on the disk.
 --
 View this message in context:
 http://www.nabble.com/How-to-create-the-webpage%28html%29-on-the-fly-tf4946724.html#a14162959
 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/How-to-create-the-webpage%28html%29-on-the-fly-tf4946724.html#a14184557
Sent from the Wicket - User mailing list archive at Nabble.com.


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



How to create the webpage(html) on the fly

2007-12-04 Thread venky221

Hi,

I am new to wicket. 
I am working on a small scenario, where in I am trying to change the
contents of an html page and navigating to that page while the application
is running.

The code is as follows .
My first page is Demo.html, in which I am adding a simple link element.

html
  body
div  Message goes here /div
Just testbr
Test page
  /body
/html




In Demo.java, inside the onclick() event of the 'link' I am trying to add
content to a html file called ShowEnty.html with a component and
initializing the corresponding ShowEnty.java.

public class Demo extends WebPage
{
  File outputFile = new File(C:\\web\\pages\\ShowEntry.html);
  public Demo()
  {
   IModel messageModel = new Model(Hello World!);
   final String compName = msgInputForm;
   Link link = new Link(link) {
   public void onClick() {

 ShowEntry showEntry = new ShowEntry(compName);
try{
FileWriter out = new FileWriter(outputFile);
out.append(htmlform wicket:id=+compName+input type=\text\ 
 
  wicket:id=\messageInput\/input type=\submit\
value=\update\//form/html);
out.close();
}catch(IOException iox){iox.printStackTrace();}
setResponsePage(showEntry);
}
};
add(link);
Label message = new Label(message, messageModel);
link.add(message);
}



Now the ShowEntry.html looks like the following code with a form, having a
input text field and a submit button (as the contents I was adding from the
onclick() method in the above Demo.java)...

html
  form wicket:id=msgInputForm
 input type=text wicket:id=messageInput/
 input type=submit value=update/
  /form
/html



Similarly the ShowEntry.java is as follows

public class ShowEntry extends WebPage{

  public ShowEntry(String component) {
IModel messageModel = new Model(Hello World!);
add(new MessageForm(component, messageModel));
  }
  private final class MessageForm extends Form
  {
 public MessageForm(String id, IModel model)
{
super(id);
add(new TextField(messageInput, model));
}

protected void onSubmit()
{
 System.out.println(inside submit);
}

   }
}

My problem now is, as I was writing the html text into the file, I need to
wait to see the contents or probably restart my tomacat.
Is there any way that we can write this html content to the in-memory file
to have the immediate effect instead of writing it to a file on the disk.
-- 
View this message in context: 
http://www.nabble.com/How-to-create-the-webpage%28html%29-on-the-fly-tf4946724.html#a14162959
Sent from the Wicket - User mailing list archive at Nabble.com.


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



How to create the webpage(html) on the fly

2007-12-04 Thread venky221

Hi,

I am new to wicket. 
I am working on a small scenario, where in I am trying to change the
contents of an html page and navigating to that page while the application
is running.

The code is as follows .
My first page is Demo.html, in which I am adding a simple link element.

html
  body
div 
  
Message goes here
  
/div
Just testbr
Test page
  /body
/html




In Demo.java, inside the onclick() event of the 'link' I am trying to add
content to a html file called ShowEnty.html with a component and
initializing the corresponding ShowEnty.java.

public class Demo extends WebPage
{
  File outputFile = new File(C:\\web\\pages\\ShowEntry.html);
  public Demo()
  {
   IModel messageModel = new Model(Hello World!);
   final String compName = msgInputForm;
   Link link = new Link(link) {
   public void onClick() {

 ShowEntry showEntry = new ShowEntry(compName);
try{
FileWriter out = new FileWriter(outputFile);
out.append(htmlform wicket:id=+compName+input type=\text\ 
 
  wicket:id=\messageInput\/input type=\submit\
value=\update\//form/html);
out.close();
}catch(IOException iox){iox.printStackTrace();}
setResponsePage(showEntry);
}
};
add(link);
Label message = new Label(message, messageModel);
link.add(message);
}



Now the ShowEntry.html looks like the following code with a form, having a
input text field and a submit button (as the contents I was adding from the
onclick() method in the above Demo.java)...

html
  form wicket:id=msgInputForm
 input type=text wicket:id=messageInput/
 input type=submit value=update/
  /form
/html



Similarly the ShowEntry.java is as follows

public class ShowEntry extends WebPage{

  public ShowEntry(String component) {
IModel messageModel = new Model(Hello World!);
add(new MessageForm(component, messageModel));
  }
  private final class MessageForm extends Form
  {
 public MessageForm(String id, IModel model)
{
super(id);
add(new TextField(messageInput, model));
}

protected void onSubmit()
{
 System.out.println(inside submit);
}

   }
}

My problem now is, as I was writing the html text into the file, I need to
wait to see the contents or probably restart my tomacat.
Is there any way that we can write this html content to the in-memory file
to have the immediate effect instead of writing it to a file on the disk.
-- 
View this message in context: 
http://www.nabble.com/How-to-create-the-webpage%28html%29-on-the-fly-tf4946734.html#a14163003
Sent from the Wicket - User mailing list archive at Nabble.com.


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