Re: Usage of Servlets in Wicket, How ?

2009-09-08 Thread FaRHaN


I want to upload files through Commons FIleUpload API. As Commons FileUpload 
API requires HttpServletRequest for uploading files (e.g. fileItemsList = 
servletFileUpload.parseRequest(httpServletRequest)). 
Parsing HttpServletRequest is the necessary step while uploading in Commons 
FileUpload.

I have got httpServletRequest from RequestCycle. e.g. ((ServletWebRequest) 
getRequest()).getHttpServletRequest() or 
((WebRequest)requestCycle.getRequest()).getHttpServletRequest() but this 
request already being parsed automatically in RequestCycle, before reaching 
servletFileUpload.parseRequest(httpServletRequest). So, Request is already 
been parsed... exception occur. 

That's why i want to use Servlet's doGet(request, response) method for getting 
HttpServletRequest(without parsing). 

If not servlets, Is there any other way to handle FileUploading (through Apache 
Commons API) in wicket ?

Thanks...



From: Peter Thomas ptrtho...@gmail.com
To: users@wicket.apache.org
Sent: Tuesday, September 8, 2009 11:39:58 AM
Subject: Re: Usage of Servlets in Wicket, How ?

Refer this:

http://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html

If that doesn't help you should briefly explain what your requirement is.
There may be a better way to achieve it within Wicket instead of hacking
around with servlets.

On Tue, Sep 8, 2009 at 10:57 AM, FaRHaN farhan.ba...@ymail.com wrote:

 but how can we call it from our wicket web page ?




 
 From: Jeremy Thomerson jer...@wickettraining.com
 To: users@wicket.apache.org
 Sent: Tuesday, September 8, 2009 11:10:49 AM
 Subject: Re: Usage of Servlets in Wicket, How ?

 servlets are totally separate from Wicket - write a servlet and add it to
 your web.xml.  See any servlet example on the web (non-Wicket related) for
 assistance.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Mon, Sep 7, 2009 at 11:54 PM, FaRHaN farhan.ba...@ymail.com wrote:

  Hi,
 
  Is there any example in Wicket that uses Servlets (doGet()  doPost()). I
  mean how can we configure Servlets in our wicket application and use
  doGet(request, response)  doPost(request, response) methods. I know
 web.xml
  configuration for Servlets but how can we use doGet()  doPost() methods.
 Do
  we need wicket:ids in Servlets ?
  Is there any reference for such type of example ?
 
  Thanks...
 
 
 
 








  

Re: Usage of Servlets in Wicket, How ?

2009-09-08 Thread FaRHaN
I want to make it a separate API for file uploading. So that i can embed it in 
any of the application regardless of the framework (wicket, JSF, struts etc.). 
The only reason is that, we can use Apache Commons FileUpload API in any of the 
framework. 
Is there any workaround to do this ?





From: Jeremy Thomerson jer...@wickettraining.com
To: users@wicket.apache.org
Sent: Tuesday, September 8, 2009 12:44:08 PM
Subject: Re: Usage of Servlets in Wicket, How ?

Maybe if you mention the specific reason(s) that you want to use Apache
Commons FileUpload API rather than Wicket's built-in forms and file upload
mechanisms, someone on the list will be able to provide you with more help.
It seems that the FileUpload API is intended to help you if you have to
write servlets to handle forms.  But with Wicket, you don't have to do
this.  And if you use ACFU API, then you lose the rest of Wicket's stateful
form handling.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Sep 8, 2009 at 1:04 AM, FaRHaN farhan.ba...@ymail.com wrote:



 I want to upload files through Commons FIleUpload API. As Commons
 FileUpload API requires HttpServletRequest for uploading files (e.g.
 fileItemsList = servletFileUpload.parseRequest(httpServletRequest)).
 Parsing HttpServletRequest is the necessary step while uploading in Commons
 FileUpload.

 I have got httpServletRequest from RequestCycle. e.g. ((ServletWebRequest)
 getRequest()).getHttpServletRequest() or
 ((WebRequest)requestCycle.getRequest()).getHttpServletRequest() but this
 request already being parsed automatically in RequestCycle, before reaching
 servletFileUpload.parseRequest(httpServletRequest). So, Request is already
 been parsed... exception occur.

 That's why i want to use Servlet's doGet(request, response) method for
 getting HttpServletRequest(without parsing).

 If not servlets, Is there any other way to handle FileUploading (through
 Apache Commons API) in wicket ?

 Thanks...


 
 From: Peter Thomas ptrtho...@gmail.com
 To: users@wicket.apache.org
 Sent: Tuesday, September 8, 2009 11:39:58 AM
 Subject: Re: Usage of Servlets in Wicket, How ?

 Refer this:


 http://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html

 If that doesn't help you should briefly explain what your requirement is.
 There may be a better way to achieve it within Wicket instead of hacking
 around with servlets.

 On Tue, Sep 8, 2009 at 10:57 AM, FaRHaN farhan.ba...@ymail.com wrote:

  but how can we call it from our wicket web page ?
 
 
 
 
  
  From: Jeremy Thomerson jer...@wickettraining.com
  To: users@wicket.apache.org
  Sent: Tuesday, September 8, 2009 11:10:49 AM
  Subject: Re: Usage of Servlets in Wicket, How ?
 
  servlets are totally separate from Wicket - write a servlet and add it to
  your web.xml.  See any servlet example on the web (non-Wicket related)
 for
  assistance.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Mon, Sep 7, 2009 at 11:54 PM, FaRHaN farhan.ba...@ymail.com wrote:
 
   Hi,
  
   Is there any example in Wicket that uses Servlets (doGet()  doPost()).
 I
   mean how can we configure Servlets in our wicket application and use
   doGet(request, response)  doPost(request, response) methods. I know
  web.xml
   configuration for Servlets but how can we use doGet()  doPost()
 methods.
  Do
   we need wicket:ids in Servlets ?
   Is there any reference for such type of example ?
  
   Thanks...
  
  
  
  
 
 
 
 
 








  

