Re: Re: Re: spring problem! Panel Component could not get spring context beans,

2008-03-07 Thread Mead
Hello lars vonk,

yes, I did. Other component is ok, just Panel component cause some 
NullException.
did you access SpringContext in Panel, and its that OK?
Thanks for your help.


Best regards, 
  
=== At 2008-03-07, 16:22:58 you wrote: ===

did you inject the CmsFacade in you MyApplication in your spring config?

Lars

On Fri, Mar 7, 2008 at 9:19 AM, Mead [EMAIL PROTECTED] wrote:
 Hello lars vonk,
  following is a segment of web.xml
 context-param
 param-nameapplicationBean/param-name
 param-valuewicketApplication/param-value
 /context-param
 context-param
 param-namecontextConfigLocation/param-name
 param-value
 
 /WEB-INF/applicationContext.xml,/WEB-INF/cms-Context.xml,
 /param-value
 /context-param
 servlet
 servlet-nameWicketApplication/servlet-name
 servlet-class
 org.apache.wicket.protocol.http.WicketServlet
 /servlet-class
 init-param
 param-nameapplicationFactoryClassName/param-name
 
 param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
 /init-param
 load-on-startup0/load-on-startup
 /servlet

  
 ==
  here is the Panel
  public class TopBar extends Panel {
 public TopBar(String id, Model model,CmsFacade facade) {
 super(id, model);
 MyApplication app = (MyApplication) 
 RequestCycle.get().getApplication();
 app.getFacade();
 app.getFacade().getSomeBS();//it will cause error

  
 ==
   this is Application
  public class MyApplication extends WebApplication {
 private CmsFacade facade;
 public CmsFacade getFacade() {
 return facade;
 }
 public void setFacade(CmsFacade facade) {
 this.facade = facade;
 }
 public MyApplication() {

 }
 public Class getHomePage() {
 return Home.class;
 }

  
 ===
  upstair is my code, thanks

  Best regards,

  === At 2008-03-07, 16:08:15 you wrote: ===



  Could you post the code of the panel and the stacktrace of the nullpointer?
  
  On Fri, Mar 7, 2008 at 8:55 AM, Mead [EMAIL PROTECTED] wrote:
  
well, a Panel Component could not get spring context beans, it got 
 java.lang.NullPointerException, but a WebPage Component is ok.
 I use 
 'applicationFactoryClassName=org.apache.wicket.spring.SpringWebApplicationFactory'
  to config in the web.xml
  
  
  
  
-
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]
  

  = = = = = = = = = = = = = = = = = = = =

  Mead
  [EMAIL PROTECTED]
  2008-03-07






  -
  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]


= = = = = = = = = = = = = = = = = = = =

Mead
[EMAIL PROTECTED]
2008-03-07




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



RE: ListView#isVisible dilemma

2008-03-07 Thread Maeder Thomas
Hi Igor,

 
 it is called that way for security reasons, eg so you cannot 
 click a link that is not visible just because you know its url...

Yes, but shouldn't the visibility be reevaluated anyway after the link
is clicked? The clicking of the link, button, etc. usually changes the
state of component, no?

 
 what he should do is follow the delete call with a 
 listview.detach() call
 

Probably just being thick here, but how does calling listview.detach()
hide the listview?

Thomas

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



Re: spring problem! Panel Component could not get spring context beans,

2008-03-07 Thread lars vonk
Could you post the code of the panel and the stacktrace of the nullpointer?

On Fri, Mar 7, 2008 at 8:55 AM, Mead [EMAIL PROTECTED] wrote:

  well, a Panel Component could not get spring context beans, it got 
 java.lang.NullPointerException, but a WebPage Component is ok.
   I use 
 'applicationFactoryClassName=org.apache.wicket.spring.SpringWebApplicationFactory'
  to config in the web.xml




  -
  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]



RE: Re: Re: spring problem! Panel Component could not get spring context beans,

2008-03-07 Thread Kai Mütz
[EMAIL PROTECTED]  wrote:
 Hello lars vonk,
 
 yes, I did. Other component is ok, just Panel component cause some
 NullException. did you access SpringContext in Panel, and its that
 OK? Thanks for your help. 

I do and it works. But I use the Annotation-based approach:

http://cwiki.apache.org/WICKET/spring.html#Spring-AnnotationbasedApproach

Kai


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



Re: Re: spring problem! Panel Component could not get spring context beans,

2008-03-07 Thread Mead
Hello lars vonk,
following is a segment of web.xml
context-param
param-nameapplicationBean/param-name
param-valuewicketApplication/param-value
/context-param
context-param
param-namecontextConfigLocation/param-name
param-value

/WEB-INF/applicationContext.xml,/WEB-INF/cms-Context.xml,
/param-value
/context-param
servlet
servlet-nameWicketApplication/servlet-name
servlet-class
org.apache.wicket.protocol.http.WicketServlet
/servlet-class
init-param
param-nameapplicationFactoryClassName/param-name

param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
/init-param   
load-on-startup0/load-on-startup
/servlet

==
here is the Panel
public class TopBar extends Panel {
public TopBar(String id, Model model,CmsFacade facade) {
super(id, model);
MyApplication app = (MyApplication) 
RequestCycle.get().getApplication();
app.getFacade();
app.getFacade().getSomeBS();//it will cause error

==
  this is Application
public class MyApplication extends WebApplication {
private CmsFacade facade;
public CmsFacade getFacade() {
return facade;
}
public void setFacade(CmsFacade facade) {
this.facade = facade;
}
public MyApplication() {

}
public Class getHomePage() {
return Home.class;
}

===
upstair is my code, thanks

Best regards, 
  
=== At 2008-03-07, 16:08:15 you wrote: ===

Could you post the code of the panel and the stacktrace of the nullpointer?

On Fri, Mar 7, 2008 at 8:55 AM, Mead [EMAIL PROTECTED] wrote:

  well, a Panel Component could not get spring context beans, it got 
 java.lang.NullPointerException, but a WebPage Component is ok.
   I use 
 'applicationFactoryClassName=org.apache.wicket.spring.SpringWebApplicationFactory'
  to config in the web.xml




  -
  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]


= = = = = = = = = = = = = = = = = = = =

Mead
[EMAIL PROTECTED]
2008-03-07




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



Re: Re: Re: spring problem! Panel Component could not get spring context beans,

2008-03-07 Thread lars vonk
Same here I use the annotation based approach and no problems there.

It should work in your case as well. Are you sure the nullpointer is
because the CmsFacade is null? Or is the nullpoiner in the getSomeBS()
method?

On Fri, Mar 7, 2008 at 9:40 AM, Kai Mütz [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED]  wrote:
   Hello lars vonk,
  
   yes, I did. Other component is ok, just Panel component cause some
   NullException. did you access SpringContext in Panel, and its that
   OK? Thanks for your help.

  I do and it works. But I use the Annotation-based approach:

  http://cwiki.apache.org/WICKET/spring.html#Spring-AnnotationbasedApproach

  Kai




  -
  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]



Re: ListView#isVisible dilemma

2008-03-07 Thread Edvin Syse

Maeder Thomas skrev:
what he should do is follow the delete call with a 
listview.detach() call




Probably just being thick here, but how does calling listview.detach()
hide the listview?


The point is not to hide the listview, but to refresh the content. I 
think Igor meant model.detach(), not listview.detach() though.


-- Edvin

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



Re: Re: Re: Re: spring problem! Panel Component could not get spring context beans,

2008-03-07 Thread Mead
Hello lars vonk,

I find I have two WebApplication: aWebApplication, bWebApplication
and  aWebApplication inject the spring context(in the web.xml), 
and  b havenot inject. but

bWebApplication extends aWebApplication{}

in bWebApplication I call the method following:
aWebApplication app = (bWebApplication) RequestCycle.get().getApplication();
app.getFacade();// it's NULL 

I think the mostly reason is that! 
How to config two Application with spring inject?
thinks.




context-param
param-nameapplicationBean/param-name
param-valuewicketApplication/param-value
/context-param
context-param
param-namecontextConfigLocation/param-name
param-value

/WEB-INF/applicationContext.xml,/WEB-INF/cms-Context.xml,
/param-value
/context-param

listener

listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
/listener

!--It is the APP inject the spring context---
servlet
servlet-nameWicketApplication/servlet-name
servlet-class
org.apache.wicket.protocol.http.WicketServlet
/servlet-class
init-param
param-nameapplicationFactoryClassName/param-name

param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
/init-param   
load-on-startup0/load-on-startup
/servlet


!-- View Application here, It not inject spring, but extends--
servlet
servlet-namebApplication/servlet-name
servlet-class
org.apache.wicket.protocol.http.WicketServlet
/servlet-class
init-param
param-nameapplicationClassName/param-name

param-valuecn.meadlai.cms.view.wicket.bApplication/param-value
/init-param
load-on-startup0/load-on-startup
/servlet



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



Re: Re: Re: Re: Re: spring problem! Panel Component could not get spring context beans,

2008-03-07 Thread Mead
Hello All,

 If I config the two WebApplication like downstair, It only direct to one 
Application, and another WebApplication couldn't be accessed. 

servlet
servlet-nameWicketApplication/servlet-name
servlet-class
org.apache.wicket.protocol.http.WicketServlet
/servlet-class
init-param
param-nameapplicationFactoryClassName/param-name

param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
/init-param   
load-on-startup0/load-on-startup
/servlet


!-- some as up, this APP wouldn't be acessed--
servlet
servlet-nameViewApplication/servlet-name
servlet-class
org.apache.wicket.protocol.http.WicketServlet
/servlet-class
init-param
param-nameapplicationFactoryClassName/param-name

param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
/init-param
load-on-startup0/load-on-startup
/servlet


Best regards, 
Mead  




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



Re: Markup Rendering issues

2008-03-07 Thread Jörn Zaefferer
On Wed, Mar 5, 2008 at 5:01 PM, Erik van Oosten [EMAIL PROTECTED] wrote:
 Hi Jörn,

  -- Ids
  This one of the exceptions in just taking existing HTML. Our designers
  also use jquery and solved the problem by using classes. Something like:
  class=idCommentForm. For jquery it doesn't matter much, and by
  including id in the class name the intend is still clear.

While you are right that it is just as easy to jQuery to select
classes, its not a real replacement. When performance matters, the
difference between #id and .id can be quite huge.

Richard's suggestion to use setMarkupId works for me, thanks Richard.


  -- Wicket tags
  This is all time high FAQ :)  Do
  getMarkupSettings().setStripWicketTags(true) in the init() of your
  application class. (I still wonder why it is not the default.)

That works perfect, thanks.

I prefer a rendering that is the same in both development and
deployment - if my clientside script relies on development-only
markup, my deployed application would behave quite differently.


  -- Url handling
  There is a lot to say on this topic (and a lot has been said). Its best
  to search the lists and ask again with more specific questions. Mounting
  bookmarkable pages could indeed alleviate your problem. Mounting is
  typically done in the init() method of your application.

Ok, I'll give mounting a try and see how far I can get.

Thanks
Jörn

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



Re: Re: Re: Re: spring problem! Panel Component could not get spring context beans,

2008-03-07 Thread lars vonk
I have no experience with two WicketApplications. I am not sure if
this is a good idea.
But besides that: I think you need to tell the bApplication it should
use the org.apache.wicket.spring.SpringWebApplicationFactory, the same
way you did with the WicketApplication servlet. Since the bApplication
servlet creates the cn.meadlai.cms.view.wicket.bApplication you'll get
a different non spring managerd instance.

On Fri, Mar 7, 2008 at 10:49 AM, Mead [EMAIL PROTECTED] wrote:
 Hello lars vonk,

  I find I have two WebApplication: aWebApplication, bWebApplication
  and  aWebApplication inject the spring context(in the web.xml),
  and  b havenot inject. but

  bWebApplication extends aWebApplication{}

  in bWebApplication I call the method following:
  aWebApplication app = (bWebApplication) RequestCycle.get().getApplication();
  app.getFacade();// it's NULL

  I think the mostly reason is that!
  How to config two Application with spring inject?
  thinks.





 context-param
 param-nameapplicationBean/param-name
 param-valuewicketApplication/param-value
 /context-param
 context-param
 param-namecontextConfigLocation/param-name
 param-value
 
 /WEB-INF/applicationContext.xml,/WEB-INF/cms-Context.xml,
 /param-value
 /context-param

 listener
 
 listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
 /listener

  !--It is the APP inject the spring context---

 servlet
 servlet-nameWicketApplication/servlet-name
 servlet-class
 org.apache.wicket.protocol.http.WicketServlet
 /servlet-class
 init-param
 param-nameapplicationFactoryClassName/param-name
 
 param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
 /init-param
 load-on-startup0/load-on-startup
 /servlet


 !-- View Application here, It not inject spring, but extends--
 servlet
 servlet-namebApplication/servlet-name

 servlet-class
 org.apache.wicket.protocol.http.WicketServlet
 /servlet-class
 init-param
 param-nameapplicationClassName/param-name
 
 param-valuecn.meadlai.cms.view.wicket.bApplication/param-value

 /init-param
 load-on-startup0/load-on-startup
 /servlet





 -
  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]



RE: ListView#isVisible dilemma

