RE: Wicket in a Dot Net World

2012-02-08 Thread Wilhelmsen Tor Iver
 I don't suppose anyone has ported Wicket to .NET? 

What, and lose all the non-designable ASP.Net or Razor goodness? :)

- Tor Iver 

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



how to test the wicket panel

2012-02-08 Thread akiindia01
Hi,
I am new to wicket and got to do junit testing job.

I am using wicket tester to start the panel.

I have pagination button on my panel and i have to check the onclick
functionality for this button. 
the panel has no form.

I am using following signature to check it.
tester.clickLink(panel:paginationContainer:paginationFirst);

this is throwing error : 

path panel:paginationContainer:paginationFirst does not exist for page

please tell me how to access the paginationfirst button in the testpanel

regards,
aki

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-test-the-wicket-panel-tp4368407p4368407.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: how to test the wicket panel

2012-02-08 Thread Martin Grigorov
Hi,

On Wed, Feb 8, 2012 at 8:37 AM, akiindia01 atulingal...@gmail.com wrote:
 Hi,
 I am new to wicket and got to do junit testing job.

 I am using wicket tester to start the panel.

 I have pagination button on my panel and i have to check the onclick
 functionality for this button.
 the panel has no form.

 I am using following signature to check it.
 tester.clickLink(panel:paginationContainer:paginationFirst);

I don't know the structure of your panel but I guess you need to
remove panel: prefix.


 this is throwing error :

 path panel:paginationContainer:paginationFirst does not exist for page

 please tell me how to access the paginationfirst button in the testpanel

 regards,
 aki

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/how-to-test-the-wicket-panel-tp4368407p4368407.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: dynamic markup and components

2012-02-08 Thread Alinoor
Hi Sven,

I came across this stackeroverflow link and tried it but couldn't get the
markupcontainer to load the markup. I'll give it another go...

Alinoor

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-markup-and-components-tp4366970p4368873.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Save DefaultBreadCrumbsModel to session

2012-02-08 Thread atomix
Everything should be a lot easier and we could reuse the BreadCrumbBar if it
acts like a normal component, which has a DefaultModel can get,set via
getDefaultModel...

And the reason why I ask for the method to Save DefaultBreadCrumbsModel to
Session is :
If We travel through pages, the BreadCrumbsModel has to be saved to Session
and back when we come to a new Page...

But in the BreadCrumbsBar we can't /really /interactive with this
DefaultBreadCrumbsModel as it was private and only has setActive() ??? 

Anyone know how?? Or I really have to write my own Page BreadCrumbs
Component  , I love to know the other ways, of course , don't want to
reinventing the wheel just for a small need!


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Save-DefaultBreadCrumbsModel-to-session-tp4368982p4368995.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: dynamic markup and components

2012-02-08 Thread Alinoor
Hi,

Managed to get this working by using a Panel instead of a
WebMarkupContainer. Here's the code.


import org.apache.wicket.MarkupContainer;
import org.apache.wicket.markup.IMarkupResourceStreamProvider;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.util.resource.AbstractResourceStream;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.resource.ResourceStreamNotFoundException;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

public class WicketHtmlContainer extends Panel implements
IMarkupResourceStreamProvider {
  public WicketHtmlContainer(String id) {
super(id);
Form form = new Form(form);
form.add(new TextField(myinput));
add(form);
  }

  public IResourceStream getMarkupResourceStream(MarkupContainer container,
Class? containerClass) {
System.out.println(calling getMarkupResourceStream());

return new AbstractResourceStream() {

  public InputStream getInputStream() throws
ResourceStreamNotFoundException {
return new ByteArrayInputStream(getHtml().getBytes());
  }

  public void close() throws IOException {
  }
};
  }
  
  private static String getHtml() {
String html =
wicket:panelform wicket:id=\form\ +
my text +
input wicket:id=\myinput\ type=\text\ / +
input type=\submit\ value=\submit\/ +
/form/wicket:panel;
return html;
  }
}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-markup-and-components-tp4366970p4369176.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: 1.5 Behaviors

2012-02-08 Thread Michal Wegrzyn
You can try to check whether your behavior works without other behaviors. Even 
without behaviors on children - maybe there are conflicting behaviors attached 
to the same event?

You can also try to use a Panel for your fieldset element and place container 
higher in hierarchy.