Re: Usage of Servlets in Wicket, How ?

2009-09-08 Thread FaRHaN
O my dear, i want to make a separate utility method that will take Request and 
other necessary information as a parameter. just like that:

/** Utitlity Method for FileUploading /
public static void doUpload(HttpServletRequest request, FileItem fileItem){
if (ServletFileUpload.isMultipartContent(request)){
ServletFileUpload servletFileUpload = new ServletFileUpload(new 
DiskFileItemFactory());   

List fileItemsList = null;
try {
fileItemsList = servletFileUpload.parseRequest(request);

} catch (FileUploadException ex) {
System.out.println( Exception while Parsing File Upload 
Request + ex);
}

String optionalFileName = ;
Iterator it = fileItemsList.iterator();
while (it.hasNext()){
fileItem = (FileItem)it.next();
if (fileItem.isFormField()){
String fieldName = fileItem.getFieldName();
String fieldValue = fileItem.getString();
if (fileItem.getFieldName().equals(filename))
optionalFileName = fileItem.getString();
...
}
}
}
}
/* End */

And from Wicket Page, call this method when File uploading is required.
public void onSubmit(){
doUpload(httpServletRequest, fileItem);
}

This can happen or not ?
The Problem arises while Parsing request ...






From: Peter Thomas ptrtho...@gmail.com
To: users@wicket.apache.org
Sent: Tuesday, September 8, 2009 1:13:22 PM
Subject: Re: Usage of Servlets in Wicket, How ?

On Tue, Sep 8, 2009 at 12:33 PM, FaRHaN farhan.ba...@ymail.com wrote:

 I want to make it a separate API for file uploading. So that i can embed it
 in any of the application regardless of the framework (wicket, JSF, struts
 etc.). The only reason is that, we can use Apache Commons FileUpload API in
 any of the framework.
 Is there any workaround to do this ?



This is very interesting.  When you say embed it in any of the application
regardless of the framework what do you mean ?  A tag library ?  Suppose
you have a multipart form, that contains input fields PLUS a type=file
field, to what URL will you POST it and have the input data also bound /
handled ?

Note that Wicket already has FileUpload built in, that too as a pure Java
API so I'm trying to understand your end-goal better.




 
 From: Jeremy Thomerson jer...@wickettraining.com
 To: users@wicket.apache.org
 Sent: Tuesday, September 8, 2009 12:44:08 PM
 Subject: Re: Usage of Servlets in Wicket, How ?

 Maybe if you mention the specific reason(s) that you want to use Apache
 Commons FileUpload API rather than Wicket's built-in forms and file upload
 mechanisms, someone on the list will be able to provide you with more help.
 It seems that the FileUpload API is intended to help you if you have to
 write servlets to handle forms.  But with Wicket, you don't have to do
 this.  And if you use ACFU API, then you lose the rest of Wicket's stateful
 form handling.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Sep 8, 2009 at 1:04 AM, FaRHaN farhan.ba...@ymail.com wrote:

 
 
  I want to upload files through Commons FIleUpload API. As Commons
  FileUpload API requires HttpServletRequest for uploading files (e.g.
  fileItemsList = servletFileUpload.parseRequest(httpServletRequest)).
  Parsing HttpServletRequest is the necessary step while uploading in
 Commons
  FileUpload.
 
  I have got httpServletRequest from RequestCycle. e.g.
 ((ServletWebRequest)
  getRequest()).getHttpServletRequest() or
  ((WebRequest)requestCycle.getRequest()).getHttpServletRequest() but this
  request already being parsed automatically in RequestCycle, before
 reaching
  servletFileUpload.parseRequest(httpServletRequest). So, Request is
 already
  been parsed... exception occur.
 
  That's why i want to use Servlet's doGet(request, response) method for
  getting HttpServletRequest(without parsing).
 
  If not servlets, Is there any other way to handle FileUploading (through
  Apache Commons API) in wicket ?
 
  Thanks...
 
 
  
  From: Peter Thomas ptrtho...@gmail.com
  To: users@wicket.apache.org
  Sent: Tuesday, September 8, 2009 11:39:58 AM
  Subject: Re: Usage of Servlets in Wicket, How ?
 
  Refer this:
 
 
 
 http://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html
 
  If that doesn't help you should briefly explain what your requirement is.
  There may be a better way to achieve it within Wicket instead of hacking
  around with servlets.
 
  On Tue, Sep 8, 2009 at 10:57 AM, FaRHaN farhan.ba...@ymail.com wrote:
 
   but how can we call it from our wicket web