2008-03-07 Thread Maeder Thomas
But wasn't hiding the listview the original point of the question? 

Thomas
 -Original Message-
 From: Edvin Syse [mailto:[EMAIL PROTECTED] 
 Sent: Freitag, 7. März 2008 10:15
 To: users@wicket.apache.org
 Subject: Re: ListView#isVisible dilemma
 
 Maeder Thomas skrev:
  what he should do is follow the delete call with a
  listview.detach() call
 
  
  Probably just being thick here, but how does calling 
 listview.detach() 
  hide the listview?
 
 The point is not to hide the listview, but to refresh the 
 content. I think Igor meant model.detach(), not 
 listview.detach() though.
 
 -- Edvin
 
 -
 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]



Wickettester assertPageLink does not work for extended PageLink

2008-03-07 Thread Herman Suijs
Hi everyone,

I'm using an extended PageLink which overrides the isVisible().

Now I want to test it with the wickettester as a PageLink. This gives an
unclear error message: 'unexpected'.

What happens is that the tester tries to get the IPageLink from the PageLink
with reflection, but because the pageLink is private it will not get it for
the subclass.

Maybe the access rights can be changed or the class should have another
mechanism to view it's IPageLink.

Or can I do it another way ?

Thanks.

-- 
Herman Suijs


How to mount a form?

2008-03-07 Thread Jörn Zaefferer
Hi,

I'm trying to mount a form, eg. a login form to /login/, resulting in
something like form action=/login//.

There are a lot of classes related to mounting, though everything I
found so far refers to pages. Just mounting a Form subclass doesn't
yield anything at all.

Thanks for any hints
Jörn

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



nljug wicket presentation

2008-03-07 Thread Maurice Marrink
I just heard about a new Wicket presentation that will be held at the
dutch java user group.
Presentation: 
http://www.nljug.org/pages/events/content/jspring_2008/sessions/00035/
Program:http://www.nljug.org/pages/events/content/jspring_2008/sessions/?template=showprogram.htmlfs=1
Speaker will be Lars Vonk.

most content of the website is in dutch as far as i could see and i
assume the presentations will be too.

Maurice

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



Re: nljug wicket presentation

2008-03-07 Thread lars vonk
Yes that's me. You're assumptions are right.

Lars

On Fri, Mar 7, 2008 at 11:45 AM, Maurice Marrink [EMAIL PROTECTED] wrote:
 I just heard about a new Wicket presentation that will be held at the
  dutch java user group.
  Presentation: 
 http://www.nljug.org/pages/events/content/jspring_2008/sessions/00035/
  
 Program:http://www.nljug.org/pages/events/content/jspring_2008/sessions/?template=showprogram.htmlfs=1
  Speaker will be Lars Vonk.

  most content of the website is in dutch as far as i could see and i
  assume the presentations will be too.

  Maurice

  -
  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]



Re: Feedback on proposed Groovy DSL syntax for Wicket

2008-03-07 Thread Dmitry Kandalov
On Thursday 06 March 2008 18:59:59 graemer wrote:
 So as some of you may know I've been updating the Grails Wicket plug-in.

I didn't know but I tried the plug-in a couple of weeks ago (with help of your 
blog) and it worked fine expect that I couldn't make wicket classes reload. I 
should look at the updated version ;)

 There is quite a few users on the Grails list who have shown interest in it
 and the ability to use a component framework backed onto the rest of the
 Grails stack (GORM, transactional services, plugin system etc.)

 However, the plugin provides a very basic level of integration and I was
 thinking it would be nice to create a Groovy DSL for Wicket. I looked into
 the WicketBuilder, but really I think we can take this further. So based on
 the example here:
 http://www.theserverside.com/tt/articles/article.tss?l=IntroducingApacheWic
ket

 I came up with the below syntax to represent this application (note i
 havent actually implemented anything yet this is just a syntax proposal).
 Thoughts/feedback/suggestions welcome:

I also looked a while ago at the WicketBuilder, Kevin Galligan blog and 
discussion at wicket and groovy mailing lists.

As I understand there are two major problems with using groovy and wicket:
 - groovy doesn't have anonymous classes but they are used a lot in wicket;
 - if you somehow substitute anonymous classes with closures (what seems to be 
the most sane way), groovy's closures are not serializable but components in 
wicket must be serializable.

So IMHO the main purpose of creating a builder (actually it doesn't have to be 
a builder) would be in the first place to solve the above problems.

From what I remember from the WicketBuilder sources to solve the problems 
WicketBuilder:
 - generates groovy class (as text) which implements/overrides methods, then 
builder add closures calls to this methods.
 - stores the class of the closure (class is serializable :)) and when the 
closure needs to be called, builder creates new instance of the class and 
execute it. The consequence is that closures cannot reference local 
variables.

Some time ago I myself created a small builder to try groovy out and see how 
useful nice syntax can be. To solve the above problems I:
 - manually created subclasses for some basic wicket classes, added closures 
calls in implemented methods and added setters for these closures. (I know 
manual subclassing is lame, but it was the simplest thing I could 
do.)
 - created closure wrapper which is serializable and can serialize closure 
casting all its properties to Serializable. This way closures can reference 
page's local variables. It works fine for my simple use cases, though it 
might be not a very good solution.


 [skipped]

 Contact.findByNameLike(%${params.searchString}%) }  as
 LoadableDetachableModel

 [skipped]

 view  label(lastName, new PropertyModel(item.model,
 lastName))
 item  view
             item  link(edit, item.model) {
                 onClick {
                     redirect page:new EditContact(model.id)
                 }
             }

 [skipped]

If I got it right, the main difference compared to WicketBuilder is that you 
put event handlers like onClick in a closure where child components are 
added. I like the idea, it seems to be more readable than adding closures as 
attributes to the builder method. I also like the idea of using , IMHO 
it's a bit easier to notice in the code than add.


What I did in my humble builder is more weird, because I added component id to 
the builder methods names. It looks like this (it's working code from 
test):

builder.build {
myLabel()
myLink(onClick: this.callback) {
my2Label()
}
myForm(onSubmit: this.callback) {
anotherLabel()
myButton(onSubmit: this.callback)
myList([1,2,3], onItem: {})
}
}

I used here link to instance method (this.callback) because I didn't like 
putting callback code in the builder hierarchy.


The next idea was that it would be ugly to put all the configuration into 
builder, so after calling the builder it's possible to access components 
without declaring local variables (it only works on a groovy specific page):

builder.build {...}
myLabel.visible = false
myLabel.markupId = myLabelMarkupId