Best regards,
Michal Wegrzyn

 -Original Message-
 From: Michal Wegrzyn
 Sent: Thursday, February 02, 2012 15:05
 To: 'users@wicket.apache.org'
 Subject: RE: 1.5 Behaviors
 
 Are they any other behaviors attached?
 
 Best regards,
 Michal Wegrzyn
 
  -Original Message-
  From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
  Sent: Thursday, February 02, 2012 14:00
  To: users@wicket.apache.org
  Subject: Re: 1.5 Behaviors
 
  Any clue on what it could be?
 
  2012/2/2 nino martinez wael nino.martinez.w...@gmail.com
 
   it's never called on the behavior and neither are isEnabled... It
  must be
   something higher up the hierarchy that are stopping the behavior
   processing..
  
  
  
   2012/2/2 Martin Grigorov mgrigo...@apache.org
  
   See org.apache.wicket.Component#canCallListenerInterface
  
   On Thu, Feb 2, 2012 at 12:25 PM, nino martinez wael
   nino.martinez.w...@gmail.com wrote:
Hi
   
What can cause a behavior not to be processed?
   
I have a structure like this:
   
Form
--FieldSet
---inputs...
   
I have an appender on the fieldset which is a
 webmarkupcontainer.
   However
it never gets processed.. In this case the Form are disabled.
 Ive
  also
tried overriding the enabled property of the webmarkupcontainer
 it
   makes no
difference.
   
   
regards Nino
  
  
  
   --
   Martin Grigorov
   jWeekend
   Training, Consulting, Development
   http://jWeekend.com
  
   --
 --
  -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  

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



Re: Wicket-Source: Click-through from browser back to Java source

2012-02-08 Thread armhold
Thanks Minas, I'll take a look. 

I do have a bug in my plugin in that the configuration panel seems to always
appear twice in the IDE Settings popup, so your existing code might be
helpful in figuring that out.

The Intellij documentation on plugin API documentation isn't the best,
unfortunately.

Thanks again,
George


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Source-Click-through-from-browser-back-to-Java-source-tp4346532p4369389.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: dynamic markup and components

2012-02-08 Thread Andrea Del Bene

Hi,

I don't know if you might find this helpful, but if your component must 
generate a different markup from request to request, you should 
implements interface IMarkupCacheKeyProvider to avoid markup caching:


 /**
 * Must return null to avoid markup caching
 */
@Override
public String getCacheKey(MarkupContainer arg0, Class? arg1) {
return null;
}


Hi,

Managed to get this working by using a Panel instead of a
WebMarkupContainer. Here's the code.


import org.apache.wicket.MarkupContainer;
import org.apache.wicket.markup.IMarkupResourceStreamProvider;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.util.resource.AbstractResourceStream;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.resource.ResourceStreamNotFoundException;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

public class WicketHtmlContainer extends Panel implements
IMarkupResourceStreamProvider {
   public WicketHtmlContainer(String id) {
 super(id);
 Form form = new Form(form);
 form.add(new TextField(myinput));
 add(form);
   }

   public IResourceStream getMarkupResourceStream(MarkupContainer container,
Class?  containerClass) {
 System.out.println(calling getMarkupResourceStream());

 return new AbstractResourceStream() {

   public InputStream getInputStream() throws
ResourceStreamNotFoundException {
 return new ByteArrayInputStream(getHtml().getBytes());
   }

   public void close() throws IOException {
   }
 };
   }

   private static String getHtml() {
 String html =
 wicket:panelform wicket:id=\form\ +
 my text +
 input wicket:id=\myinput\ type=\text\ / +
 input type=\submit\ value=\submit\/ +
 /form/wicket:panel;
 return html;
   }
}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-markup-and-components-tp4366970p4369176.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



WicketTester functionalities

2012-02-08 Thread brazz
After working successfully with wicket for some time, I'm now trying ot set
up regression tests with fitnesse and the help of WicketTester functionality
or in combination with selenium if functionality of WicketTester does not
fulfill my needs (probably i won't do it with selenium as i already tried
and fought with the productivity problems that came along).

Here a few questions on WicketTester functionality:
- Is it possible to assert that a e.g. pdf/excel/tiff download succeeded?
- Is it possible to assert that a e.g. pdf/excel/tiff download succeeded
after click e.g. on a custom DefaultDataTable?
- Is it possible to simulate paging and assert results on a DataTable after
paging?

I had a look on the Basic WicketTester classes and enhancedwickettester
but couldn't find any classes that are capable of doing this.