Usage of Servlets in Wicket, How ?

2009-09-07 Thread FaRHaN
Hi,

Is there any example in Wicket that uses Servlets (doGet()  doPost()). I mean 
how can we configure Servlets in our wicket application and use doGet(request, 
response)  doPost(request, response) methods. I know web.xml configuration for 
Servlets but how can we use doGet()  doPost() methods. Do we need wicket:ids 
in Servlets ?
Is there any reference for such type of example ?

Thanks...



  

Re: Usage of Servlets in Wicket, How ?

2009-09-07 Thread FaRHaN
but how can we call it from our wicket web page ?





From: Jeremy Thomerson jer...@wickettraining.com
To: users@wicket.apache.org
Sent: Tuesday, September 8, 2009 11:10:49 AM
Subject: Re: Usage of Servlets in Wicket, How ?

servlets are totally separate from Wicket - write a servlet and add it to
your web.xml.  See any servlet example on the web (non-Wicket related) for
assistance.

--
Jeremy Thomerson
http://www.wickettraining.com



On Mon, Sep 7, 2009 at 11:54 PM, FaRHaN farhan.ba...@ymail.com wrote:

 Hi,

 Is there any example in Wicket that uses Servlets (doGet()  doPost()). I
 mean how can we configure Servlets in our wicket application and use
 doGet(request, response)  doPost(request, response) methods. I know web.xml
 configuration for Servlets but how can we use doGet()  doPost() methods. Do
 we need wicket:ids in Servlets ?
 Is there any reference for such type of example ?

 Thanks...







  

Re: How to use Apache Commons FileUpload in Wicket ?

2009-09-03 Thread FaRHaN
How can i view PickWick Examples (with Code), from Pickwick-Wicket Stuff WIKI 
site?






From: Fernando Wermus fernando.wer...@gmail.com
To: users@wicket.apache.org
Sent: Wednesday, September 2, 2009 6:44:14 PM
Subject: Re: How to use Apache Commons FileUpload in Wicket ?

You have pickwick project that has an example exaclty as the way you want

On Wed, Sep 2, 2009 at 4:02 AM, FaRHaN farhan.ba...@ymail.com wrote:

 I want to upload a file using apache commons FileUpload API. As it requires
 HttpServletRequest for uploading files, but in wicket
 IMultipartWebRequest/IMultipartServletWebRequest is required for uploading
 purposes.

 How can I use apache commons FileUpload for uploading in Wicket ? Is there
 any example to do so ?

 Thanks...








-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus



  

Re: How to use Apache Commons FileUpload in Wicket ?

2009-09-03 Thread FaRHaN
Sorry, i want to say how can i use this example to fulfill my uploading 
requirements ? 

As there is only one class (ReceiverServlet.java) for uploading in PickWick. I 
already knows its functionality but my question is that, Apache Commons 
FileUpload requires HttpServletRequest for parsing Request 
(servletFileUpload.parseRequest(httpServletRequest)). I don't have any 
experience of using Servlets in Wicket tha's why i want to know, How can we set 
or get HttpServletRequest in a wicket application, like in doGet()  doPost() 
in Servlets ?
 
Also, IMultipartWebRequest is required for uploading in Wicket. How can i cast 
it to HttpServletRequest, as an Exception occur while casting 
IMultipartWebRequest to HttpServletRequest.

Thanks...






From: FaRHaN farhan.ba...@ymail.com
To: users@wicket.apache.org
Sent: Thursday, September 3, 2009 1:16:19 PM
Subject: Re: How to use Apache Commons FileUpload in Wicket ?

How can i view PickWick Examples (with Code), from Pickwick-Wicket Stuff WIKI 
site?