Another idea is that there should _not_ be any builders since components 
hierarchy is already declared in markup files. In this case components could 
be created like that (it's also working code from test):

public PageWithImplicitLabel() {
// creating label by calling non-existent method
myLabel(label text)
// accessing label by name
myLabel.markupId = myLabelMarkupId
}

Component hierarchy could be built at the end of the constructor with static 
call like that:

public PageWithImplicitLabel() {
...
HierarchyBuilder.build(this); // reads markup, rearranges components
}

I've also created very basic HierarchyBuilder. I wonder if someone really use 
something 

RequestCycle.get() in WebResource

2008-03-07 Thread Kaspar Fischer
How can I get hold of the current request cycle in a subclass of  
WebResource?

In

  public final class RepositoryFileResource extends WebResource
  {
/* ... */

public IResourceStream getResourceStream()
{
  RequestCycle cycle = RequestCycle.get();

cycle is null.

P.S. I am registering my resource in my application's init()

getSharedResources().add(repo, new RepositoryFileResource());


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



Re: RequestCycle.get() in WebResource

2008-03-07 Thread Kaspar Fischer

I should add that I want the cycle in order to access the context
of my external content repository. I am setting up this context
as described in http://markmail.org/message/varxr2or2ba6tr7g .

On 07.03.2008, at 12:19, Kaspar Fischer wrote:

How can I get hold of the current request cycle in a subclass of  
WebResource?

In

 public final class RepositoryFileResource extends WebResource
 {
   /* ... */

   public IResourceStream getResourceStream()
   {
 RequestCycle cycle = RequestCycle.get();

cycle is null.

P.S. I am registering my resource in my application's init()

   getSharedResources().add(repo, new RepositoryFileResource());




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



Re: How to inject Spring Application context into WicketTester

2008-03-07 Thread lars vonk
Hi,

What we did is use the spring testing (see
http://static.springframework.org/spring/docs/2.5.x/reference/testing.html)
capabilities for this:

We created an abstract base class that all test cases that need to
test wicket pages or components

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={/applicationContext.xml})
@TransactionConfiguration
@Transactional
public abstract class AbstractWicketTestCase {

@Autowired
protected MyWebApplication wicketApplication;
protected WicketTester tester;

   @Before
   public void setup() {
  tester = new WicketTest(wicketApplication);
   }
}

Hopes this helps.

Lars

On Fri, Mar 7, 2008 at 12:11 PM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:
 Hi,

  my wicket applicatin uses the SpringComponentInjector and @SpringBean
  annotations, which works great at runtime where the application
  context is present.

  I'd like to use WicketTester for JUnit tests:

  tester = new WicketTester(new MyApplication());
  In MyApplication#init, the component injector is created:
  addComponentInstantiationListener(new SpringComponentInjector(this));
  That constructor loads the ApplicationContext via
  
 WebApplicationContextUtils.getRequiredWebApplicationContext(webapp.getServletContext()

  That is the part which fails in my test, because there is no
  ApplicationContext stored in the servlet context. How can I fix that?

  My attempts so far:
  The description here doesn't help:
  http://cwiki.apache.org/WICKET/spring.html#Spring-UnitTestingtheProxyApproach
  The injector is already configured at that point.

  The alternative would be to put the application context into the
  ServletContext, so that WebApplicationContextUtils can find it. I've
  found no way to access MockWebApplication.context to set it manually,
  though I was able to set it by overwriting newServletContext. Though
  .setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
  context); where context is of type AnnotApplicationContextMock yields
  an IllegalStateException, because AnnotApplicationContextMock doesn't
  implement WebApplicationContext.

  Thanks
  Jörn

  -
  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]



Re: RequestCycle.get() in WebResource

2008-03-07 Thread lars vonk
I guess you can't. Since you are in the Application init method I
don't think there is a requestcycle available (request cycles
represents the processing of a request).

Lars

On Fri, Mar 7, 2008 at 12:19 PM, Kaspar Fischer [EMAIL PROTECTED] wrote:
 How can I get hold of the current request cycle in a subclass of
  WebResource?
  In

public final class RepositoryFileResource extends WebResource
{
  /* ... */

  public IResourceStream getResourceStream()
  {
RequestCycle cycle = RequestCycle.get();

  cycle is null.

  P.S. I am registering my resource in my application's init()

  getSharedResources().add(repo, new RepositoryFileResource());


  -
  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]



Use a panel as login panel rather than a different page with wicket auth

2008-03-07 Thread richardwilko

Hi,

We are using the wicket-auth stuff on our site.

However rather than having a separate page for login we have a modal window
in our page (not a wicket modal window, but a custom one, its basically a
wicket panel in the page).

Is there any way to make my code for popping up the modal execute when a
login is needed rather than redirecting to a different page?  I know we can
do this by checking if the user is logged in when a link is clicked and then
running our code, but that kind of defeats the purpose of using the wicket
auth stuff.

Thanks,

Richard
-- 
View this message in context: 
http://www.nabble.com/Use-a-panel-as-login-panel-rather-than-a-different-page-with-wicket-auth-tp15891186p15891186.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: RequestCycle.get() in WebResource

2008-03-07 Thread Kaspar Fischer

On 07.03.2008, at 13:01, lars vonk wrote:


I guess you can't. Since you are in the Application init method I
don't think there is a requestcycle available (request cycles
represents the processing of a request).


I am not trying to get the request cycle inside my application's init(),
but in getResourceStream().

Still, I think your explanation applies again: getResourceStream()
is apparently called (why?) even when the web server is doing a
HEAD request, in which case there is (?) no request cycle either.
Could this be the case?

On Fri, Mar 7, 2008 at 12:19 PM, Kaspar Fischer  
[EMAIL PROTECTED] wrote:

How can I get hold of the current request cycle in a subclass of
WebResource?
In

  public final class RepositoryFileResource extends WebResource
  {
/* ... */

public IResourceStream getResourceStream()
{
  RequestCycle cycle = RequestCycle.get();

cycle is null.

P.S. I am registering my resource in my application's init()

getSharedResources().add(repo, new RepositoryFileResource());


-
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]




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



Re: ListView#isVisible dilemma

2008-03-07 Thread Edvin Syse
But wasn't hiding the listview the original point of the question? 


No, hiding was not the issue. The issue was that because the model was 
consulted in the isVisible() method of the ListView, the deletion 
wouldn't be visible before the page was rerendered using the 
page-constructor (hence, the need to do setResponsePage()).


-- Edvin

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



RE: ListView#isVisible dilemma

2008-03-07 Thread Maeder Thomas
I i know you started the thread, but...from the initial post: 

 He overrides isVisible on the ListView, and does:

 @Override public boolean isVisible() {
   return ((List)myModel.getObject()).size()  0;
}

.. so THE LIST WONT BE VISIBLE if the list is empty.


etc...

The CAPITALS are mine.

what gives?

Thomas


 -Original Message-
 From: Edvin Syse [mailto:[EMAIL PROTECTED] 
 Sent: Freitag, 7. März 2008 13:26
 To: users@wicket.apache.org
 Subject: Re: ListView#isVisible dilemma
 
  But wasn't hiding the listview the original point of the question? 
 
 No, hiding was not the issue. The issue was that because the 
 model was consulted in the isVisible() method of the 
 ListView, the deletion wouldn't be visible before the page 
 was rerendered using the page-constructor (hence, the need to 
 do setResponsePage()).
 
 -- Edvin
 
 -
 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]



Re: RequestCycle.get() in WebResource

2008-03-07 Thread Johan Compagner
yes
there is not request cycle when doing resources
why do you need it?

johan



On Fri, Mar 7, 2008 at 1:06 PM, Kaspar Fischer [EMAIL PROTECTED] wrote:

 On 07.03.2008, at 13:01, lars vonk wrote:

  I guess you can't. Since you are in the Application init method I
  don't think there is a requestcycle available (request cycles
  represents the processing of a request).

 I am not trying to get the request cycle inside my application's init(),
 but in getResourceStream().

 Still, I think your explanation applies again: getResourceStream()
 is apparently called (why?) even when the web server is doing a
 HEAD request, in which case there is (?) no request cycle either.
 Could this be the case?

  On Fri, Mar 7, 2008 at 12:19 PM, Kaspar Fischer
  [EMAIL PROTECTED] wrote:
  How can I get hold of the current request cycle in a subclass of
  WebResource?
  In
 
public final class RepositoryFileResource extends WebResource
{
  /* ... */
 
  public IResourceStream getResourceStream()
  {
RequestCycle cycle = RequestCycle.get();
 
  cycle is null.
 
  P.S. I am registering my resource in my application's init()
 
  getSharedResources().add(repo, new RepositoryFileResource());
 
 
  -
  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]
 


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




How to enclode WebResource requests in transaction (Was: RequestCycle.get() in WebResource)

2008-03-07 Thread Kaspar Fischer
I have a general question on how to wrap transaction boundaries around  
requests

to a WebResource. As discussed in the thread

  http://markmail.org/message/tbpg65xd5x26v7xf

there are two possible requests: an ordinary web request (with a  
RequestCycle)
and a HEAD request (where no RequestCycle exists). If an application  
needs to

wrap transaction boundaries around such requests, how should it do this?

The former kind of request can wrapped by listening to WebRequestCycle's
onBeginRequest and onEndRequest methods, but the latter needs *another*
way, it seems. Is there a way that handles both cases?

Thanks a lot for any hint!
Kaspar

On 07.03.2008, at 13:06, Kaspar Fischer wrote:


On 07.03.2008, at 13:01, lars vonk wrote:


I guess you can't. Since you are in the Application init method I
don't think there is a requestcycle available (request cycles
represents the processing of a request).


I am not trying to get the request cycle inside my application's  
init(),

but in getResourceStream().

Still, I think your explanation applies again: getResourceStream()
is apparently called (why?) even when the web server is doing a
HEAD request, in which case there is (?) no request cycle either.
Could this be the case?

On Fri, Mar 7, 2008 at 12:19 PM, Kaspar Fischer  
[EMAIL PROTECTED] wrote:

How can I get hold of the current request cycle in a subclass of
WebResource?
In

 public final class RepositoryFileResource extends WebResource
 {
   /* ... */

   public IResourceStream getResourceStream()
   {
 RequestCycle cycle = RequestCycle.get();

cycle is null.

P.S. I am registering my resource in my application's init()

   getSharedResources().add(repo, new RepositoryFileResource());


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



Junit required for WicketTester?

2008-03-07 Thread reikje

Do you have to have junit.jar in the classpath if you want to use
WicketTester? We are using TestNG here and in a regular TestNG test case
(where the class is annotated with @Test), I get
java.lang.NoClassDefFoundError: junit/framework/AssertionFailedError.
-- 
View this message in context: 
http://www.nabble.com/Junit-required-for-WicketTester--tp15892202p15892202.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 enclode WebResource requests in transaction (Was: RequestCycle.get() in WebResource)

2008-03-07 Thread Johan Compagner
do you need a transaction around the resource when only the
lastModifiedTimeStamp is ask for?
is your resource really cachable?

johan



On Fri, Mar 7, 2008 at 2:15 PM, Kaspar Fischer [EMAIL PROTECTED] wrote:

 I have a general question on how to wrap transaction boundaries around
 requests
 to a WebResource. As discussed in the thread

   http://markmail.org/message/tbpg65xd5x26v7xf

 there are two possible requests: an ordinary web request (with a
 RequestCycle)
 and a HEAD request (where no RequestCycle exists). If an application
 needs to
 wrap transaction boundaries around such requests, how should it do this?

 The former kind of request can wrapped by listening to WebRequestCycle's
 onBeginRequest and onEndRequest methods, but the latter needs *another*
 way, it seems. Is there a way that handles both cases?

 Thanks a lot for any hint!
 Kaspar

 On 07.03.2008, at 13:06, Kaspar Fischer wrote:

  On 07.03.2008, at 13:01, lars vonk wrote:
 
  I guess you can't. Since you are in the Application init method I
  don't think there is a requestcycle available (request cycles
  represents the processing of a request).
 
  I am not trying to get the request cycle inside my application's
  init(),
  but in getResourceStream().
 
  Still, I think your explanation applies again: getResourceStream()
  is apparently called (why?) even when the web server is doing a
  HEAD request, in which case there is (?) no request cycle either.
  Could this be the case?
 
  On Fri, Mar 7, 2008 at 12:19 PM, Kaspar Fischer
  [EMAIL PROTECTED] wrote:
  How can I get hold of the current request cycle in a subclass of
  WebResource?
  In
 
   public final class RepositoryFileResource extends WebResource
   {
 /* ... */
 
 public IResourceStream getResourceStream()
 {
   RequestCycle cycle = RequestCycle.get();
 
  cycle is null.
 
  P.S. I am registering my resource in my application's init()
 
 getSharedResources().add(repo, new RepositoryFileResource());

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




Re: How to mount a form?

2008-03-07 Thread Nino Saturnino Martinez Vazquez Wael

Think out of the box...

Mount a page, and pass the parameters to the form, exact same result as 
mapping the form..



regards Nino

Jörn Zaefferer wrote:

Hi,

I'm trying to mount a form, eg. a login form to /login/, resulting in
something like form action=/login//.

There are a lot of classes related to mounting, though everything I
found so far refers to pages. Just mounting a Form subclass doesn't
yield anything at all.

Thanks for any hints
Jörn

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


  


--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: Problem when MIgrating from 1.2 to 1.3 - Parameters removed from HomePage URL

2008-03-07 Thread Rajiv Jivan
Are we talking about the same thing? Your patch removes the trailing /
while in my case without the trailing / the parameters aren't
recognized.

On Thu, Mar 6, 2008 at 6:11 PM, David Leangen [EMAIL PROTECTED] wrote:

  I've already filed an issue and submitted a patch for this:

   https://issues.apache.org/jira/browse/WICKET-1385


  Cheers,
  Dave





   -Original Message-
   From: Rajiv Jivan [mailto:[EMAIL PROTECTED]
   Sent: 7 March 2008 05:47
   To: users@wicket.apache.org
   Subject: Problem when MIgrating from 1.2 to 1.3 - Parameters
   removed from HomePage URL
  
  
   We have a site developed using Wicket 1.2. One of the use cases we
   have is to pass in a parameter on the home page, and based on that we
   perform some actions. e.g
  
   http://localhost/helloworld?name=John
  
   This functionality seem to be broken in 1.3. When passing in
   parameters on the home page URL they are stripped. Going through the
   Wicket I have narrowed down to an issue in WicketFilter
  
   // Special-case for home page - we redirect to add a
   trailing slash.
   if (relativePath.length() == 0 
  
   !Strings.stripJSessionId(servletRequest.getRequestURI()).endsWith(/))
   {
   final String redirectUrl =
   servletRequest.getRequestURI() + /;
  
   servletResponse.sendRedirect(servletResponse.encodeRedirectURL(red
   irectUrl));
   return;
   }
  
   The only workaround I have is to change the URL to
   http://localhost/helloworld/?name=John
   Notice the traling / after helloworld
  
   Am I missing something or is this a bug ?
  
   Thanks,
  
   Rajiv
  
   -
   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]



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



RE: Use a panel as login panel rather than a different page with wicket auth

2008-03-07 Thread Warren
I used AbstractAjaxTimerBehavior as kind of a password protected screen
saver and the following code to get a modal window to open when the page is
loaded. Body is a WebMarkuContainer representing the body tag. I used the
standard Wicket modal window with a Panel.

body.add(new AjaxEventBehavior(onload)
{
protected void onEvent(AjaxRequestTarget target)
{
modal.show(target);
}
});

 -Original Message-
 From: richardwilko [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 07, 2008 7:06 AM
 To: users@wicket.apache.org
 Subject: Use a panel as login panel rather than a different page with
 wicket auth



 Hi,

 We are using the wicket-auth stuff on our site.

 However rather than having a separate page for login we have a
 modal window
 in our page (not a wicket modal window, but a custom one, its basically a
 wicket panel in the page).

 Is there any way to make my code for popping up the modal execute when a
 login is needed rather than redirecting to a different page?  I
 know we can
 do this by checking if the user is logged in when a link is
 clicked and then
 running our code, but that kind of defeats the purpose of using the wicket
 auth stuff.

 Thanks,

 Richard
 --
 View this message in context:
 http://www.nabble.com/Use-a-panel-as-login-panel-rather-than-a-dif
 ferent-page-with-wicket-auth-tp15891186p15891186.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: RequestCycle.get() in WebResource

2008-03-07 Thread Johan Compagner
head request must be really fast because the happen a lot
and you should not be loading so much then

So you just have to see if you can create a resourcestream that only has the
right timestamp

johan



On Fri, Mar 7, 2008 at 12:31 PM, Kaspar Fischer [EMAIL PROTECTED]
wrote:

 I should add that I want the cycle in order to access the context
 of my external content repository. I am setting up this context
 as described in http://markmail.org/message/varxr2or2ba6tr7g .

 On 07.03.2008, at 12:19, Kaspar Fischer wrote:

  How can I get hold of the current request cycle in a subclass of
  WebResource?
  In
 
   public final class RepositoryFileResource extends WebResource
   {
 /* ... */
 
 public IResourceStream getResourceStream()
 {
   RequestCycle cycle = RequestCycle.get();
 
  cycle is null.
 
  P.S. I am registering my resource in my application's init()
 
 getSharedResources().add(repo, new RepositoryFileResource());
 


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




Enabling/disabling components dynamically

2008-03-07 Thread Serzhas

Greetings.
Let me explain: suppose we have a page with few components, where page
itself
can have few different modes - READ-ONLY, EDIT or CREATE mode. When in
EDIT/CREATE mode, we want to let user to change components values. In
READ-ONLY
mode all components should be immutable. What is the best practices to
achieve such 
page behavior (if any)?
Thanks.
-- 
View this message in context: 
http://www.nabble.com/Enabling-disabling-components-dynamically-tp15897799p15897799.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: RequestCycle.get() in WebResource

2008-03-07 Thread Kaspar Fischer

Johan, thanks a lot for your explanations!

On 07.03.2008, at 15:47, Johan Compagner wrote:


do you need a transaction around the resource when only the
lastModifiedTimeStamp is ask for?


Yes, unfortunately.


is your resource really cachable?


I am writing a WebResource that returns files from an external content
repository. So yes: the resource should be cached by the browser and
yes, I do have a lastModifiedTimeStamp.

Or did you ask because I am using WebResource and not  
DynamicWebResource?
I thought I am going to use WebResource as the content repository  
(Alfresco,

in my case) probably already does some (server-side) caching and
DynamicWebResource would add another level of server-side caching  
(right?).



head request must be really fast because the happen a lot
and you should not be loading so much then

So you just have to see if you can create a resourcestream that only  
has the

right timestamp


Okay, got it.

Btw, is there a reason why WebResources are serializable? Are they
ever serialized?

Thanks,
Kaspar

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



Re: ListView#isVisible dilemma

2008-03-07 Thread Igor Vaynberg
i did mean listview.detach(), which will also detach the
model...seemed simpler to me

-igor


On Fri, Mar 7, 2008 at 1:15 AM, Edvin Syse [EMAIL PROTECTED] wrote:
 Maeder Thomas skrev:

  what he should do is follow the delete call with a
   listview.detach() call
  
  
   Probably just being thick here, but how does calling listview.detach()
   hide the listview?

  The point is not to hide the listview, but to refresh the content. I
  think Igor meant model.detach(), not listview.detach() though.

  -- Edvin



  -
  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]



RE: Use a panel as login panel rather than a different page with wicket auth

2008-03-07 Thread richardwilko

Yea, that would work, but its still having to manually intercept every link
that might go to a login protected area.  I was wondering if there was any
way to automatically call the 'modal.show(target);' instead of redirecting
to the login page.




Warren Bell wrote:
 
 I used AbstractAjaxTimerBehavior as kind of a password protected screen
 saver and the following code to get a modal window to open when the page
 is
 loaded. Body is a WebMarkuContainer representing the body tag. I used the
 standard Wicket modal window with a Panel.
 
 body.add(new AjaxEventBehavior(onload)
 {
   protected void onEvent(AjaxRequestTarget target)
   {
   modal.show(target);
   }
 });
 
 -Original Message-
 From: richardwilko [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 07, 2008 7:06 AM
 To: users@wicket.apache.org
 Subject: Use a panel as login panel rather than a different page with
 wicket auth



 Hi,

 We are using the wicket-auth stuff on our site.

 However rather than having a separate page for login we have a
 modal window
 in our page (not a wicket modal window, but a custom one, its basically a
 wicket panel in the page).

 Is there any way to make my code for popping up the modal execute when a
 login is needed rather than redirecting to a different page?  I
 know we can
 do this by checking if the user is logged in when a link is
 clicked and then
 running our code, but that kind of defeats the purpose of using the
 wicket
 auth stuff.

 Thanks,

 Richard
 --
 View this message in context:
 http://www.nabble.com/Use-a-panel-as-login-panel-rather-than-a-dif
 ferent-page-with-wicket-auth-tp15891186p15891186.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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

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

-- 
View this message in context: 
http://www.nabble.com/Use-a-panel-as-login-panel-rather-than-a-different-page-with-wicket-auth-tp15891186p15900036.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: ListView#isVisible dilemma

2008-03-07 Thread Igor Vaynberg
On Fri, Mar 7, 2008 at 12:31 AM, Maeder Thomas [EMAIL PROTECTED] wrote:
 Hi Igor,


  
   it is called that way for security reasons, eg so you cannot
   click a link that is not visible just because you know its url...

  Yes, but shouldn't the visibility be reevaluated anyway after the link
  is clicked? The clicking of the link, button, etc. usually changes the
  state of component, no?

it is reevaluated after the click listener is done.

   what he should do is follow the delete call with a
   listview.detach() call
  

  Probably just being thick here, but how does calling listview.detach()
  hide the listview?

it doesnt hide the listview, but it detaches the model. the problem was:
suppose you have one item in the list
1) check listview visibility - loads the detachable model with queryresult of 1
2) if visible execute click listener
3) click listener removes item from database
4) check listview visible during rendering - checks model size - sees
1 - visible - problem

with the change it is:
1) check listview visibility - loads the detachable model with queryresult of 1
2) if visible execute click listener
3) click listener removes item from database
4) click listener detaches listview - which in turn detaches its model
5) check listview visible during rendering - loads model (now
resultset of size 0) checks model size - sees 0 - invisible