Any hints on other testing strategies would also be appreciated.

Thanks in advance!






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WicketTester-functionalities-tp4369673p4369673.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: WicketTester functionalities

2012-02-08 Thread Martin Grigorov
On Wed, Feb 8, 2012 at 4:53 PM, brazz alexander.li...@man.eu wrote:
 After working successfully with wicket for some time, I'm now trying ot set
 up regression tests with fitnesse and the help of WicketTester functionality
 or in combination with selenium if functionality of WicketTester does not
 fulfill my needs (probably i won't do it with selenium as i already tried
 and fought with the productivity problems that came along).

 Here a few questions on WicketTester functionality:
 - Is it possible to assert that a e.g. pdf/excel/tiff download succeeded?

tester.getLastResponse().getBinaryContent()

 - Is it possible to assert that a e.g. pdf/excel/tiff download succeeded
 after click e.g. on a custom DefaultDataTable?
The same. Click the link and assert the binary content.

 - Is it possible to simulate paging and assert results on a DataTable after
 paging?

just click the navigation links and then assert that the datatable
contains the proper rows (models)


 I had a look on the Basic WicketTester classes and enhancedwickettester
 but couldn't find any classes that are capable of doing this.

 Any hints on other testing strategies would also be appreciated.

 Thanks in advance!






 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/WicketTester-functionalities-tp4369673p4369673.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: ResourceReference for resource in webapp dir

2012-02-08 Thread Kayode Odeyemi
On Mon, Feb 6, 2012 at 3:08 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 I'd not invest in AbstractResourceDependentResourceReference.
 This has been re-implemented in Wicket 6.0 and this class is no more there.

 For your case I can recommend you to take a look at Wro4j.
 With this library you can merge all resources which depend on each
 other at build time. For production you can even minimize them.


Hi Martin,

Assuming I decide not to use wro4j and I want to stick to using Wickets
iRequestMapper, is it possible for me to achieve a mapping for resources
that I have in webapp dir such as:

com.company.Dashboard - /dashboard

Such that if I have a js file in webapp/js/dashboard.js, I can simply map
it to resolve to /dashboard/js/dashboard.js instead of
/com.company.Dashboard/dashboard.js?

While digging further into Wicket
ResourceReference/Resourcestream/IRequestMapper/IRequestHandler
architecture, I noticed that ResourceReference is designed such that a
scope always returns Java package as part of the url to the resource.

Using Resourcereference/IRequestMapper, is it possible for me to achieve
the scenario I described above?

Thanks


 On Mon, Feb 6, 2012 at 4:51 PM, Bertrand Guay-Paquet
 ber...@step.polymtl.ca wrote:
  Hi,
 
  Thanks for your reply. I'll try to explain why I require this.
 
  I want to use a ResRef to implement dependent resources based on
  AbstractResourceDependentResourceReference. Essentially, when a resource
  A.js is added to the response, I want B.js to be also automatically
 added.
 
  A.js and B.js are both located in the webapp dir instead of being package
  resources. This is why I wanted to make a ResRef point to the webapp dir
  directly.
 
  I don't have much experience with Wicket resources so maybe what I
 requested
  originally is the wrong tool for the task.
 
 
  On 04/02/2012 5:07 AM, Martin Grigorov wrote:
 
  Hi,
 
  I didn't understand why you want to use ResRef but if this is your
  requirement then the easiest will be to create your own IRequestMapper
  that handles only your own IRequestHandler that works with your ResRef
  impl.
  IRequestMapper#mapHandler(IRequestHandler) is the one responsible to
  create Url when RequestCycle#urlFor() is used.
  Also take a look at
  org.apache.wicket.util.string.UrlUtils#rewriteToContextRelative()
 
  On Fri, Feb 3, 2012 at 5:40 PM, Bertrand Guay-Paquet
  ber...@step.polymtl.ca  wrote:
 
  Hi,
 
  I have the following code in my base page:
 
  public void renderHead(IHeaderResponse response) {
 // scripts/jquery-1.7.1.min.js is in webapp dir
 response.renderJavaScriptReference(scripts/jquery-1.7.1.min.js);
  }
 
  How can I transform this direct URL to a ResourceReference?
 
  PackageResourceReference is not a good fit because I don't want to
 store
  the
  .js in a Java package since it is used by non-wicket pages.
 
  With ContextRelativeResource, Wicket reads the actual resource and
 sends
  the
  result instead of simply pointing to a URL.
 
  AbstractResource with its newResourceResponse() abstract method
 requires
  to
  return the actual ResourceResponse which won't allow for a simple URL.
 
  So from what I gather, I would have to fallback to implementing an
  IResource's respond(Attributes attributes) method. I looked at the
  implementation in AbstractResource but I'm confused about what to do
 with
  headers since I only want a URL.
 
  So, does this functionality already exist? If not, do you have a few
  pointers to steer me in the right direction?
 
  Thanks,
  Bertrand
 
  -
  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
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