From: Fernando Wermus fernando.wer...@gmail.com
To: users@wicket.apache.org
Sent: Wednesday, September 2, 2009 6:44:14 PM
Subject: Re: How to use Apache Commons FileUpload in Wicket ?

You have pickwick project that has an example exaclty as the way you want

On Wed, Sep 2, 2009 at 4:02 AM, FaRHaN farhan.ba...@ymail.com wrote:

 I want to upload a file using apache commons FileUpload API. As it requires
 HttpServletRequest for uploading files, but in wicket
 IMultipartWebRequest/IMultipartServletWebRequest is required for uploading
 purposes.

 How can I use apache commons FileUpload for uploading in Wicket ? Is there
 any example to do so ?

 Thanks...








-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


  

How to use Apache Commons FileUpload in Wicket ?

2009-09-02 Thread FaRHaN
I want to upload a file using apache commons FileUpload API. As it requires 
HttpServletRequest for uploading files, but in wicket 
IMultipartWebRequest/IMultipartServletWebRequest is required for uploading 
purposes.

How can I use apache commons FileUpload for uploading in Wicket ? Is there any 
example to do so ?

Thanks...



  

How to get Project Folder's Relative Path ?

2009-08-19 Thread FaRHaN

I want to get relative path of my current wicket project folder. I have used 
System.getProperty(user.dir) method but it returns the path of Tomcat's bin 
directory.  
I want to access files of my project through relative path, so that i can 
access these files on other System also. I have my project in the following 
directory: C:\projects\sampleProject, I have also tried using ServletContext 
but it returns the build directory of my project, i.e. 
WebApplication.get().getServletContext().context.getRealPath(/); // returns 
C:\projects\sampleProject\build\web
WebApplication.get().getServletContext().context.getContextPath(); // returns 
/sampleProject

But i want only the project folder (C:\projects\sampleProject).
Is there a way to get relative path of my proejct ?

Thanks...



  

How to get Relative Path ?

2009-08-19 Thread FaRHaN
Is there a way in wicket, to get relative path of current web project ?

Thanks...



  

Enforcing CSS Styles to be Loaded From Server ?

2009-08-17 Thread FaRHaN
I want to customize themes for my website for each Valid User, for that purpose 
i have a unique StyleSheet for each user. When a user Logs IN, a respective CSS 
file turned ON. The problem exist when a user Logs IN again after modifying 
styles (theme) of his website, the latest CSS file not being applied on the 
Website but preexisting styles for that user applied on the Website. 
When I Logs IN after clearing History (Cache) of the Browser(IE or FireFox), 
the latest styles are being applied. So I believe, problem exist in the Browser 
Cache. I have tried all Cache Headers for that purpose but it didn't work at 
all.
That's why i want to create a Random number in my URL (for HomePage) so that 
request to HomePage after Logging IN will go to Server (enforcing Styles to be 
loaded from Server, not from cache).

Is this a valid approach, and how i can add random number to my URL ?
Is there exist any other solution for clearing Browser's Cache ? 

Thanks...



  

Re: Enforcing CSS Styles to be Loaded From Server ?

2009-08-17 Thread FaRHaN
Thanks Bas...
It really works.





From: bgooren b...@iswd.nl
To: users@wicket.apache.org
Sent: Monday, August 17, 2009 11:27:12 AM
Subject: Re: Enforcing CSS Styles to be Loaded From Server ?


Farhan,

Please take a look at IResourceSettings (accessible from the application
object). More specifically at 

http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/settings/IResourceSettings.html#setAddLastModifiedTimeToResourceReferenceUrl(boolean)
setAddLastModifiedTimeToResourceReferenceUrl(boolean) 

Bas


Farhan Bajwa wrote:
 
 I want to customize themes for my website for each Valid User, for that
 purpose i have a unique StyleSheet for each user. When a user Logs IN, a
 respective CSS file turned ON. The problem exist when a user Logs IN again
 after modifying styles (theme) of his website, the latest CSS file not
 being applied on the Website but preexisting styles for that user applied
 on the Website. 
 When I Logs IN after clearing History (Cache) of the Browser(IE or
 FireFox), the latest styles are being applied. So I believe, problem exist
 in the Browser Cache. I have tried all Cache Headers for that purpose but
 it didn't work at all.
 That's why i want to create a Random number in my URL (for HomePage) so
 that request to HomePage after Logging IN will go to Server (enforcing
 Styles to be loaded from Server, not from cache).
 
 Is this a valid approach, and how i can add random number to my URL ?
 Is there exist any other solution for clearing Browser's Cache ? 
 
 Thanks...
 
 
 
  
 

-- 
View this message in context: 
http://www.nabble.com/Enforcing-CSS-Styles-to-be-Loaded-From-Server---tp25001539p25001595.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

How to add Random number to URL ?