-igor


  Thomas



  -
  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]



Re: RequestCycle.get() in WebResource

2008-03-07 Thread Johan Compagner
see for example Image
that one can old an Resource directly to make a session relative resource so
yes resources can be serialized

On Fri, Mar 7, 2008 at 5:31 PM, Kaspar Fischer [EMAIL PROTECTED] wrote:

 Johan, thanks a lot for your explanations!

 On 07.03.2008, at 15:47, Johan Compagner wrote:

  do you need a transaction around the resource when only the
  lastModifiedTimeStamp is ask for?

 Yes, unfortunately.

  is your resource really cachable?

 I am writing a WebResource that returns files from an external content
 repository. So yes: the resource should be cached by the browser and
 yes, I do have a lastModifiedTimeStamp.

 Or did you ask because I am using WebResource and not
 DynamicWebResource?
 I thought I am going to use WebResource as the content repository
 (Alfresco,
 in my case) probably already does some (server-side) caching and
 DynamicWebResource would add another level of server-side caching
 (right?).

  head request must be really fast because the happen a lot
  and you should not be loading so much then
 
  So you just have to see if you can create a resourcestream that only
  has the
  right timestamp

 Okay, got it.

 Btw, is there a reason why WebResources are serializable? Are they
 ever serialized?

 Thanks,
 Kaspar

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




Re: Use a panel as login panel rather than a different page with wicket auth

2008-03-07 Thread Maurice Marrink
I am not that familiar with the Wicket-auth api but i can tell you
that an ajaxpopup is not going to work unless your link is an ajaxlink
to. So you would have to build a custom popup that would show on the
page using a flag (show/hide) and a regular request which means all
your processing logic would have to check that flag to and do nothing
for that request so the user could log in first.
Frankly i wonder why you would go through so much trouble, just use a
login page. you can even wait with asking the user to login until he
actually is about to enter a page where you think he needs to login,
and after doing so he is returned to that page so he can continue his
business.

just my 2c.

Maurice

On Fri, Mar 7, 2008 at 5:34 PM, richardwilko
[EMAIL PROTECTED] wrote:

  Yea, that would work, but its still having to manually intercept every link
  that might go to a login protected area.  I was wondering if there was any
  way to automatically call the 'modal.show(target);' instead of redirecting
  to the login page.






  Warren Bell wrote:
  
   I used AbstractAjaxTimerBehavior as kind of a password protected screen
   saver and the following code to get a modal window to open when the page
   is
   loaded. Body is a WebMarkuContainer representing the body tag. I used the
   standard Wicket modal window with a Panel.
  
   body.add(new AjaxEventBehavior(onload)
   {
 protected void onEvent(AjaxRequestTarget target)
 {
 modal.show(target);
 }
   });
  
   -Original Message-
   From: richardwilko [mailto:[EMAIL PROTECTED]
   Sent: Friday, March 07, 2008 7:06 AM
   To: users@wicket.apache.org
   Subject: Use a panel as login panel rather than a different page with
   wicket auth
  
  
  
   Hi,
  
   We are using the wicket-auth stuff on our site.
  
   However rather than having a separate page for login we have a
   modal window
   in our page (not a wicket modal window, but a custom one, its basically a
   wicket panel in the page).
  
   Is there any way to make my code for popping up the modal execute when a
   login is needed rather than redirecting to a different page?  I
   know we can
   do this by checking if the user is logged in when a link is
   clicked and then
   running our code, but that kind of defeats the purpose of using the
   wicket
   auth stuff.
  
   Thanks,
  
   Richard
   --
   View this message in context:
   http://www.nabble.com/Use-a-panel-as-login-panel-rather-than-a-dif
   ferent-page-with-wicket-auth-tp15891186p15891186.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  

  --
  View this message in context: 
 http://www.nabble.com/Use-a-panel-as-login-panel-rather-than-a-different-page-with-wicket-auth-tp15891186p15900036.html


 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Enabling/disabling components dynamically

2008-03-07 Thread Maurice Marrink
2 ideas quicky come to mind:
- use a page global flag indicating the current mode.
 Then have every component on the page overwrite there isEnabled
method to use that flag
- build 2 panel one for read and one for edit, add either one
depending on the mode  to the page (using one id)

Maurice


On Fri, Mar 7, 2008 at 5:03 PM, Serzhas [EMAIL PROTECTED] wrote:

  Greetings.
  Let me explain: suppose we have a page with few components, where page
  itself
  can have few different modes - READ-ONLY, EDIT or CREATE mode. When in
  EDIT/CREATE mode, we want to let user to change components values. In
  READ-ONLY
  mode all components should be immutable. What is the best practices to
  achieve such
  page behavior (if any)?
  Thanks.
  --
  View this message in context: 
 http://www.nabble.com/Enabling-disabling-components-dynamically-tp15897799p15897799.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Use a panel as login panel rather than a different page with wicket auth

2008-03-07 Thread richardwilko


Thats a good point, I can just subclass AjaxLink, and make sure that it does
a check if the user is logged in before doing the main code, if not then
show my login box, then i can continue on to what the link was actually
supposed to do.

I do agree it would be easier to just redirect to a different page, but
thats not really an option.

Thanks,

Richard


-- 
View this message in context: 
http://www.nabble.com/Use-a-panel-as-login-panel-rather-than-a-different-page-with-wicket-auth-tp15891186p15900951.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: ListView#isVisible dilemma

2008-03-07 Thread Maeder Thomas
Thanks, now I get it.

   Probably just being thick here, but how does calling 
  listview.detach()  hide the listview?
 
 it doesnt hide the listview, but it detaches the model. the 
 problem was:
 suppose you have one item in the list
 1) check listview visibility - loads the detachable model 
 with queryresult of 1
 2) if visible execute click listener
 3) click listener removes item from database
 4) check listview visible during rendering - checks model size - sees
 1 - visible - problem
 
 with the change it is:
 1) check listview visibility - loads the detachable model 
 with queryresult of 1
 2) if visible execute click listener
 3) click listener removes item from database
 4) click listener detaches listview - which in turn detaches its model
 5) check listview visible during rendering - loads model (now 
 resultset of size 0) checks model size - sees 0 - invisible
 
 -igor
 

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



Re: Junit required for WicketTester?

2008-03-07 Thread Igor Vaynberg
i think tester uses junit's asserts, so yes.

-igor


On Fri, Mar 7, 2008 at 6:33 AM, reikje [EMAIL PROTECTED] wrote:

  Do you have to have junit.jar in the classpath if you want to use
  WicketTester? We are using TestNG here and in a regular TestNG test case
  (where the class is annotated with @Test), I get
  java.lang.NoClassDefFoundError: junit/framework/AssertionFailedError.
  --
  View this message in context: 
 http://www.nabble.com/Junit-required-for-WicketTester--tp15892202p15892202.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Sorting a list

2008-03-07 Thread jeredm

I was thinking about the move up/move down solutions, but my list is too
large.  I have found that with lists more than a few rows tall, the user
starts using the fork to eye technique.  For now I am just going to implment
the sort in the db...so each row gets the row's number in a text box and the
user can change the numbers to the correct order.  This solution does work
well, but it can be a hassle as the rows don't move until the user clicks
save and the table reloads.

Thomas Kappler-2 wrote:
 
 databinder has MoveUpButton and MoveDownButton, which do the job in
 ListViews.  If you don't use databinder, you can still have a look at
 the source.
 
 databinder.net
 
 Cheers,
 Thomas
 
 
 On Thu, Mar 6, 2008 at 6:35 PM, jeredm [EMAIL PROTECTED]
 wrote:

  I should have been more clear that I need to create a control to allow
 the
  user to change the order in a list.  I am able to sort the list before
 it is
  rendered just fine.  What I need to do is to loop through the table once
 it
  has been re-ordered by the user and then set a sort order in the DB
 based on
  the order of the rows in the table.

  I believe the solution Ryan mentioned earlier in this thread is capable
 of
  doing what I need, but I have not been able to get it to work yet in the
  context that I need it.  I was able to get his solution working with an
  unordered list in a WebPage, but the panel I need the list/table on is
  swapped in via AJAX which seems to be creating a javascript error.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Sorting-a-list-tp15862619p15901245.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]



Wicketstuff Rome / RSS reader page/panel etc..

2008-03-07 Thread Nino Saturnino Martinez Vazquez Wael

Hi

Just wonder if there are such a thing(could'nt find it)?

If not would it be okay if I added it?


regards.

--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: How to inject Spring Application context into WicketTester

2008-03-07 Thread Nino Saturnino Martinez Vazquez Wael

Checkout the blog tutorial, the unit test part

http://cwiki.apache.org/confluence/display/WICKET/Blog+Tutorial

Jörn Zaefferer wrote:

Hi,

my wicket applicatin uses the SpringComponentInjector and @SpringBean
annotations, which works great at runtime where the application
context is present.

I'd like to use WicketTester for JUnit tests:

tester = new WicketTester(new MyApplication());
In MyApplication#init, the component injector is created:
addComponentInstantiationListener(new SpringComponentInjector(this));
That constructor loads the ApplicationContext via
WebApplicationContextUtils.getRequiredWebApplicationContext(webapp.getServletContext()

That is the part which fails in my test, because there is no
ApplicationContext stored in the servlet context. How can I fix that?

My attempts so far:
The description here doesn't help:
http://cwiki.apache.org/WICKET/spring.html#Spring-UnitTestingtheProxyApproach
The injector is already configured at that point.

The alternative would be to put the application context into the
ServletContext, so that WebApplicationContextUtils can find it. I've
found no way to access MockWebApplication.context to set it manually,
though I was able to set it by overwriting newServletContext. Though
.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
context); where context is of type AnnotApplicationContextMock yields
an IllegalStateException, because AnnotApplicationContextMock doesn't
implement WebApplicationContext.

Thanks
Jörn

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


  


--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: spring problem! Panel Component could not get spring context beans,

2008-03-07 Thread Nino Saturnino Martinez Vazquez Wael
Check this out, it uses springcontext... Im in a very pasty mood today:)


http://cwiki.apache.org/confluence/display/WICKET/Blog+Tutorial

Mead wrote:
 well, a Panel Component could not get spring context beans, it got 
 java.lang.NullPointerException, but a WebPage Component is ok. 
   I use 
 'applicationFactoryClassName=org.apache.wicket.spring.SpringWebApplicationFactory'
  to config in the web.xml




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


   

-- 
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: Sorting a list

2008-03-07 Thread Nino Saturnino Martinez Vazquez Wael

hmm what about this one?

http://wiki.script.aculo.us/scriptaculous/show/SortableListsDemo

Not sure if its in the scriptaculous integration though..