-- 
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde


Re: ResourceReference for resource in webapp dir

2012-02-08 Thread Martin Grigorov
Hi,

Everything is possible.
See http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
You the request parameter to map to your real resource and load it.

On Wed, Feb 8, 2012 at 5:30 PM, Kayode Odeyemi drey...@gmail.com wrote:
 On Mon, Feb 6, 2012 at 3:08 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 I'd not invest in AbstractResourceDependentResourceReference.
 This has been re-implemented in Wicket 6.0 and this class is no more there.

 For your case I can recommend you to take a look at Wro4j.
 With this library you can merge all resources which depend on each
 other at build time. For production you can even minimize them.


 Hi Martin,

 Assuming I decide not to use wro4j and I want to stick to using Wickets
 iRequestMapper, is it possible for me to achieve a mapping for resources
 that I have in webapp dir such as:

 com.company.Dashboard - /dashboard

 Such that if I have a js file in webapp/js/dashboard.js, I can simply map
 it to resolve to /dashboard/js/dashboard.js instead of
 /com.company.Dashboard/dashboard.js?

 While digging further into Wicket
 ResourceReference/Resourcestream/IRequestMapper/IRequestHandler
 architecture, I noticed that ResourceReference is designed such that a
 scope always returns Java package as part of the url to the resource.

 Using Resourcereference/IRequestMapper, is it possible for me to achieve
 the scenario I described above?

 Thanks


 On Mon, Feb 6, 2012 at 4:51 PM, Bertrand Guay-Paquet
 ber...@step.polymtl.ca wrote:
  Hi,
 
  Thanks for your reply. I'll try to explain why I require this.
 
  I want to use a ResRef to implement dependent resources based on
  AbstractResourceDependentResourceReference. Essentially, when a resource
  A.js is added to the response, I want B.js to be also automatically
 added.
 
  A.js and B.js are both located in the webapp dir instead of being package
  resources. This is why I wanted to make a ResRef point to the webapp dir
  directly.
 
  I don't have much experience with Wicket resources so maybe what I
 requested
  originally is the wrong tool for the task.
 
 
  On 04/02/2012 5:07 AM, Martin Grigorov wrote:
 
  Hi,
 
  I didn't understand why you want to use ResRef but if this is your
  requirement then the easiest will be to create your own IRequestMapper
  that handles only your own IRequestHandler that works with your ResRef
  impl.
  IRequestMapper#mapHandler(IRequestHandler) is the one responsible to
  create Url when RequestCycle#urlFor() is used.
  Also take a look at
  org.apache.wicket.util.string.UrlUtils#rewriteToContextRelative()
 
  On Fri, Feb 3, 2012 at 5:40 PM, Bertrand Guay-Paquet
  ber...@step.polymtl.ca  wrote:
 
  Hi,
 
  I have the following code in my base page:
 
  public void renderHead(IHeaderResponse response) {
     // scripts/jquery-1.7.1.min.js is in webapp dir
     response.renderJavaScriptReference(scripts/jquery-1.7.1.min.js);
  }
 
  How can I transform this direct URL to a ResourceReference?
 
  PackageResourceReference is not a good fit because I don't want to
 store
  the
  .js in a Java package since it is used by non-wicket pages.
 
  With ContextRelativeResource, Wicket reads the actual resource and
 sends
  the
  result instead of simply pointing to a URL.
 
  AbstractResource with its newResourceResponse() abstract method
 requires
  to
  return the actual ResourceResponse which won't allow for a simple URL.
 
  So from what I gather, I would have to fallback to implementing an
  IResource's respond(Attributes attributes) method. I looked at the
  implementation in AbstractResource but I'm confused about what to do
 with
  headers since I only want a URL.
 
  So, does this functionality already exist? If not, do you have a few
  pointers to steer me in the right direction?
 
  Thanks,
  Bertrand
 
  -
  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
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




 --
 Odeyemi 'Kayode O.
 http://www.sinati.com. t: @charyorde



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Wicket Ajax direction and roadmap regarding push-like updates