2009-08-13 Thread FaRHaN
Hi,
I want to add a random number to my requested URL, so that each request to my 
page go to server and not load from the cache. How can i add a random number to 
each requested URL ?
Some examples acheiving this behaviour will be appreciated...

Thanks...



  

Re: How to add Random number to URL ?

2009-08-13 Thread FaRHaN
I have used all of the Cache Headers but they didn't work for me. Only 
'Refresh' Meta tag works, but all other Tags (Cache-Control, Expires, etc.) not 
working in IE or FF. I don't know why...
That's why i want to access page from Server rather than stored from the 
browser.

???





From: burnstone burnst...@burnstone.ch
To: users@wicket.apache.org
Sent: Thursday, August 13, 2009 12:46:50 PM
Subject: Re: How to add Random number to URL ?

FaRHaN wrote:
 Hi,
 I want to add a random number to my requested URL, so that each request to my 
 page go to server and not load from the cache. How can i add a random number 
 to each requested URL ?
 Some examples acheiving this behaviour will be appreciated...

Why don't you just adjust your cache headers?

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


  

Re: How to add Random number to URL ?

2009-08-13 Thread FaRHaN
How can i use this for every request ? As i want to generate a unique URL for 
every page (not for images), any examples ???





From: Witold Czaplewski witold-mail...@cts-media.eu
To: users@wicket.apache.org
Sent: Thursday, August 13, 2009 2:58:18 PM
Subject: Re: How to add Random number to URL ?

Take a look at NonCachingImage.

Witold

Am Thu, 13 Aug 2009 00:44:07 -0700 (PDT)
schrieb FaRHaN farhan.ba...@ymail.com:

 Hi,
 I want to add a random number to my requested URL, so that each
 request to my page go to server and not load from the cache. How can
 i add a random number to each requested URL ? Some examples acheiving
 this behaviour will be appreciated...
 
 Thanks...
 
 
 
  

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


  

Re: Save CSS/StyleSheet in Database ?

2009-07-23 Thread FaRHaN
Can you please send me the sample codes of your implementation for Images ?

I also want dynamic images to be displayed on my web page.

Thanks,
Farhan



From: Michael O'Cleirigh michael.ocleir...@rivulet.ca
To: users@wicket.apache.org
Sent: Wednesday, July 22, 2009 8:04:00 PM
Subject: Re: Save CSS/StyleSheet in Database ?

Hi Farhan,

You should create an  IRequestTargetUrlCodingStrategy implementation to 
serve the CSS from the database.

It should work to mount the strategy on something like 
'/custom-user-css' and then user the rest of the path as the options for 
say  the user and version of the css to load.  The version number may be 
needed to get around browser caching of the CSS if changes are made.  
You get look at the other implementations to see how they do this but 
yours will be slightly different since you are serving CSS not Pages.

You can then add in the CSS resource link to the pages that need it only 
customizing the user parameter part of the url.

I've done something similar for generating user specific images (custom 
images stamped with user specific details) so I know it will work.

Regards,

Mike

 Thanks for quick response.
 Obviously, styles can be loaded from database after Login. But i want to make 
 a separate css file and dont want ot add it in the java code, for sake of 
 simplicity. 

 Is there any way to store css styles directly from css file for a specific 
 user, and then load styles directly to css file after user Login ?

 Or can we make css file dynamic by introducing variables in it (like in PHP) ?

 Thanks...


 
 From: Mathias Nilsson wicket.program...@gmail.com
 To: users@wicket.apache.org
 Sent: Wednesday, July 22, 2009 4:59:53 PM
 Subject: Re: Save CSS/StyleSheet in Database ?


 You would probably have to use cookies to save which style the users would
 have. There is no way knowing this without login or cookie.

 There are probably a better way of doing this but if you save style and
 classes in a database like this

 *{ font-family: verdana; } // a row in the database
 a{ color: red; } // a row in the database

 you could implement the IHeaderContributor and override the renderHead

 public void renderHead(IHeaderResponse response) {
   StringBuffer buf = new StringBuffer();
   buf.append( style type=\text/css\ ); 
   buf.append( *{ font-size: 9px; } );
   buf.append( /style );
   response.renderString(buf);
 }

 of couse you should the get it from a service or directly from a dao.

 public void renderHead(IHeaderResponse response) {
BradningService service = getBrandingService(); // get this using
 @SpringBean or whatever
ListString styles = service.getStyles( user ); // get the style for a
 user
iterate here and add the style

 }


  


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


  

Need Help in Dynamic CSS generation

2009-07-23 Thread FaRHaN
I am working on creating Dynamic StyleSheets in wicket, and i found an example 
of similar behaviour in Wicket Examples 
http://cwiki.apache.org/WICKET/dynamically-generate-a-css-stylesheet.html but 
it is not working. When i place the following code in my CSS file (style.css), 
it generates error.
body{background:${color1};}
The css file doesn't recognizes $ simbol. Is this allowed in CSS file or not ? 
Please Help me out to fix this problem.