regards Nino

PS if you want a reload to occur, could'nt just add an onchange/onblur 
behavior where you enter the row number? that way if the user enters 
something it will move there ..?


jeredm wrote:

I was thinking about the move up/move down solutions, but my list is too
large.  I have found that with lists more than a few rows tall, the user
starts using the fork to eye technique.  For now I am just going to implment
the sort in the db...so each row gets the row's number in a text box and the
user can change the numbers to the correct order.  This solution does work
well, but it can be a hassle as the rows don't move until the user clicks
save and the table reloads.

Thomas Kappler-2 wrote:
  

databinder has MoveUpButton and MoveDownButton, which do the job in
ListViews.  If you don't use databinder, you can still have a look at
the source.

databinder.net

Cheers,
Thomas


On Thu, Mar 6, 2008 at 6:35 PM, jeredm [EMAIL PROTECTED]
wrote:


 I should have been more clear that I need to create a control to allow
the
 user to change the order in a list.  I am able to sort the list before
it is
 rendered just fine.  What I need to do is to loop through the table once
it
 has been re-ordered by the user and then set a sort order in the DB
based on
 the order of the rows in the table.

 I believe the solution Ryan mentioned earlier in this thread is capable
of
 doing what I need, but I have not been able to get it to work yet in the
 context that I need it.  I was able to get his solution working with an
 unordered list in a WebPage, but the panel I need the list/table on is
 swapped in via AJAX which seems to be creating a javascript error.
  

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






  


--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: How to inject Spring Application context into WicketTester

2008-03-07 Thread Nino Saturnino Martinez Vazquez Wael

Eek I might have been wrong.. Sorry..

Nino Saturnino Martinez Vazquez Wael wrote:

Checkout the blog tutorial, the unit test part

http://cwiki.apache.org/confluence/display/WICKET/Blog+Tutorial

Jörn Zaefferer wrote:

Hi,

my wicket applicatin uses the SpringComponentInjector and @SpringBean
annotations, which works great at runtime where the application
context is present.

I'd like to use WicketTester for JUnit tests:

tester = new WicketTester(new MyApplication());
In MyApplication#init, the component injector is created:
addComponentInstantiationListener(new SpringComponentInjector(this));
That constructor loads the ApplicationContext via
WebApplicationContextUtils.getRequiredWebApplicationContext(webapp.getServletContext() 



That is the part which fails in my test, because there is no
ApplicationContext stored in the servlet context. How can I fix that?

My attempts so far:
The description here doesn't help:
http://cwiki.apache.org/WICKET/spring.html#Spring-UnitTestingtheProxyApproach 


The injector is already configured at that point.

The alternative would be to put the application context into the
ServletContext, so that WebApplicationContextUtils can find it. I've
found no way to access MockWebApplication.context to set it manually,
though I was able to set it by overwriting newServletContext. Though
.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, 


context); where context is of type AnnotApplicationContextMock yields
an IllegalStateException, because AnnotApplicationContextMock doesn't
implement WebApplicationContext.

Thanks
Jörn

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


  




--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: How to inject Spring Application context into WicketTester

2008-03-07 Thread Igor Vaynberg
spring wiki page shows how to set it up...

-igor


On Fri, Mar 7, 2008 at 3:11 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:
 Hi,

  my wicket applicatin uses the SpringComponentInjector and @SpringBean
  annotations, which works great at runtime where the application
  context is present.

  I'd like to use WicketTester for JUnit tests:

  tester = new WicketTester(new MyApplication());
  In MyApplication#init, the component injector is created:
  addComponentInstantiationListener(new SpringComponentInjector(this));
  That constructor loads the ApplicationContext via
  
 WebApplicationContextUtils.getRequiredWebApplicationContext(webapp.getServletContext()

  That is the part which fails in my test, because there is no
  ApplicationContext stored in the servlet context. How can I fix that?

  My attempts so far:
  The description here doesn't help:
  http://cwiki.apache.org/WICKET/spring.html#Spring-UnitTestingtheProxyApproach
  The injector is already configured at that point.

  The alternative would be to put the application context into the
  ServletContext, so that WebApplicationContextUtils can find it. I've
  found no way to access MockWebApplication.context to set it manually,
  though I was able to set it by overwriting newServletContext. Though
  .setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
  context); where context is of type AnnotApplicationContextMock yields
  an IllegalStateException, because AnnotApplicationContextMock doesn't
  implement WebApplicationContext.

  Thanks
  Jörn

  -
  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]



Re: spring problem! Panel Component could not get spring context beans,

2008-03-07 Thread Nino Saturnino Martinez Vazquez Wael
Eeek 2 secs..

try to add this in your constructor of the panel:

InjectorHolder.getInjector().inject(this);

regards Nino

Nino Saturnino Martinez Vazquez Wael wrote:
 Check this out, it uses springcontext... Im in a very pasty mood today:)


 http://cwiki.apache.org/confluence/display/WICKET/Blog+Tutorial

 Mead wrote:
   
 well, a Panel Component could not get spring context beans, it got 
 java.lang.NullPointerException, but a WebPage Component is ok. 
   I use 
 'applicationFactoryClassName=org.apache.wicket.spring.SpringWebApplicationFactory'
  to config in the web.xml




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


   
 

   

-- 
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: How to inject Spring Application context into WicketTester

2008-03-07 Thread Nino Saturnino Martinez Vazquez Wael

No I think its okay:) writing too many mails.. Check it out.. And ask..

Nino Saturnino Martinez Vazquez Wael wrote:

Eek I might have been wrong.. Sorry..

Nino Saturnino Martinez Vazquez Wael wrote:

Checkout the blog tutorial, the unit test part

http://cwiki.apache.org/confluence/display/WICKET/Blog+Tutorial

Jörn Zaefferer wrote:

Hi,

my wicket applicatin uses the SpringComponentInjector and @SpringBean
annotations, which works great at runtime where the application
context is present.

I'd like to use WicketTester for JUnit tests:

tester = new WicketTester(new MyApplication());
In MyApplication#init, the component injector is created:
addComponentInstantiationListener(new SpringComponentInjector(this));
That constructor loads the ApplicationContext via
WebApplicationContextUtils.getRequiredWebApplicationContext(webapp.getServletContext() 



That is the part which fails in my test, because there is no
ApplicationContext stored in the servlet context. How can I fix that?

My attempts so far:
The description here doesn't help:
http://cwiki.apache.org/WICKET/spring.html#Spring-UnitTestingtheProxyApproach 


The injector is already configured at that point.

The alternative would be to put the application context into the
ServletContext, so that WebApplicationContextUtils can find it. I've
found no way to access MockWebApplication.context to set it manually,
though I was able to set it by overwriting newServletContext. Though
.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, 


context); where context is of type AnnotApplicationContextMock yields
an IllegalStateException, because AnnotApplicationContextMock doesn't
implement WebApplicationContext.

Thanks
Jörn

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


  






--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: right click popup context menu

2008-03-07 Thread Doug Leeper

Take a look at wicket-contrib-yui.  There is a context menu (built on top of
YUI) contained in org.wicketstuff.yui.markup.html.menu2.contextMenu

There are some examples in wicketstuff-yui-examples for the Context Menu
(tree and list/data view)

Note: these are SVN projects located at
http://wicket-stuff.svn.sourceforge.net/viewvc/wicket-stuff/trunk/

Let me know if you have any questions as I am the author of this
contribution.

- Doug
-- 
View this message in context: 
http://www.nabble.com/right-click-popup-context-menu-tp15876468p15903821.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]



Load file from DB

2008-03-07 Thread Kaspar Fischer

Hi there,

I am struggling in implementing a (Web)Resource to load a file (not an
image) from an external source. Does anybody have/know of an example
that illustrates

* where/when to open the connection to the DB and start a transaction,
* fetch the file, and
* close the transaction?

I am trying to output to the browser a file from the Alfresco content
repository and need to perform similar steps.

Thanks,
Kaspar

P.S. Here's what I have, which results in ERROR - RequestCycle - Unable
to write the response.

public final class RepositoryFileResource extends WebResource
{
  private static final long serialVersionUID = 8406533594955148061L;

  private FileResourceStream stream;

  public RepositoryFileResource()
  {
setCacheable(true);
stream = new FileResourceStream();
  }

  @Override
  protected void setHeaders(WebResponse response)
  {
super.setHeaders(response);
  }

  @Override
  public IResourceStream getResourceStream()
  {
return this.stream;
  }

  @Override
  protected int getCacheDuration()
  {
return 48 * 3600; // 2 days
  }

  private final class FileResourceStream implements IResourceStream
  {
private static final long serialVersionUID = 390065327841658269L;

private NodeRef nodeRef;

private transient RepositoryContext context;
private transient UserTransaction transaction;
private transient ContentReader reader;
private transient InputStream contentStream;

void prepare()
{
  if (transaction != null)
return;

  // Determine node to deliver
  ValueMap params = getParameters();
  String nid = params.getString(nid);
  nodeRef = new NodeRef(KnowledgeCenterModel.STORE, nid);

  // Get request cycle
  context = RepositoryContext.get();
  try
  {
transaction =  
context.transactionService.getNonPropagatingUserTransaction();

transaction.begin();
context.authenticationService.authenticate(Website.LOGIN,  
Website.PASSWORD.toCharArray());
reader =  
context.serviceRegistry.getContentService().getReader(nodeRef,  
ContentModel.PROP_CONTENT);

  }
  catch (Exception e)
  {
throw new RuntimeException(Error..., e);
  }
}

public void close() throws IOException
{
  if (contentStream != null)
contentStream.close();
  try
  {
if (transaction != null)
  transaction.commit();
  }
  catch (Exception e)
  {
  }
  finally
  {
transaction = null;
  }
}

public String getContentType()
{
  prepare();
  return reader.getMimetype();
}

public InputStream getInputStream() throws  
ResourceStreamNotFoundException

{
  prepare();
  return contentStream = reader.getContentInputStream();
}

public Locale getLocale()
{
  // TODO
  return null;
}

public long length()
{
  prepare();
  return reader.getSize();
}

public void setLocale(Locale locale)
{
}

public Time lastModifiedTime()
{
  // TODO
  return null;
}
  }

}

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



Re: nljug wicket presentation

2008-03-07 Thread lars vonk
Depends on which date the meetup is?

Lars

On Fri, Mar 7, 2008 at 12:25 PM, Johan Compagner [EMAIL PROTECTED] wrote:
 translate it to English and do it also on the wicket meeting?



  On Fri, Mar 7, 2008 at 11:48 AM, lars vonk [EMAIL PROTECTED] wrote:

   Yes that's me. You're assumptions are right.
  
   Lars
  
   On Fri, Mar 7, 2008 at 11:45 AM, Maurice Marrink [EMAIL PROTECTED]
   wrote:
I just heard about a new Wicket presentation that will be held at the
 dutch java user group.
 Presentation:
   http://www.nljug.org/pages/events/content/jspring_2008/sessions/00035/
 Program:
   
 http://www.nljug.org/pages/events/content/jspring_2008/sessions/?template=showprogram.htmlfs=1
 Speaker will be Lars Vonk.
   
 most content of the website is in dutch as far as i could see and i
 assume the presentations will be too.
   
 Maurice
   
 -
 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]
  
  


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



PageLink and css class attribute

2008-03-07 Thread BretChampoux

Is there a way to programmatically alter the class attribute of the html that
is generated from a PageLink component? I've been looking and haven't been
able to find anything.

Thanks in advance for any assistance.

-- 
View this message in context: 
http://www.nabble.com/PageLink-and-css-class-attribute-tp15904062p15904062.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: PageLink and css class attribute

2008-03-07 Thread Igor Vaynberg
see (Simple)AttributeModifier

-igor


On Fri, Mar 7, 2008 at 11:30 AM, BretChampoux
[EMAIL PROTECTED] wrote:

  Is there a way to programmatically alter the class attribute of the html that
  is generated from a PageLink component? I've been looking and haven't been
  able to find anything.

  Thanks in advance for any assistance.

  --
  View this message in context: 
 http://www.nabble.com/PageLink-and-css-class-attribute-tp15904062p15904062.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



RE: right click popup context menu

2008-03-07 Thread Karen Schaper
Thanks for the reply Doug.

I actually found this project and now have a context menu appearing when
clicking on the id column for a row. Now I just need to make my different
actions actually work and the table refreshed.

Right now I using the TestAction inner class that is in your example.  In
the onClick method of the TestAction the targetId is the id of the row that
I am right clicking on to get the context menu.

Is there a way to get the object that the row is based on?


Thanks