2012-02-08 Thread pkc
Sounds promising.  As a wicket user, I would like to see a very tight
integration of a push API in wicket-core.  It seems most solutions are
overly complicated and it would be nice to have a simple API that just let
you add listeners or set up channels, then fire off a job and wicket core
would take care of making sure the background updates were coordinated with
normal page events and state.  Similar to the Atmosphere solution,  ideally
there would be a lightweight, default/fallback implementation that doesn't
involve adding a bunch of dependencies to wicket core.  

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-direction-and-roadmap-regarding-push-like-updates-tp4351890p4370083.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: dynamic markup and components

2012-02-08 Thread Alinoor
Andrea, yes, I'm sure I would have come across this problem, so thanks for
the tip.

Alinoor

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/dynamic-markup-and-components-tp4366970p4370161.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: Wicket in a Dot Net World

2012-02-08 Thread Jeffrey Schneller
I know it is overly simplistic but you can almost think of the .aspx and the 
.aspx.c code-behind file as the .html and the .java file in Wicket if it will 
make you feel any better.  It is not that simple but it is quick way that our 
junior .NET developers can relate to what the Java folks do in Wicket.  

In the end .NET at least C# is very similar to Java so it is a somewhat easy 
learning curve [if you need to make the switch].  Learning how to use all the 
assorted and at times overly complex controls is a much steeper learning curve. 
 Not to be a Microsoft fanboy [which I am not] but if done right (and very few 
are) a .NET site can be very clean and elegant in terms of the code 
architecture.

Jeff

-Original Message-
From: shetc [mailto:sh...@bellsouth.net] 
Sent: Tuesday, February 07, 2012 2:57 PM
To: users@wicket.apache.org
Subject: Wicket in a Dot Net World

Well friends, it's happened -- the company I work for has been bought by a 
larger competitor. Sadly, the new bosses prefer to work with .NET 

I don't suppose anyone has ported Wicket to .NET? 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-in-a-Dot-Net-World-tp4366058p4366058.html
Sent from the Users forum mailing list archive at Nabble.com.

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


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



Re: ResourceReference for resource in webapp dir

2012-02-08 Thread Kayode Odeyemi
On Wed, Feb 8, 2012 at 3:58 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 Everything is possible.
 See http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
 You the request parameter to map to your real resource and load it.

 Thanks.

I have all the classes in place now. Could you help with some pointers as
to how to use this in a Page component renderHead? I'm working with
something like this:

private static final UrlResourceReference DASHBOARD_JS = new
UrlResourceReference(
/WEB-INF/js/dashboard.js);

@Override
public void renderHead(IHeaderResponse response) {
response.renderJavaScriptReference(DASHBOARD_JS);
}

Application.java
--
super.mountResource(/WEB-INF/js/dashboard.js, new UrlResourceReference());

ContextRelativeURLResource.java
-
@Override
protected ResourceResponse newResourceResponse(Attributes attributes) {
final ResourceResponse resourceResponse = new ResourceResponse();

if (resourceResponse.dataNeedsToBeWritten(attributes)) {

final UrlContextResourceStream urlContextResourceStream = new
UrlContextResourceStream(path);

 resourceResponse.setContentType(urlContextResourceStream.getContentType());

 resourceResponse.setLastModified(urlContextResourceStream.lastModifiedTime());
resourceResponse.setFileName(path);
resourceResponse.setWriteCallback(new WriteCallback() {

@Override
public void writeData(Attributes attributes) {
URL url = null;
try {
url = urlContextResourceStream.getResourceURL(); //
getURL uses path passed into UrlResourceStream
} catch (MalformedURLException ex) {

throw new WicketRuntimeException(ex);
}
}
});
}
return resourceResponse;
}

UrlResourceReference.java
---
@Override
public IResource getResource() {
return new ContextRelativeURLResource(getName());

}

I'm still getting this in the logs:
/w/wicket/resource/org.apache.wicket.Application/WEB-INF/js/dashboard-ver-1328653530609.js