Thanks
--Farhan--



  

Re: Need Help in Dynamic CSS generation

2009-07-23 Thread FaRHaN
I am using netbeans IDE 6.5, but i dont think this is the problem of the IDE. 
It throws error of Unexpected Symbol found ($). Can you please provide me the 
working code of using variables in css ?





From: Mathias Nilsson wicket.program...@gmail.com
To: users@wicket.apache.org
Sent: Thursday, July 23, 2009 4:28:08 PM
Subject: Re: Need Help in Dynamic CSS generation


The $ is used to replace the variable (interpolated value). It's the same
technique used in properties files to replace some text. This sample works
fine. if you look at the css it has been generated according to the load()
method.

It must be you IDE that complains about this. maybe you can shut the varning
off.
-- 
View this message in context: 
http://www.nabble.com/Need-Help-in-Dynamic-CSS-generation-tp24623639p24623863.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


  

Re: Need Help in Dynamic CSS generation

2009-07-23 Thread FaRHaN
Ok thanks,
If any user of netBeans IDE have checked this example 
http://cwiki.apache.org/WICKET/dynamically-generate-a-css-stylesheet.html, then 
he must encountered this problem. Please help me out to resolve it ?


--Farhan--



From: Mathias Nilsson wicket.program...@gmail.com
To: users@wicket.apache.org
Sent: Thursday, July 23, 2009 5:08:10 PM
Subject: Re: Need Help in Dynamic CSS generation


I use Eclipse and all I have to do was copying and pasting the code from the
url you supplied. 

I'm no Netbeans user so maybe someone else could answer this.
-- 
View this message in context: 
http://www.nabble.com/Need-Help-in-Dynamic-CSS-generation-tp24623639p24624432.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


  

Save CSS/StyleSheet in Database ?

2009-07-22 Thread FaRHaN
Hi,

Is there any way to store CSS settings and classes into a database. I have a 
css file describing styles for whole website. 
I want to give user an option, to modify styles (background color, font, table 
header font, etc.) of thier own choices (at run-time). When user selects from 
the given options and hit save, then these values store in the database, so 
that when user visits the website next time then customized styles (theme) 
should be displayed on the web pages rather than default styles.
I know  this can be done by using cookies (through javascript) but the problem 
arises when user visits the website after deleting private data of browser. In 
this way, again default styles applies to all web pages.

Is there any way to make css file dynamic (using variables in css file), or to 
save css classes (styles) into database ?

Thanks,
Farhan.



  

Re: Save CSS/StyleSheet in Database ?

2009-07-22 Thread FaRHaN
Thanks for quick response.
Obviously, styles can be loaded from database after Login. But i want to make a 
separate css file and dont want ot add it in the java code, for sake of 
simplicity. 

Is there any way to store css styles directly from css file for a specific 
user, and then load styles directly to css file after user Login ?

Or can we make css file dynamic by introducing variables in it (like in PHP) ?

Thanks...



From: Mathias Nilsson wicket.program...@gmail.com
To: users@wicket.apache.org
Sent: Wednesday, July 22, 2009 4:59:53 PM
Subject: Re: Save CSS/StyleSheet in Database ?


You would probably have to use cookies to save which style the users would
have. There is no way knowing this without login or cookie.

There are probably a better way of doing this but if you save style and
classes in a database like this

*{ font-family: verdana; } // a row in the database
a{ color: red; } // a row in the database

you could implement the IHeaderContributor and override the renderHead

public void renderHead(IHeaderResponse response) {
  StringBuffer buf = new StringBuffer();
  buf.append( style type=\text/css\ ); 
  buf.append( *{ font-size: 9px; } );
  buf.append( /style );
  response.renderString(buf);
}

of couse you should the get it from a service or directly from a dao.

public void renderHead(IHeaderResponse response) {
   BradningService service = getBrandingService(); // get this using
@SpringBean or whatever
   ListString styles = service.getStyles( user ); // get the style for a
user
   iterate here and add the style

}


-- 
View this message in context: 
http://www.nabble.com/Save-CSS-StyleSheet-in-Database---tp24604324p24604928.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


  

Re: Save CSS/StyleSheet in Database ?

2009-07-22 Thread FaRHaN
It means there will be a separate CSS file for each user. This will impose 
heavy load on the application, and where is database involved in that case, as 
i want to save and load css styles from database ?
Is there any other way to do that ?
Can we make CSS file dynamic e.g. body{background: {$color};} and then modify 
that color variable in our javacode (like inPHP) ?