Karen


 -Original Message-
 From: Doug Leeper [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 07, 2008 2:20 PM
 To: users@wicket.apache.org
 Subject: Re: right click popup context menu



 Take a look at wicket-contrib-yui.  There is a context menu
 (built on top of
 YUI) contained in org.wicketstuff.yui.markup.html.menu2.contextMenu

 There are some examples in wicketstuff-yui-examples for the Context Menu
 (tree and list/data view)

 Note: these are SVN projects located at
 http://wicket-stuff.svn.sourceforge.net/viewvc/wicket-stuff/trunk/

 Let me know if you have any questions as I am the author of this
 contribution.

 - Doug
 --
 View this message in context:
 http://www.nabble.com/right-click-popup-context-menu-tp15876468p15
903821.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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




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



DropDownChoice getting value into the model

2008-03-07 Thread rmattler

I've tried for 1 1/2 days to get this simple Drop Down to work and I'm
feeling stupid.  My mom tells me I'm smart.:-(

Everything works fine until I try to save it. I get the following error.  I
think it is trying to put the SelectOption object into the Model but I don't
know how to tell it to put the state var from SelectOption into my Vendor
object.




java.lang.UnsupportedOperationException: Model class
com.myprepress.pages.vendor.profile.VendorEntry$1 does not support
setObject(Object)

IModel vendorModel = new LoadableDetachableModel() {
protected Object load() {
return vendorDAO.load(tblId);

}
};

// add state
ArrayListSelectOption states = new ArrayListSelectOption();
states.add(new SelectOption(AL, Alabama));
states.add(new SelectOption(OH, Ohio));
states.add(new SelectOption(NY, New York));
ChoiceRenderer choiceRenderer = new ChoiceRenderer(display, 
state);

DropDownChoice stateFC = new DropDownChoice(state, 
vendorModel, new
Model(states), choiceRenderer);


public class SelectOption implements Serializable {

private String state;
private String display;


-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15905486.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: Wicketstuff Rome / RSS reader page/panel etc..

2008-03-07 Thread Sean Sullivan
Try wicketstuff-rome:

http://wicket-stuff.svn.sf.net/svnroot/wicket-stuff/trunk/wicketstuff-rome/

http://wicket-stuff.svn.sf.net/svnroot/wicket-stuff/trunk/wicketstuff-rome-examples/





On 3/7/08, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]
wrote:

 Hi

 Just wonder if there are such a thing(could'nt find it)?

 If not would it be okay if I added it?




Wicket 1.3 relative path problem

2008-03-07 Thread Renan Camponez
Hi..
I have a image.. in my HTML it is  img
src=resources/images/ibFind.gif/.. After wicket, it is img
src=../../../../resources/images/ibFind.gif
But I need to have absolute path instead of ../../../

What should I override? What is responsible to do that replace?
I've already tried to override the WicketFilter getRelativePath() method,
but it doesn't works..

Please, help!
Thanks,
Renan


Re: DropDownChoice getting value into the model

2008-03-07 Thread Igor Vaynberg
two problems

1) loadable detachable models do not support the setobject() call,
because they are...loadable. so you should use a different kind of
model.

2) yes, selectoption object will be put into your model, dropdown
choice works like this:

DropDownChoiceT(String id, IModelT model, IModelListT choices,
IChoiceRenrererT renderer)

-igor


On Fri, Mar 7, 2008 at 12:37 PM, rmattler [EMAIL PROTECTED] wrote:

  I've tried for 1 1/2 days to get this simple Drop Down to work and I'm
  feeling stupid.  My mom tells me I'm smart.:-(

  Everything works fine until I try to save it. I get the following error.  I
  think it is trying to put the SelectOption object into the Model but I don't
  know how to tell it to put the state var from SelectOption into my Vendor
  object.




  java.lang.UnsupportedOperationException: Model class
  com.myprepress.pages.vendor.profile.VendorEntry$1 does not support
  setObject(Object)

  IModel vendorModel = new LoadableDetachableModel() {
 protected Object load() {
 return vendorDAO.load(tblId);

 }
 };

  // add state
 ArrayListSelectOption states = new 
 ArrayListSelectOption();
 states.add(new SelectOption(AL, Alabama));
 states.add(new SelectOption(OH, Ohio));
 states.add(new SelectOption(NY, New York));
 ChoiceRenderer choiceRenderer = new ChoiceRenderer(display, 
 state);

 DropDownChoice stateFC = new DropDownChoice(state, 
 vendorModel, new
  Model(states), choiceRenderer);


  public class SelectOption implements Serializable {

 private String state;
 private String display;


  --
  View this message in context: 
 http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15905486.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Wicket 1.3 relative path problem

2008-03-07 Thread Igor Vaynberg
use ContextImage class

also current wicket takes over contextroot/resources directory, so you
might want to use something else.

-igor


On Fri, Mar 7, 2008 at 12:43 PM, Renan Camponez [EMAIL PROTECTED] wrote:
 Hi..
  I have a image.. in my HTML it is  img
  src=resources/images/ibFind.gif/.. After wicket, it is img
  src=../../../../resources/images/ibFind.gif
  But I need to have absolute path instead of ../../../

  What should I override? What is responsible to do that replace?
  I've already tried to override the WicketFilter getRelativePath() method,
  but it doesn't works..

  Please, help!
  Thanks,
  Renan


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



RE: DropDownChoice getting value into the model

2008-03-07 Thread Kai Mutz
[EMAIL PROTECTED]  wrote:
 I've tried for 1 1/2 days to get this simple Drop Down to work and I'm
 feeling stupid.  My mom tells me I'm smart.:-(

 Everything works fine until I try to save it. I get the following
 error.  I
 think it is trying to put the SelectOption object into the Model
 but I don't
 know how to tell it to put the state var from SelectOption into my
 Vendor object.

Does your Vendor object have an field of type SelectOption? If not which
field do you want to set with the select box?

Perhaps this helps:
http://cwiki.apache.org/WICKET/another-dropdownchoice-example-by-adam.html

Kai


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



Re: Wicket 1.3 relative path problem

2008-03-07 Thread Renan Camponez
Igor,
Thanks for quick answer...
My problem is a little more difficult to solve..
The problem is that I have a servlet at /app/mainservlet who handle if all
requests...
If i do a request to wicket Page, it redirects me to wicket servlet.. But my
URL remains the same..

That means that I'm acessing for example:
/app/mainservlet/getWicket1

This goes to the wicketservlet, and returns the page... With all relative
images, buttons, ajaxSubmitLinks...
The onclick method for ajaxSubmit links are ../../../../ too.. But as I am
at /app/mainservlet, it goes wrong...

Thats my real problem... Any ideia?

On Fri, Mar 7, 2008 at 6:00 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 use ContextImage class

 also current wicket takes over contextroot/resources directory, so you
 might want to use something else.

 -igor


 On Fri, Mar 7, 2008 at 12:43 PM, Renan Camponez [EMAIL PROTECTED]
 wrote:
  Hi..
   I have a image.. in my HTML it is  img
   src=resources/images/ibFind.gif/.. After wicket, it is img
   src=../../../../resources/images/ibFind.gif
   But I need to have absolute path instead of ../../../
 
   What should I override? What is responsible to do that replace?
   I've already tried to override the WicketFilter getRelativePath()
 method,
   but it doesn't works..
 
   Please, help!
   Thanks,
   Renan
 

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




Re: Wicketstuff Rome / RSS reader page/panel etc..

2008-03-07 Thread Ryan Sonnek
Are you looking for how to *publish* RSS feeds, or consume them?

the wicketstuff-rome project helps with publishing RSS feeds from
within your application.

If you're looking to consume rss feeds, ROME makes it pretty trivial
to do.  Not sure how much value there is for a generic display RSS
feeds panel.  BUT, if think it'd be worthwhile, let me know!  I'd be
happy to add it to the wicketstuff-rome project.

On Fri, Mar 7, 2008 at 2:41 PM, Sean Sullivan [EMAIL PROTECTED] wrote:
 Try wicketstuff-rome:

  http://wicket-stuff.svn.sf.net/svnroot/wicket-stuff/trunk/wicketstuff-rome/

  
 http://wicket-stuff.svn.sf.net/svnroot/wicket-stuff/trunk/wicketstuff-rome-examples/





  On 3/7/08, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]
  wrote:


 
   Hi
  
   Just wonder if there are such a thing(could'nt find it)?
  
   If not would it be okay if I added it?
  
  


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



Re: Wicket 1.3 relative path problem

2008-03-07 Thread Igor Vaynberg
so a nonwicket /app/mainservlet servlet redirects to the wicket servlet?

-igor


On Fri, Mar 7, 2008 at 1:05 PM, Renan Camponez [EMAIL PROTECTED] wrote:
 Igor,
  Thanks for quick answer...
  My problem is a little more difficult to solve..
  The problem is that I have a servlet at /app/mainservlet who handle if all
  requests...
  If i do a request to wicket Page, it redirects me to wicket servlet.. But my
  URL remains the same..

  That means that I'm acessing for example:
  /app/mainservlet/getWicket1

  This goes to the wicketservlet, and returns the page... With all relative
  images, buttons, ajaxSubmitLinks...
  The onclick method for ajaxSubmit links are ../../../../ too.. But as I am
  at /app/mainservlet, it goes wrong...

  Thats my real problem... Any ideia?

  On Fri, Mar 7, 2008 at 6:00 PM, Igor Vaynberg [EMAIL PROTECTED]
  wrote:



   use ContextImage class
  
   also current wicket takes over contextroot/resources directory, so you
   might want to use something else.
  
   -igor
  
  
   On Fri, Mar 7, 2008 at 12:43 PM, Renan Camponez [EMAIL PROTECTED]
   wrote:
Hi..
 I have a image.. in my HTML it is  img
 src=resources/images/ibFind.gif/.. After wicket, it is img
 src=../../../../resources/images/ibFind.gif
 But I need to have absolute path instead of ../../../
   
 What should I override? What is responsible to do that replace?
 I've already tried to override the WicketFilter getRelativePath()
   method,
 but it doesn't works..
   
 Please, help!
 Thanks,
 Renan
   
  
   -
   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]



Re: Wicket 1.3 relative path problem

2008-03-07 Thread Renan Camponez
Exacly..


On Fri, Mar 7, 2008 at 6:34 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 so a nonwicket /app/mainservlet servlet redirects to the wicket servlet?

 -igor


 On Fri, Mar 7, 2008 at 1:05 PM, Renan Camponez [EMAIL PROTECTED]
 wrote:
  Igor,
   Thanks for quick answer...
   My problem is a little more difficult to solve..
   The problem is that I have a servlet at /app/mainservlet who handle if
 all
   requests...
   If i do a request to wicket Page, it redirects me to wicket servlet..
 But my
   URL remains the same..
 
   That means that I'm acessing for example:
   /app/mainservlet/getWicket1
 
   This goes to the wicketservlet, and returns the page... With all
 relative
   images, buttons, ajaxSubmitLinks...
   The onclick method for ajaxSubmit links are ../../../../ too.. But as
 I am
   at /app/mainservlet, it goes wrong...
 
   Thats my real problem... Any ideia?
 
   On Fri, Mar 7, 2008 at 6:00 PM, Igor Vaynberg [EMAIL PROTECTED]
   wrote:
 
 
 
use ContextImage class
   
also current wicket takes over contextroot/resources directory, so
 you
might want to use something else.
   
-igor
   
   
On Fri, Mar 7, 2008 at 12:43 PM, Renan Camponez 
 [EMAIL PROTECTED]
wrote:
 Hi..
  I have a image.. in my HTML it is  img
  src=resources/images/ibFind.gif/.. After wicket, it is img
  src=../../../../resources/images/ibFind.gif
  But I need to have absolute path instead of ../../../

  What should I override? What is responsible to do that replace?
  I've already tried to override the WicketFilter getRelativePath()
method,
  but it doesn't works..

  Please, help!
  Thanks,
  Renan

   
-
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]




Re: Wicket 1.3 relative path problem

2008-03-07 Thread Renan Camponez
The problem is that at wicket 1.2 it works...
Bcs wicket 1.2 use /myapp/wicketservlet/blabla..


On Fri, Mar 7, 2008 at 6:39 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 hrm, dont know if we support that kind of thing, or took it into
 consideration while testing.

 can you not use wicket as a filter that gets hit before your servlet?

 -igor


 On Fri, Mar 7, 2008 at 1:37 PM, Renan Camponez [EMAIL PROTECTED]
 wrote:
  Exacly..
 
 
   On Fri, Mar 7, 2008 at 6:34 PM, Igor Vaynberg [EMAIL PROTECTED]
 
 
  wrote:
 
so a nonwicket /app/mainservlet servlet redirects to the wicket
 servlet?
   
-igor
   
   
On Fri, Mar 7, 2008 at 1:05 PM, Renan Camponez 
 [EMAIL PROTECTED]
wrote:
 Igor,
  Thanks for quick answer...
  My problem is a little more difficult to solve..
  The problem is that I have a servlet at /app/mainservlet who
 handle if
all
  requests...
  If i do a request to wicket Page, it redirects me to wicket
 servlet..
But my
  URL remains the same..

  That means that I'm acessing for example:
  /app/mainservlet/getWicket1

  This goes to the wicketservlet, and returns the page... With all
relative
  images, buttons, ajaxSubmitLinks...
  The onclick method for ajaxSubmit links are ../../../../ too..
 But as
I am
  at /app/mainservlet, it goes wrong...

  Thats my real problem... Any ideia?

  On Fri, Mar 7, 2008 at 6:00 PM, Igor Vaynberg 
 [EMAIL PROTECTED]
  wrote:



   use ContextImage class
  
   also current wicket takes over contextroot/resources directory,
 so
you
   might want to use something else.
  
   -igor
  
  
   On Fri, Mar 7, 2008 at 12:43 PM, Renan Camponez 