Thank you.

 On Wed, Feb 8, 2012 at 5:30 PM, Kayode Odeyemi drey...@gmail.com wrote:
  On Mon, Feb 6, 2012 at 3:08 PM, Martin Grigorov mgrigo...@apache.org
 wrote:
 
  Hi,
 
  I'd not invest in AbstractResourceDependentResourceReference.
  This has been re-implemented in Wicket 6.0 and this class is no more
 there.
 
  For your case I can recommend you to take a look at Wro4j.
  With this library you can merge all resources which depend on each
  other at build time. For production you can even minimize them.
 
 
  Hi Martin,
 
  Assuming I decide not to use wro4j and I want to stick to using Wickets
  iRequestMapper, is it possible for me to achieve a mapping for resources
  that I have in webapp dir such as:
 
  com.company.Dashboard - /dashboard
 
  Such that if I have a js file in webapp/js/dashboard.js, I can simply map
  it to resolve to /dashboard/js/dashboard.js instead of
  /com.company.Dashboard/dashboard.js?
 
  While digging further into Wicket
  ResourceReference/Resourcestream/IRequestMapper/IRequestHandler
  architecture, I noticed that ResourceReference is designed such that a
  scope always returns Java package as part of the url to the resource.
 
  Using Resourcereference/IRequestMapper, is it possible for me to achieve
  the scenario I described above?
 
  Thanks
 
 
  On Mon, Feb 6, 2012 at 4:51 PM, Bertrand Guay-Paquet
  ber...@step.polymtl.ca wrote:
   Hi,
  
   Thanks for your reply. I'll try to explain why I require this.
  
   I want to use a ResRef to implement dependent resources based on
   AbstractResourceDependentResourceReference. Essentially, when a
 resource
   A.js is added to the response, I want B.js to be also automatically
  added.
  
   A.js and B.js are both located in the webapp dir instead of being
 package
   resources. This is why I wanted to make a ResRef point to the webapp
 dir
   directly.
  
   I don't have much experience with Wicket resources so maybe what I
  requested
   originally is the wrong tool for the task.
  
  
   On 04/02/2012 5:07 AM, Martin Grigorov wrote:
  
   Hi,
  
   I didn't understand why you want to use ResRef but if this is your
   requirement then the easiest will be to create your own
 IRequestMapper
   that handles only your own IRequestHandler that works with your
 ResRef
   impl.
   IRequestMapper#mapHandler(IRequestHandler) is the one responsible to
   create Url when RequestCycle#urlFor() is used.
   Also take a look at
   org.apache.wicket.util.string.UrlUtils#rewriteToContextRelative()
  
   On Fri, Feb 3, 2012 at 5:40 PM, Bertrand Guay-Paquet
   ber...@step.polymtl.ca  wrote:
  
   Hi,
  
   I have the following code in my base page:
  
   public void renderHead(IHeaderResponse 

continueToOriginalDestination seems to be incorrectly retaining destination across multiple logins

2012-02-08 Thread Evan Sable
Hi,

 

I'm using wicket 1.5-SNAPSHOT along with Shiro for
authentication/authorization security, and when an unauthorized user tries
to go to a page, Shiro calls redirectToInterceptPage behind the scenes, and
during the login process, after a successful login, there is code that says:

if (!continueToOriginalDestination()) {

   setResponsePage(getApplication().getHomePage());

}

 

It is working in the sense that if a user gets redirected to login, they are
taken to the correct destination afterwards, and if a user just clicks the
login link in a new browser they are redirected to the homepage after login.

 

BUT, the problem is, if an initial user tries to go to a protected page,
gets redirected to the login, logs in, and then logs out, and then, without
closing the browser, clicks the login link and logs in with the same user
again or even another user, it still redirects to the prior original
destination, which should no longer take effect.  I would think that this
should be forgotten upon logging out, which replaces the wicket session
with:

Session session = Session.get();

session.replaceSession();

 

I think I must be misunderstanding how continueToOriginalDestination is
working - I thought it was placing the original destination url into the
users session, which is why I figured that after the login which redirects,
followed by the logout which replaces the session, it would be gone.

 

Can someone please explain what I'm thinking about wrongly here and why the
destination is being retained across multiple logins.  Also, how can I avoid
this so that the original destination is only used the first time?Btw,
just to be clear, if I logout and then click to a new protected url, the
original destination value is properly replaced with the new protected
destination which redirects back to the intercept page.  The problem is only
if I click directly to the login page without a new intercept, but after
having previously utilized the continueToOriginalDestination in the prior
login.

Thanks very much for any help!

-Evan



Re: pooling validators

2012-02-08 Thread Jeremy Thomerson
On Mon, Feb 6, 2012 at 10:38 PM, jsanca jsa...@gmail.com wrote:

 Hi Jeremy

 Thanks for your answer, I agree with you (reason why I sent this email, to
 double check my theory)
 I am just trying to find way to optimize the app, I am new with Wicket and
 I feel the Framework creates so much instances just to render a page, so I
 see the validators everywhere might a good idea to pooling it


Great.  The JRE has been very efficient at this for a long time.  It's not
really a problem like it was in low versions like JRE 1.1, etc.  You
shouldn't hit any problems where instance creation is the issue.

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


Re: Wicket-Source: Click-through from browser back to Java source

2012-02-08 Thread Maarten Bosteels
I have not yet checked which URL's are used by the 42lines wicket-source
Firefox/Chrome extension
but just wanted to let you know that a few years ago I created an IntelliJ
IDEA plugin to jump from a URL to a specific line of code in IntelliJ

The plugin still works in recent IntelliJ versions

http://plugins.intellij.net/plugin/?id=1894

source-code:
http://code.google.com/p/firewood/source/browse/#svn%2Ftags%2FJumpToCode-0.7%253Fstate%253Dclosed

regards
Maarten


On Wed, Feb 8, 2012 at 2:19 PM, armhold armh...@gmail.com wrote:

 Thanks Minas, I'll take a look.

 I do have a bug in my plugin in that the configuration panel seems to
 always
 appear twice in the IDE Settings popup, so your existing code might be
 helpful in figuring that out.

 The Intellij documentation on plugin API documentation isn't the best,
 unfortunately.

 Thanks again,
 George


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Source-Click-through-from-browser-back-to-Java-source-tp4346532p4369389.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




wizard starting background task

2012-02-08 Thread N. Metzger
Hi all,

I'm looking for hints to realize the following scenario:

I have a wizard gathering data. On finish the wizard kicks off a background
task that uses the aforementioned data. On clicking finish I would like to
open a new page or even a modal widow that displays a progress bar while the
background task is executing. So far the only working solutions I found are:
1) I start the background task in a lazy load panel, but haven't figured out
yet how to display a progress bar while the lazy load is executing.
2) Open new page and add a form that displays another button to the user
that kicks off the background task. I would really like to avoid the extra
form and button, the finish button of the wizard should be able to do it.