From: Russell Simpkins russellsimpk...@hotmail.com
To: users@wicket.apache.org
Sent: Wednesday, July 22, 2009 6:23:09 PM
Subject: RE: Save CSS/StyleSheet in Database ?


I have not done this myself, but I think you might get what you want using the 
SimpleAttributeModifier. Say you were doing a css style:
link rel=stylesheet type=text/css href=css/standard.css 
wicket:id=userStyles:/
Then in your javacode you can have:
userCss.add(new SimpleAttributeModifier(href, css/ + 
LOGGEDINUSER.getUserId() + .css));
You could always do something similar in javascript with cookies.
Russ

 Date: Wed, 22 Jul 2009 05:12:45 -0700
 From: farhan.ba...@ymail.com
 Subject: Re: Save CSS/StyleSheet in Database ?
 To: users@wicket.apache.org
 
 Thanks for quick response.
 Obviously, styles can be loaded from database after Login. But i want to make 
 a separate css file and dont want ot add it in the java code, for sake of 
 simplicity. 
 
 Is there any way to store css styles directly from css file for a specific 
 user, and then load styles directly to css file after user Login ?
 
 Or can we make css file dynamic by introducing variables in it (like in PHP) ?
 
 Thanks...
 
 
 
 From: Mathias Nilsson wicket.program...@gmail.com
 To: users@wicket.apache.org
 Sent: Wednesday, July 22, 2009 4:59:53 PM
 Subject: Re: Save CSS/StyleSheet in Database ?
 
 
 You would probably have to use cookies to save which style the users would
 have. There is no way knowing this without login or cookie.
 
 There are probably a better way of doing this but if you save style and
 classes in a database like this
 
 *{ font-family: verdana; } // a row in the database
 a{ color: red; } // a row in the database
 
 you could implement the IHeaderContributor and override the renderHead
 
 public void renderHead(IHeaderResponse response) {
   StringBuffer buf = new StringBuffer();
   buf.append( style type=\text/css\ ); 
   buf.append( *{ font-size: 9px; } );
   buf.append( /style );
   response.renderString(buf);
 }
 
 of couse you should the get it from a service or directly from a dao.
 
 public void renderHead(IHeaderResponse response) {
BradningService service = getBrandingService(); // get this using
 @SpringBean or whatever
ListString styles = service.getStyles( user ); // get the style for a
 user
iterate here and add the style
 
 }
 
 
 -- 
 View this message in context: 
 http://www.nabble.com/Save-CSS-StyleSheet-in-Database---tp24604324p24604928.html
 Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
  

_
Windows Live™ SkyDrive™: Store, access, and share your photos. See how.
http://windowslive.com/Online/SkyDrive?ocid=TXT_TAGLM_WL_CS_SD_photos_072009


  

Re: need source code for [AutoCompleteTextField]

2009-04-02 Thread FaRHaN
I want to implement AutoCompleteTextField that ships with Wicket but not the 
built-in functionality that ships with wicket. 
For Example: various Countries  ISO languages have been shiped with wicket as 
default (as implemented in the wicket library examples)

So, i want to introduce my own values(choices) stored in an array through java 
code. those will be populate when i press any of those choices' prefixes.

thanx...

--- On Thu, 4/2/09, Jeremy Thomerson jer...@wickettraining.com wrote:

From: Jeremy Thomerson jer...@wickettraining.com
Subject: Re: need source code for [AutoCompleteTextField]
To: users@wicket.apache.org
Date: Thursday, April 2, 2009, 5:51 AM

So, let me see if I understand this

You want the source code to implement an AutoCompleteTextField.

BUT - You don't want the source to the AutoCompleteTextField that ships as a
DEFAULT PART OF WICKET?

Why?

--
Jeremy Thomerson
http://www.wickettraining.com



On Thu, Apr 2, 2009 at 12:45 AM, FaRHaN farhan.ba...@ymail.com wrote:

 Anybody who loves to develop applications with Ajax will certainly know the
 Autocomplete behaviour of Ajax and most probably he developed this feature
 in his application also.
 I want to introduce that feature in my application, that will take input
 (choices) stored in an array of strings or in database. Please provide me
 some source code example to accomplish this behaviour.
 (Please dont refer me to Wicket library examples because built-in
 functionality has been implemented in those Ajax examples)

 Thanx...







  

NameSpace usage in wicket ?

2009-04-01 Thread FaRHaN
Is there any way to use NameSpace in wicket applicatin ?
Please reply...

Regards,
FaRHaN BaJWa.



  

Re: need Help on [AutoCompleteTextField]

2009-04-01 Thread FaRHaN
I have tried examples exist in wicket library but these examples are used to 
display only built-in (countries  languages) values. But i want to display my 
own values stored in an array or in DBIs there any ?

--- On Wed, 4/1/09, nino martinez wael nino.martinez.w...@gmail.com wrote:

From: nino martinez wael nino.martinez.w...@gmail.com
Subject: Re: need Help on [AutoCompleteTextField]
To: users@wicket.apache.org
Date: Wednesday, April 1, 2009, 9:05 AM

Look at the examples on wicket library, if you need more then you
could try the object autocomplete from wicketstuff..

2009/3/31 FaRHaN farhan.ba...@ymail.com:
 Is there any way to display User Defined values in AutoCompleteTextField 
 (ajax behavior) by using array of values.
 Please refer me some examples and links to demonstrate such type of behaviour.

 Thanks,
 FaRHaN





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




  

Re: NameService usage in wicket ?

2009-04-01 Thread FaRHaN
Sorry, it was NameService instead of NameSpace.
I want to use NameService for finding (extracting) values stored in an array. 

For Example, i want to use:
List names = new ArrayList();
names.add(Abe);
names.add(Abel);
String prefix = request.getParameter(name);
NameService service = NameService.getInstance(names);
List matching = service.findNames(prefix);

but getInstance() method of NameService not being eccessible in java class of 
wicket appplication.

Thanks,
FaRHaN.

--- On Wed, 4/1/09, nino martinez wael nino.martinez.w...@gmail.com wrote:

From: nino martinez wael nino.martinez.w...@gmail.com
Subject: Re: NameSpace usage in wicket ?
To: users@wicket.apache.org
Date: Wednesday, April 1, 2009, 8:34 AM

Can you be more descriptive?

Are you thinking of Javascripts name spaces? You can look at the
openlayers integration on wicketstuff if so.

2009/4/1 FaRHaN farhan.ba...@ymail.com:
 Is there any way to use NameSpace in wicket applicatin ?
 Please reply...

 Regards,
 FaRHaN BaJWa.





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




  

Re: NameService usage in wicket ?

2009-04-01 Thread FaRHaN
when i access NameService methods such as NameService service = 
NameService.(dot) the intellisense only shows class rather than all methods of 
NameService. Is there anything missing ?
Thanx again...

--- On Wed, 4/1/09, nino martinez wael nino.martinez.w...@gmail.com wrote:

From: nino martinez wael nino.martinez.w...@gmail.com
Subject: Re: NameService usage in wicket ?
To: users@wicket.apache.org
Date: Wednesday, April 1, 2009, 9:27 AM

This should not be a problem.. Im not sure why you get that problem?
Why is it not accessible from you wicket application, it's not
different from any other app. Now there might be something with an
application context.

2009/4/1 FaRHaN farhan.ba...@ymail.com:
 Sorry, it was NameService instead of NameSpace.
 I want to use NameService for finding (extracting) values stored in an array.

 For Example, i want to use:
 List names = new ArrayList();
 names.add(Abe);
 names.add(Abel);
 String prefix = request.getParameter(name);
 NameService service = NameService.getInstance(names);
 List matching = service.findNames(prefix);

 but getInstance() method of NameService not being eccessible in java class of 
 wicket appplication.

 Thanks,
 FaRHaN.

 --- On Wed, 4/1/09, nino martinez wael nino.martinez.w...@gmail.com wrote:

 From: nino martinez wael nino.martinez.w...@gmail.com
 Subject: Re: NameSpace usage in wicket ?
 To: users@wicket.apache.org
 Date: Wednesday, April 1, 2009, 8:34 AM

 Can you be more descriptive?

 Are you thinking of Javascripts name spaces? You can look at the
 openlayers integration on wicketstuff if so.

 2009/4/1 FaRHaN farhan.ba...@ymail.com:
 Is there any way to use NameSpace in wicket applicatin ?
 Please reply...

 Regards,
 FaRHaN BaJWa.





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






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




  

need source code for [AutoCompleteTextField]

2009-04-01 Thread FaRHaN
Anybody who loves to develop applications with Ajax will certainly know the 
Autocomplete behaviour of Ajax and most probably he developed this feature in 
his application also.
I want to introduce that feature in my application, that will take input 
(choices) stored in an array of strings or in database. Please provide me some 
source code example to accomplish this behaviour.
(Please dont refer me to Wicket library examples because built-in functionality 
has been implemented in those Ajax examples)

Thanx...



  

need Help on [AutoCompleteTextField]

2009-03-31 Thread FaRHaN
Is there any way to display User Defined values in AutoCompleteTextField (ajax 
behavior) by using array of values.
Please refer me some examples and links to demonstrate such type of behaviour.

Thanks,
FaRHaN



  

Re: Need Wicket Examples

2009-03-26 Thread FaRHaN
I have Wicket in Action book but those examples are being explained in 
Ant/Maven and not in netbeans IDE. Are there any examples which are also 
executable in netbeans IDE ?