[EMAIL PROTECTED]
   wrote:
Hi..
 I have a image.. in my HTML it is  img
 src=resources/images/ibFind.gif/.. After wicket, it is
 img
 src=../../../../resources/images/ibFind.gif
 But I need to have absolute path instead of ../../../
   
 What should I override? What is responsible to do that
 replace?
 I've already tried to override the WicketFilter
 getRelativePath()
   method,
 but it doesn't works..
   
 Please, help!
 Thanks,
 Renan
   
  
  
 -
   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]
   
   
 

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




Re: Wicket 1.3 relative path problem

2008-03-07 Thread Igor Vaynberg
wicket 1.3 is not backwards compatible with 1.2

-igor


On Fri, Mar 7, 2008 at 1:45 PM, Renan Camponez [EMAIL PROTECTED] wrote:
 The problem is that at wicket 1.2 it works...
  Bcs wicket 1.2 use /myapp/wicketservlet/blabla..


  On Fri, Mar 7, 2008 at 6:39 PM, Igor Vaynberg [EMAIL PROTECTED]


 wrote:

   hrm, dont know if we support that kind of thing, or took it into
   consideration while testing.
  
   can you not use wicket as a filter that gets hit before your servlet?
  
   -igor
  
  
   On Fri, Mar 7, 2008 at 1:37 PM, Renan Camponez [EMAIL PROTECTED]
   wrote:
Exacly..
   
   
 On Fri, Mar 7, 2008 at 6:34 PM, Igor Vaynberg [EMAIL PROTECTED]
   
   
wrote:
   
  so a nonwicket /app/mainservlet servlet redirects to the wicket
   servlet?
 
  -igor
 
 
  On Fri, Mar 7, 2008 at 1:05 PM, Renan Camponez 
   [EMAIL PROTECTED]
  wrote:
   Igor,
Thanks for quick answer...
My problem is a little more difficult to solve..
The problem is that I have a servlet at /app/mainservlet who
   handle if
  all
requests...
If i do a request to wicket Page, it redirects me to wicket
   servlet..
  But my
URL remains the same..
  
That means that I'm acessing for example:
/app/mainservlet/getWicket1
  
This goes to the wicketservlet, and returns the page... With all
  relative
images, buttons, ajaxSubmitLinks...
The onclick method for ajaxSubmit links are ../../../../ too..
   But as
  I am
at /app/mainservlet, it goes wrong...
  
Thats my real problem... Any ideia?
  
On Fri, Mar 7, 2008 at 6:00 PM, Igor Vaynberg 
   [EMAIL PROTECTED]
wrote:
  
  
  
 use ContextImage class

 also current wicket takes over contextroot/resources directory,
   so
  you
 might want to use something else.

 -igor


 On Fri, Mar 7, 2008 at 12:43 PM, Renan Camponez 
  [EMAIL PROTECTED]
 wrote:
  Hi..
   I have a image.. in my HTML it is  img
   src=resources/images/ibFind.gif/.. After wicket, it is
   img
   src=../../../../resources/images/ibFind.gif
   But I need to have absolute path instead of ../../../
 
   What should I override? What is responsible to do that
   replace?
   I've already tried to override the WicketFilter
   getRelativePath()
 method,
   but it doesn't works..
 
   Please, help!
   Thanks,
   Renan
 


   -
 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]
 
 
   
  
   -
   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]



Re: DropDownChoice getting value into the model

2008-03-07 Thread rmattler

Thanks for the quick reply.  But you answer doesn't make sense to me.  Why do
loadable models work for a text field but not a drop down?  If I have NY
stored in the database, New York is loaded onto the form but when the form
is submitted the selected value of the drop down is not saved into the
model.  I'm trying to get the selected value stored into the Vendor object
and a String not a SelectOption.

public class Vendor implements java.io.Serializable {

private String state;




two problems

1) loadable detachable models do not support the setobject() call,
because they are...loadable. so you should use a different kind of
model.

2) yes, selectoption object will be put into your model, dropdown
choice works like this:

DropDownChoiceT(String id, IModelT model, IModelListT choices,
IChoiceRenrererT renderer)

-igor


-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15907046.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket 1.3 relative path problem

2008-03-07 Thread Renan Camponez
I know that... Thats my problem..  :)

On Fri, Mar 7, 2008 at 6:47 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 wicket 1.3 is not backwards compatible with 1.2

 -igor


 On Fri, Mar 7, 2008 at 1:45 PM, Renan Camponez [EMAIL PROTECTED]
 wrote:
  The problem is that at wicket 1.2 it works...
   Bcs wicket 1.2 use /myapp/wicketservlet/blabla..
 
 
   On Fri, Mar 7, 2008 at 6:39 PM, Igor Vaynberg [EMAIL PROTECTED]
 
 
  wrote:
 
hrm, dont know if we support that kind of thing, or took it into
consideration while testing.
   
can you not use wicket as a filter that gets hit before your servlet?
   
-igor
   
   
On Fri, Mar 7, 2008 at 1:37 PM, Renan Camponez 
 [EMAIL PROTECTED]
wrote:
 Exacly..


  On Fri, Mar 7, 2008 at 6:34 PM, Igor Vaynberg 
 [EMAIL PROTECTED]


 wrote:

   so a nonwicket /app/mainservlet servlet redirects to the wicket
servlet?
  
   -igor
  
  
   On Fri, Mar 7, 2008 at 1:05 PM, Renan Camponez 
[EMAIL PROTECTED]
   wrote:
Igor,
 Thanks for quick answer...
 My problem is a little more difficult to solve..
 The problem is that I have a servlet at /app/mainservlet who
handle if
   all
 requests...
 If i do a request to wicket Page, it redirects me to wicket
servlet..
   But my
 URL remains the same..
   
 That means that I'm acessing for example:
 /app/mainservlet/getWicket1
   
 This goes to the wicketservlet, and returns the page... With
 all
   relative
 images, buttons, ajaxSubmitLinks...
 The onclick method for ajaxSubmit links are ../../../../
 too..
But as
   I am
 at /app/mainservlet, it goes wrong...
   
 Thats my real problem... Any ideia?
   
 On Fri, Mar 7, 2008 at 6:00 PM, Igor Vaynberg 
[EMAIL PROTECTED]
 wrote:
   
   
   
  use ContextImage class
 
  also current wicket takes over contextroot/resources
 directory,
so
   you
  might want to use something else.
 
  -igor
 
 
  On Fri, Mar 7, 2008 at 12:43 PM, Renan Camponez 
   [EMAIL PROTECTED]
  wrote:
   Hi..
I have a image.. in my HTML it is  img
src=resources/images/ibFind.gif/.. After wicket, it
 is
img
src=../../../../resources/images/ibFind.gif
But I need to have absolute path instead of
 ../../../
  
What should I override? What is responsible to do that
replace?
I've already tried to override the WicketFilter
getRelativePath()
  method,
but it doesn't works..
  
Please, help!
Thanks,
Renan
  
 
 
-
  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]
  
  

   
-
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]




Re: nljug wicket presentation

2008-03-07 Thread Maurice Marrink
Still to be determined but mostlikely candidates are Friday April 4th,
Monday April 7th, Tuesday April 8th.

See 
http://cwiki.apache.org/confluence/display/WICKET/Wicket+Community+meetups+-+Amsterdam

Maurice

On Fri, Mar 7, 2008 at 8:28 PM, lars vonk [EMAIL PROTECTED] wrote:
 Depends on which date the meetup is?

  Lars



  On Fri, Mar 7, 2008 at 12:25 PM, Johan Compagner [EMAIL PROTECTED] wrote:
   translate it to English and do it also on the wicket meeting?
  
  
  
On Fri, Mar 7, 2008 at 11:48 AM, lars vonk [EMAIL PROTECTED] wrote:
  
 Yes that's me. You're assumptions are right.

 Lars

 On Fri, Mar 7, 2008 at 11:45 AM, Maurice Marrink [EMAIL PROTECTED]
 wrote:
  I just heard about a new Wicket presentation that will be held at the
   dutch java user group.
   Presentation:
 http://www.nljug.org/pages/events/content/jspring_2008/sessions/00035/
   Program:
 
 http://www.nljug.org/pages/events/content/jspring_2008/sessions/?template=showprogram.htmlfs=1
   Speaker will be Lars Vonk.
 
   most content of the website is in dutch as far as i could see and i
   assume the presentations will be too.
 
   Maurice
 
   -
   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]


  

  -
  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]



Re: DropDownChoice getting value into the model

2008-03-07 Thread Igor Vaynberg
perhaps because your textfield is setting a property of the object
loaded by the model, not the object itself.

-igor


On Fri, Mar 7, 2008 at 1:48 PM, rmattler [EMAIL PROTECTED] wrote:

  Thanks for the quick reply.  But you answer doesn't make sense to me.  Why do
  loadable models work for a text field but not a drop down?  If I have NY
  stored in the database, New York is loaded onto the form but when the form
  is submitted the selected value of the drop down is not saved into the
  model.  I'm trying to get the selected value stored into the Vendor object
  and a String not a SelectOption.

  public class Vendor implements java.io.Serializable {

 private String state;





  two problems

  1) loadable detachable models do not support the setobject() call,
  because they are...loadable. so you should use a different kind of
  model.

  2) yes, selectoption object will be put into your model, dropdown
  choice works like this:

  DropDownChoiceT(String id, IModelT model, IModelListT choices,
  IChoiceRenrererT renderer)

  -igor


  --
  View this message in context: 
 http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15907046.html


 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: DropDownChoice getting value into the model

2008-03-07 Thread rmattler

It is nice to know I'm not the only one struggling with DropDownChoices.  I'm
new to Wicket and I'm pretty far with rebuilding an application we are using
internally.  Has anybody proposed an alternative or a wrapper to
DropDownChoices?   



Vitaly Tsaplin wrote:
 
The DropDownBox component is in fact well designed in theory. But I
 think the way it works is a bit inconvenient in practice. Normally the
 main purpose of this component in to supply some value or an index for
 a model but a label is needed only for to be presented to a user.
 Unfortunately we are supposed  to use either the same value (a string
 representation) for both pupposes or to use some kind of a wrapper and
 to pollute the model by some strange SelectOption object even though
 that the model would normally accept an integer.
 
Vitaly
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15907346.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]



Sort order in DataView with ListDataProvider

2008-03-07 Thread Michael Mehrle
I'm passing a ListDataProvider when creating a DataView that shows rows
of comments. Each comment has a name, a date, and a message. I am
creating the ListDataProvider with an ArrayList, which also has been
sorted with a Comparator on the date.

For whatever reason on the final page my comments are however sorted
alphabetically by the message. What am I doing wrong here? I thought
that sorting the list passed into the ListDataProvider was sufficient.

Any help would be appreciated.

Michael


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



Re: Sort order in DataView with ListDataProvider

2008-03-07 Thread Igor Vaynberg
paste your code

-igor


On Fri, Mar 7, 2008 at 2:03 PM, Michael Mehrle [EMAIL PROTECTED] wrote:
 I'm passing a ListDataProvider when creating a DataView that shows rows
  of comments. Each comment has a name, a date, and a message. I am
  creating the ListDataProvider with an ArrayList, which also has been
  sorted with a Comparator on the date.

  For whatever reason on the final page my comments are however sorted
  alphabetically by the message. What am I doing wrong here? I thought
  that sorting the list passed into the ListDataProvider was sufficient.

  Any help would be appreciated.

  Michael


  -
  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]



RE: DropDownChoice getting value into the model

2008-03-07 Thread Kai Mutz
[EMAIL PROTECTED]  wrote:
 It is nice to know I'm not the only one struggling with
 DropDownChoices.  I'm new to Wicket and I'm pretty far with
 rebuilding an application we are using internally.  Has anybody
 proposed an alternative or a wrapper to DropDownChoices?

Have you tried something like:

Vendor vendor = (Vendor) vendorModel.getObject();

DropDownChoice stateFC = new DropDownChoice(state, new
PropertyModel(vendor, state), new Model(states), choiceRenderer);

This should work.

Kai


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



RE: DropDownChoice getting value into the model

2008-03-07 Thread rmattler

Thanks for trying but I get:

WicketMessage: No get method defined for class: class java.lang.String
expression: state



Kai Mütz wrote:
 
 [EMAIL PROTECTED]  wrote:
 It is nice to know I'm not the only one struggling with
 DropDownChoices.  I'm new to Wicket and I'm pretty far with
 rebuilding an application we are using internally.  Has anybody
 proposed an alternative or a wrapper to DropDownChoices?
 
 Have you tried something like:
 
 Vendor vendor = (Vendor) vendorModel.getObject();
 
 DropDownChoice stateFC = new DropDownChoice(state, new
 PropertyModel(vendor, state), new Model(states), choiceRenderer);
 
 This should work.
 
 Kai
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15907691.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: Sorting a list

2008-03-07 Thread jeredm

That is the library that Ryan had  a Wicket wrapper for that I tried and
couldn't get working.  The onblur may work.  I will have to build a test to
see if it is too much for the feel I am looking for.  Thanks everybody for
the great ideas!