Thanks for your help,

Natalie

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wizard-starting-background-task-tp4371604p4371604.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wizard starting background task

2012-02-08 Thread Hans Lesmeister
Hi,

 1) I start the background task in a lazy load panel, but haven't figured out
 yet how to display a progress bar while the lazy load is executing.

Take a look at wicket-progressbar from Wicketstuff for background processing
and showing a progressbar.

Cheers
Hans




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



Re: Expiration of unversioned pages in Wicket 1.5

2012-02-08 Thread David Rain
Martin Grigorov mgrigorov at apache.org writes:

 
 can you create a ticket for this. I think I know what happens
 thanks!
 
 On Fri, Sep 9, 2011 at 6:57 PM, pasto peter.pastrnak at gmail.com wrote:
  Hi,
 
  in Wicket 1.5 RC7 is f.e. the RedirectPage set to unversioned, that makes 
it
  impossible to render using the REDIRECT_TO_RENDER strategy. Because of this
  flag the page instance is not being stored in the PageMap store, so it is
  not accessible during the render phase. Is there some setting that can tell
  Wicket to set unversioned pages as dirty (touch the page in pagemanager)
  when using this strategy? Or I just didn't get the point? :)
 
  Thank you,
  Peter.
 
  --
  View this message in context: http://apache-
wicket.1842946.n4.nabble.com/Expiration-of-unversioned-pages-in-Wicket-1-5-
tp3802099p3802099.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscribe at wicket.apache.org
  For additional commands, e-mail: users-help at wicket.apache.org
 
 
 


Hi Martin!
I'm interested if an issue was created for this bug and if the problem was 
solved then? I couldn't find it anywhere in JIRA and I am now facing the 
(nearly) same problem.
I create the page (stateless), wrap it in PageProvider and 
RenderPageRequestHandler and make urlFor it to navigate a pure javascript 
modal window to it. But I get PageExpiredException for that new Page.
If I call getSession().getPageManager().touchPage(...) after creation, 
everything's fine, but I think this is not conceptual (I use it just as hotfix)

Running Wicket 1.5.4

Thanks for reply!

David



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