Nino.Martinez wrote:
 
 hmm what about this one?
 
 http://wiki.script.aculo.us/scriptaculous/show/SortableListsDemo
 
 Not sure if its in the scriptaculous integration though..
 
 regards Nino
 
 PS if you want a reload to occur, could'nt just add an onchange/onblur 
 behavior where you enter the row number? that way if the user enters 
 something it will move there ..?
 
 jeredm wrote:
 I was thinking about the move up/move down solutions, but my list is too
 large.  I have found that with lists more than a few rows tall, the user
 starts using the fork to eye technique.  For now I am just going to
 implment
 the sort in the db...so each row gets the row's number in a text box and
 the
 user can change the numbers to the correct order.  This solution does
 work
 well, but it can be a hassle as the rows don't move until the user clicks
 save and the table reloads.

 Thomas Kappler-2 wrote:
   
 databinder has MoveUpButton and MoveDownButton, which do the job in
 ListViews.  If you don't use databinder, you can still have a look at
 the source.

 databinder.net

 Cheers,
 Thomas


 On Thu, Mar 6, 2008 at 6:35 PM, jeredm [EMAIL PROTECTED]
 wrote:
 
  I should have been more clear that I need to create a control to allow
 the
  user to change the order in a list.  I am able to sort the list before
 it is
  rendered just fine.  What I need to do is to loop through the table
 once
 it
  has been re-ordered by the user and then set a sort order in the DB
 based on
  the order of the rows in the table.

  I believe the solution Ryan mentioned earlier in this thread is
 capable
 of
  doing what I need, but I have not been able to get it to work yet in
 the
  context that I need it.  I was able to get his solution working with
 an
  unordered list in a WebPage, but the panel I need the list/table on is
  swapped in via AJAX which seems to be creating a javascript error.
   
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 

   
 
 -- 
 -Wicket for love
 -Jme for fun
 
 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Sorting-a-list-tp15862619p15907810.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: DropDownChoice getting value into the model

2008-03-07 Thread Kai Mütz
[EMAIL PROTECTED]  wrote:
 Thanks for trying but I get:
 
 WicketMessage: No get method defined for class: class
 java.lang.String expression: state 

Have you defined a getter/setter for field state in your vendor class?


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



RE: DropDownChoice getting value into the model

2008-03-07 Thread rmattler

Yes

@Column(name = state, length = 2)
public String getState() {
return this.state;
}

public void setState(String state) {
this.state = state;
}


Kai Mütz wrote:
 
 [EMAIL PROTECTED]  wrote:
 Thanks for trying but I get:
 
 WicketMessage: No get method defined for class: class
 java.lang.String expression: state 
 
 Have you defined a getter/setter for field state in your vendor class?
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15907944.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: right click popup context menu

2008-03-07 Thread Doug Leeper

In the populateItem, you will need to do the following:


contextMenuBehavior.applyAttributes(item, popupMenu, new Model( rowId));

Where rowId is the value you are looking for when the action has been
selected (the targetId in the onClick method)

private class MyAction extends AbstractYuiMenuAction implements
IYuiMenuAjaxAction {

  public void onClick(AjaxRequestTarget target, String targetId) {
   // targetId == the rowId in applyAttributes
  }
}
-- 
View this message in context: 
http://www.nabble.com/right-click-popup-context-menu-tp15876468p15908004.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: Sort order in DataView with ListDataProvider

2008-03-07 Thread Michael Mehrle
Okay - some needed input first:

- addComments is called inside the constructor of a Panel.
- FooCommentComparator sorts on a java.util.Date field inside of
FooComment
- FooComment has a user, date, and message field
- For some reason the panel shows the comments sorted by the comment's
message field 

private void addComments() {
ListFooComment comments = getComments();
IDataProvider dataProvider = new ListDataProvider(comments);
DataView commentPanels = new DataView(fooPanels, dataProvider,
PAGE_LENGTH) {
private static final long serialVersionUID =
-3952819461137344195L;

protected void populateItem(Item item) {
item.add(new FooCommentPanel(commentPanel,
item.getModel()));
}
};
add(commentPanels);
PagingNavigator navigator = new PagingNavigator(navigator,
commentPanels);
add(navigator);
// if there aren't too few comments hide the navigator
if (comments.size() = PAGE_LENGTH) {
navigator.setVisible(false);
}
}

private ListFooComment getComments() {
ListFooComment list = new ArrayListFooComment(((Foo)
CommentFormPanel.this.getModelObject()).getComments());
Collections.sort(list, new FooCommentComparator());
if (list == null) {
list = new ArrayListFooComment();
}
int size = list.size();
if (LOG.isDebugEnabled()) {
String singPlur = size == 1 ?  comment. :  comments.;
LOG.debug(Foo has  + size + singPlur);
}
return list;
}


-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 07, 2008 2:07 PM
To: users@wicket.apache.org
Subject: Re: Sort order in DataView with ListDataProvider

paste your code

-igor


On Fri, Mar 7, 2008 at 2:03 PM, Michael Mehrle [EMAIL PROTECTED]
wrote:
 I'm passing a ListDataProvider when creating a DataView that shows
rows
  of comments. Each comment has a name, a date, and a message. I am
  creating the ListDataProvider with an ArrayList, which also has been
  sorted with a Comparator on the date.

  For whatever reason on the final page my comments are however sorted
  alphabetically by the message. What am I doing wrong here? I thought
  that sorting the list passed into the ListDataProvider was
sufficient.

  Any help would be appreciated.

  Michael


  -
  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]


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



RE: Problem when MIgrating from 1.2 to 1.3 - Parameters removed from HomePage URL

2008-03-07 Thread David Leangen

I dunno.

I thought you were talking about mounted urls, whose urls displays are
rendered by a UrlCodingStrategy. If you're using the
QueryStringUrlCodingStrategy, then my guess is that it's relevant.

If you want to know for sure, try applying the patch to your local wicket,
or maybe try adding a break and debugging at the lines changed by the patch.
If that doesn't work, then I guess you'd better post your question again.


Cheers,
Dave




 -Original Message-
 From: Rajiv Jivan [mailto:[EMAIL PROTECTED]
 Sent: 8 March 2008 00:28
 To: users@wicket.apache.org
 Subject: Re: Problem when MIgrating from 1.2 to 1.3 - Parameters
 removed from HomePage URL


 Are we talking about the same thing? Your patch removes the trailing /
 while in my case without the trailing / the parameters aren't
 recognized.

 On Thu, Mar 6, 2008 at 6:11 PM, David Leangen [EMAIL PROTECTED] wrote:
 
   I've already filed an issue and submitted a patch for this:
 
https://issues.apache.org/jira/browse/WICKET-1385
 
 
   Cheers,
   Dave
 
 
 
 
 
-Original Message-
From: Rajiv Jivan [mailto:[EMAIL PROTECTED]
Sent: 7 March 2008 05:47
To: users@wicket.apache.org
Subject: Problem when MIgrating from 1.2 to 1.3 - Parameters
removed from HomePage URL
   
   
We have a site developed using Wicket 1.2. One of the use cases we
have is to pass in a parameter on the home page, and based on that we
perform some actions. e.g
   
http://localhost/helloworld?name=John
   
This functionality seem to be broken in 1.3. When passing in
parameters on the home page URL they are stripped. Going through the
Wicket I have narrowed down to an issue in WicketFilter
   
// Special-case for home page - we redirect to add a
trailing slash.
if (relativePath.length() == 0 
   
   
 !Strings.stripJSessionId(servletRequest.getRequestURI()).endsWith(/))
{
final String redirectUrl =
servletRequest.getRequestURI() + /;
   
servletResponse.sendRedirect(servletResponse.encodeRedirectURL(red
irectUrl));
return;
}
   
The only workaround I have is to change the URL to
http://localhost/helloworld/?name=John
Notice the traling / after helloworld
   
Am I missing something or is this a bug ?
   
Thanks,
   
Rajiv
   
-
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]
 
 

 -
 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]



RE: right click popup context menu

2008-03-07 Thread Karen Schaper
Yep.  I have that working just as you described below.

Glad I'm doing it correctly.

Thanks

 -Original Message-
 From: Doug Leeper [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 07, 2008 5:43 PM
 To: users@wicket.apache.org
 Subject: RE: right click popup context menu
 
 
 
 In the populateItem, you will need to do the following:
 
 
 contextMenuBehavior.applyAttributes(item, popupMenu, new Model(   
 rowId));
 
 Where rowId is the value you are looking for when the action has been
 selected (the targetId in the onClick method)
 
 private class MyAction extends AbstractYuiMenuAction implements
   IYuiMenuAjaxAction {
 
   public void onClick(AjaxRequestTarget target, String targetId) {
// targetId == the rowId in applyAttributes
   }
 }
 -- 
 View this message in context: 
 http://www.nabble.com/right-click-popup-context-menu-tp15876468p15
 908004.html
 Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

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



Resource String from Localizer

2008-03-07 Thread mnwicket

Is it possible to get a resource string from a Localizer that hasn't been
added to a Page yet?

My situation is that I have an object called Role, the role can be setup by
the a client and there are also default roles for all clients that are setup
by the application with a resource key attached to it.  The default roles
has a resource key on the object.  The issue I'm running into is that when
displaying a list of roles I need to know the actual value of the resource
key before being added to the Page so I can sort the roles by name.

Side note, the value of the resource key is located in the
Application.properties file.

-Craig
-- 
View this message in context: 
http://www.nabble.com/Resource-String-from-Localizer-tp15910188p15910188.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]



Javascript not evaluating with AbstractAutoCompleteBehavior

2008-03-07 Thread Andrew Berman
Hello,

If I have the following code:

 textField.add(new AbstractAutoCompleteBehavior() {
/**
 *
 */
private static final long serialVersionUID = 1L;

@Override
protected void onRequest(final String input,
RequestCycle requestCycle) {
}

@Override
protected void respond(AjaxRequestTarget target) {
  target.appendJavascript(alert(\hello\););
}
});

When the page renders, the textfield is calling this event and I see the
response in the Wicket debug box, but the response is never being parsed and
the alert never shows up.   Am I missing something here?  I tested using an
AjaxEventBehavior with onkeypress and it works great.  The only problem is
that I have no way of getting the text typed into the text field, which is
why I used the auto complete stuff.  Any thoughts?

Thanks for your help!


Re: Javascript not evaluating with AbstractAutoCompleteBehavior

2008-03-07 Thread Matej Knopp
The autocomplete component doesn't use the wicket ajax pipeline so
that ajaxrequesttarget methods will not work for request invoked by
the autocomplete behavior.

-Matej

On Sat, Mar 8, 2008 at 4:50 AM, Andrew Berman [EMAIL PROTECTED] wrote:
 Hello,

  If I have the following code:

   textField.add(new AbstractAutoCompleteBehavior() {
 /**
  *
  */
 private static final long serialVersionUID = 1L;

 @Override
 protected void onRequest(final String input,
 RequestCycle requestCycle) {
 }

 @Override
 protected void respond(AjaxRequestTarget target) {
   target.appendJavascript(alert(\hello\););
 }
 });

  When the page renders, the textfield is calling this event and I see the
  response in the Wicket debug box, but the response is never being parsed and
  the alert never shows up.   Am I missing something here?  I tested using an
  AjaxEventBehavior with onkeypress and it works great.  The only problem is
  that I have no way of getting the text typed into the text field, which is
  why I used the auto complete stuff.  Any thoughts?

  Thanks for your help!




-- 
Resizable and reorderable grid components.
http://www.inmethod.com

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



Any Wicket way to submit 2 forms with 1 submit button?

2008-03-07 Thread Justin Morgan - Logic Sector
Here's a problem that other people may have encountered.  Hopefully  
there's a Wicket way to solve it.


The scenario...
I have two forms on my Contact Us page.  There is a login form at  
the top of the page with a submit button.  There's also the contact  
form at the bottom of the same page, also with its own submit button.   
(The login form is in a panel that's shared across many pages).


The problem is...
If the user enters text into the contact form, then enters a username 
+password in the login form and submits the login, then any text in  
the contact us form goes away.  From a development perspective this  
is to be expected; the contact us form was never submitted.


However, that's a terrible user experience.  The user could  
unexpectedly lose a lot of text in the contact form.  Therefore, I  
need to submit two forms when the user clicks the login submit  
button.  That way the user won't lose their contact text.


Presumably this could be fixed via Ajax-ifying the login form.   
However, I'm hoping there's a non JavaScript option that would work  
(i.e., a Wicket way)?


Thanks for any help,

Justin

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



Re: DropDownChoice getting value into the model

2008-03-07 Thread Per Newgro
But in java.lang.String there is no state property.

You added a list of Strings to the ddc. But you have to add your vendor 
objects. The display in ddc will be done by ChoiceRenderer.

Cheers
Per


Am Freitag, 7. März 2008 23:34:35 schrieb rmattler:
 Yes

 @Column(name = state, length = 2)
   public String getState() {
   return this.state;
   }

   public void setState(String state) {
   this.state = state;
   }

 Kai Mütz wrote:
  [EMAIL PROTECTED]  wrote:
  Thanks for trying but I get:
 
  WicketMessage: No get method defined for class: class
  java.lang.String expression: state
 
  Have you defined a getter/setter for field state in your vendor class?
 
 
  -
  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]