Anybody tried Wicket with WebSphere portal?

2008-06-17 Thread Peter Eriksson
Hello everybody,

In my day job I use WebSphere Portal, working as a consultant, and I have
been using JSF in portlet development and really found it quite painful. The
version of WebSphere Portal is 6.0 and that uses JSF 1.1 and I know things
have improved somewhat in more recent versions of JSF, but that is not
really helping much. Now to my question, I have been trying out Wicket and I
find it very nice to work with compared to JSF and I really would like to
use it in WebSphere Portal, so is anybody out there using it with WebSphere
Portal 6? I have read a few postings regarding portal support and understood
that it depends on how and if the PortletBridge is implemented in the
Portlet container of the vendor in question. WebSphere Portal 6.0 is JSR168
compliant and I know that the upcoming release WebSphere Portal 6.1 is going
to be JSR286 compliant and that Wicket support should be working in a JSR286
environment without problem, or have I misunderstood something?

Best Regards,
/Peter Eriksson


Trying to close a modal when a form contained in the modal-panel in submitted

2008-06-17 Thread mfs

Hi Guys,

I am trying to find a solution to a problem relating to modal windows, which
apparently is a bit trickier than i thought it would be.

So basically i have a modal window with a panel as the content, the panel
itself contains a form. The form submission happen in a new window i.e. i
have a onSubmit="window.open()". and everything works as expected (though i
have read the threads where it has been suggested to use ajax components
inside the modal but so form using a plain form has worked for me.)

Now, a new requirement has come up, where i want to close the modal window
as soon as the form is submitted (which as mentioned happens in a new
window). I have tried certain option but to no use...Can anyone point me to
the right direction..as to how to do achieve the form submission (as well as
closing of modal window)

Thanks in advance


-- 
View this message in context: 
http://www.nabble.com/Trying-to-close-a-modal-when-a-form-contained-in-the-modal-panel-in-submitted-tp17959682p17959682.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: Grabbing a form component's input before the form has been submitted

2008-06-17 Thread Igor Vaynberg
getinput()

-igor

On Tue, Jun 17, 2008 at 6:10 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote:
> I have a form that contains a date textfield. When a user fills out the
> date and then launches a modal via another link I need to somehow pass
> that field's input to the modal's panel. Problem is that the form at
> that point has not been submitted yet. I already tried:
>
>
>
> Date startDate = (Date)startTimeField.getConvertedInput();
>
>
>
> However, it's always null. How can I do this?
>
>
>
> Thanks in advance...
>
>
>
> Michael
>
>

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



Re: Wicket Session Management (constructor called twice)

2008-06-17 Thread Igor Vaynberg
you can bind the session in constructor, just call bind();

-igor

On Tue, Jun 17, 2008 at 5:28 PM, Ravi_116 <[EMAIL PROTECTED]> wrote:
>
> Is there anyway around this problem?   I am trying to do automatic
> authentication and  i would like the Wicket Session to be the same as a
> HttpSession (so that the authentication will work).
> Ravi
>
>
> igor.vaynberg wrote:
>>
>> wicket creates temporary session objects for stateless pages until the
>> session is persisted.
>>
>> -igor
>>
>> On Tue, Jun 17, 2008 at 4:29 PM, Ravi_116 <[EMAIL PROTECTED]> wrote:
>>>
>>> Is there any reason why custom wicket web session is instantiated twice
>>> when
>>> presented with login screen. The application uses standard wicket-auth
>>> implementation.
>>>
>>> public class LingoWebSession extends AuthenticatedWebSession
>>> {
>>>public LingoWebSession(AuthenticatedWebApplication application,
>>> Request
>>> request)
>>>{
>>>super(application, request);
>>>InjectorHolder.getInjector().inject(this);
>>>new Exception( "here" ).printStackTrace();
>>>}
>>> }
>>>
>>> public class MagicEightBallWebApplication extends
>>> AuthenticatedWebApplication
>>> {
>>>@Override
>>>protected Class
>>> getWebSessionClass()
>>>{
>>>return LingoWebSession.class;
>>>}
>>> }
>>>
>>>
>>> java.lang.Exception: here
>>>at
>>> com.semantra.web.LingoWebSession.(LingoWebSession.java:38)
>>>at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>>> Method)
>>>at
>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>>>at
>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>>at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>>>at
>>> org.apache.wicket.authentication.AuthenticatedWebApplication.newSession(AuthenticatedWebApplication.java:114)
>>>at org.apache.wicket.Session.findOrCreate(Session.java:225)
>>>at org.apache.wicket.Session.findOrCreate(Session.java:208)
>>>at org.apache.wicket.Session.get(Session.java:244)
>>>at
>>> org.apache.wicket.authentication.AuthenticatedWebSession.get(AuthenticatedWebSession.java:43)
>>>at
>>> com.semantra.oem.mscrm.web.NtlmRequestCycle.onBeginRequest(NtlmRequestCycle.java:56)
>>>at org.apache.wicket.RequestCycle.prepare(RequestCycle.java:1084)
>>>at org.apache.wicket.RequestCycle.step(RequestCycle.java:1146)
>>>at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245)
>>>at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
>>>at
>>> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
>>>at
>>> org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:121)
>>>at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>>>at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>at
>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
>>>at
>>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
>>>at
>>> com.semantra.oem.mscrm.web.setup.SetupConfigFilter.doFilter(SetupConfigFilter.java:38)
>>>at
>>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
>>>at
>>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
>>>at
>>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
>>>at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
>>>at
>>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
>>>at
>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
>>>at
>>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
>>>at
>>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>>>at
>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
>>>at
>>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
>>>at
>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
>>>at
>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>at
>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>>at org.mortbay.jetty.Server.handle(Server.java:285)
>>>at
>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
>>>at
>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
>>>at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
>>>at
>>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
>>>   

Re: Chaining components

2008-06-17 Thread Timo Rantalaiho
On Mon, 16 Jun 2008, Matthijs Wensveen wrote:
> I've been thinking about writing aspects that fire 
> Component.onModelChanged even  when the model's object changed (possibly 
> deep within an object hierarchy). Another option would be to use 
> PropertyChangeSupport. Either way, you'd never require listeners or 
> other complex notification structures. This  would be especially useful 
> with AJAX, because then all components that get onModelChanged can add 
> themselves to the AjaxRequestTarget.

That's a really interesting idea! I'm afraid that any working
solution might require too much black magic to be viable, but 
please keep us posted.

> By the way, the jira patch Igor mentioned: 
> https://issues.apache.org/jira/browse/WICKET-1312. I really like it.

Thanks :)

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



Re: wicket training/consulting in the SF Bay Area

2008-06-17 Thread freak182


You can buy books in wicket :) i learn a lot from there


m_salman wrote:
> 
> Hi,
> 
> Is there any one available to provide Wicket training and/or consulting in
> the SF Bay area?
> I need help urgently.  Off hours is fine.  Or if you are not in the Bay
> Area but willing to do it via email.
> 
> Thanks,
> 
> -Mohammad
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/wicket-training-consulting-in-the-SF-Bay-Area-tp17859255p17958799.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: validation message

2008-06-17 Thread Timo Rantalaiho
On Mon, 16 Jun 2008, wenm wrote:
> Maybe I didn't explain clearly. I knew how to override in myPage.properties
> and myForm.properties. But I mean if I want to override in
> myApplication.properties, is it possible to do and how's the  hierarchies? 

I have found it easiest to just debug which keys the 
component is trying. Though I believe that a more a priori
solution is on the wiki :)

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



Re: Cannot get rid of these error and warnings

2008-06-17 Thread Timo Rantalaiho
On Mon, 16 Jun 2008, Johan Compagner wrote:
> Calls are synced but they can be in the wait for each other and if
> then the first changes the component structure then the other that is
> already waiting comes in then it cant find it anymore. But this call
> should just be ignored as far as i know

I don't think it is, at least in 1.3.4?

> > On Sun, Jun 15, 2008 at 7:46 PM, Cristi Manole <[EMAIL PROTECTED]>
> > wrote:
> >> I have a table with a drop down in one of the columns. This table gets
> >> refreshed every 10 seconds through Ajax.
> >>
> >> I did some testing and it seams I get the error when I'm trying to change
> >> the content of the drop down (which gets posted through Ajax) exactly when
> >> the table gets refreshed. So it fails with that error being caused by the
> >> fact that Wicket cannot find a page for the drop down component.

So are you updating also the dropdown via ajax? If your
table (or its row) is a repeater that creates its items 
again on rendering, this might cause the problem, because
the original dropdown would not be in the component 
hierarchy anymore. So here an item reuse strategy as Maurice
suggested might help. Also you could check that the dropdown 
is still on the page before adding it to AjaxRequestTarget, 
or consider whether you have to add it separately at all if
the whole table gets repainted pretty frequently anywway.

It should be easy enough to find out when new items are 
created (e.g. with Thread.dumpStack() in newItem).

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



Re: Spring - InjectorHolder has not been assigned an injector

2008-06-17 Thread Timo Rantalaiho
On Sun, 15 Jun 2008, Per Newgro wrote:
> it would be cool if it would be that simple. But if i inject the "sub" beans 
> in my usecase i get only NullPointerException while accessing them.

You are fetching your usecase objects from the Spring 
ApplicationContext and not creating them with "new", right?

Anyway, this is a Spring and not a Wicket issue, so maybe 
you can find more help in Spring forums.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



Re: Spring - InjectorHolder has not been assigned an injector

2008-06-17 Thread Timo Rantalaiho
On Sun, 15 Jun 2008, Per Newgro wrote:
> page. Because i had some business logic and i don't want it in my pages, i've 
> externalized it into an usecase class. Until now i've delivered the daos to 
> the usecase while calling the method (doMyStuff(myDao)). So far so good. 
> 
> My next step was to externalize the daos. They should be injected in my 
> usecase. But they wasn't. So i've read the threads an came up with
> 
> public MyUsecase() {
>   InjectorHolder.getInjector().inject(this);
> }

This is fine in normal UI layer pojo classes that you
construct with "new" operator in your own code during the
execution of the application.  But in Spring-managed beans
you should get your dependencies in with the normal Spring
mechanisms (@Resource, autowiring or in XML as what you
posted). Wicket should not be used in them.
 
By the way, I strongly recommend a domain-driven design,
with domain logic in the domain objects, instead of the
proceduralish / model2-actionish usecases.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



RE: Browser not jumping to Wicket Anchor

2008-06-17 Thread Michael Mehrle
Oh, and for the anchor string - do I include the hash as well? I added
the call below without the hash and it's not jumping to that anchor.
Frustrating...

Michael

-Original Message-
From: Michael Mehrle [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 17, 2008 6:19 PM
To: users@wicket.apache.org
Subject: RE: Browser not jumping to Wicket Anchor

Just curious - what does 'location.hash' stand for? In any case, is this
supposed to cause the page to jump to the anchor?

Michael

-Original Message-
From: Gwyn Evans [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 16, 2008 2:51 PM
To: users@wicket.apache.org
Subject: Re: Browser not jumping to Wicket Anchor

Not an issue I've come across but also not an area I've explored... A
quick
search through the mailing list did suggest one possible approach as
below,
but I've no idea how viable it might be!

public Page extends WebPage implements IHeadContributor {

@Override
public void renderHead(IHeaderResponse r) {
   r.renderOnLoadJavascript("location.hash='YOUR-ANCHOR'");
}
}

/Gwyn

On Mon, Jun 16, 2008 at 10:33 PM, Michael Mehrle
<[EMAIL PROTECTED]>
wrote:

> Yes - they do match - you're right, always check the basics first. The
> problem is that even if I bookmark the anchored page (with the anchor
> tagged on), and load the page it won't jump there. So, I don't think
> it's the way I create the anchor (because the URL looks correct) -
it's
> all the other wicket AJAX stuff that somehow prevents the anchor from
> being recognized on page load. Is there a work around for this?
>
> Thanks,
>
> Michael
>
> -Original Message-
> From: Gwyn Evans [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 16, 2008 1:02 PM
> To: users@wicket.apache.org
> Subject: Re: Browser not jumping to Wicket Anchor
>
> Just looking at the HTML, do the anchor & the destination match
> correctly?
> Is the destination url just a normal page, or a form of some sort?
>
> /Gwyn
>
> On Mon, Jun 16, 2008 at 6:58 PM, Michael Mehrle
<[EMAIL PROTECTED]>
> wrote:
>
> > I created an Link to another page's anchor similar to the code shown
> > below. The anchor actually gets tagged on to the bookmarkable URL.
> > However, for some reason the browser does not jump to my anchor.
> >
> >
> >
> > Not sure what's going on - is there a particular way I have to
create
> an
> > anchor in Wicket so that the URL causes the browser to scroll
further
> > down in the page?
> >
> >
> >
> > Thanks,
> >
> >
> >
> > Michael
> >
> >
> >
> >
> >
> > public class AnchoredBookmarkablePageLink extends
BookmarkablePageLink
> {
> >
> >
> >
> >  private static final long serialVersionUID = 1L;
> >
> >
> >
> >  private IModel stringAnchor;
> >
> >
> >
> >  public AnchoredBookmarkablePageLink(String id, Class pageClass,
> IModel
> >
> >
> > anchor) {
> >
> >super(id, pageClass);
> >
> >this.stringAnchor = anchor;
> >
> >  }
> >
> >
> >
> >  public AnchoredBookmarkablePageLink(String id, Class pageClass,
> >
> > PageParameters params, IModel anchor) {
> >
> >super(id, pageClass, params);
> >
> >this.stringAnchor = anchor;
> >
> >  }
> >
> >
> >
> >  @Override
> >
> >  protected CharSequence appendAnchor(ComponentTag tag, CharSequence
> > url) {
> >
> >url = url + "#" + stringAnchor.getObject().toString();
> >
> >return url;
> >
> >  }
> >
> >
> >
> > }
> >
> >
> >
> >
>
> -
> 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: Browser not jumping to Wicket Anchor

2008-06-17 Thread Michael Mehrle
Just curious - what does 'location.hash' stand for? In any case, is this
supposed to cause the page to jump to the anchor?

Michael

-Original Message-
From: Gwyn Evans [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 16, 2008 2:51 PM
To: users@wicket.apache.org
Subject: Re: Browser not jumping to Wicket Anchor

Not an issue I've come across but also not an area I've explored... A
quick
search through the mailing list did suggest one possible approach as
below,
but I've no idea how viable it might be!

public Page extends WebPage implements IHeadContributor {

@Override
public void renderHead(IHeaderResponse r) {
   r.renderOnLoadJavascript("location.hash='YOUR-ANCHOR'");
}
}

/Gwyn

On Mon, Jun 16, 2008 at 10:33 PM, Michael Mehrle
<[EMAIL PROTECTED]>
wrote:

> Yes - they do match - you're right, always check the basics first. The
> problem is that even if I bookmark the anchored page (with the anchor
> tagged on), and load the page it won't jump there. So, I don't think
> it's the way I create the anchor (because the URL looks correct) -
it's
> all the other wicket AJAX stuff that somehow prevents the anchor from
> being recognized on page load. Is there a work around for this?
>
> Thanks,
>
> Michael
>
> -Original Message-
> From: Gwyn Evans [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 16, 2008 1:02 PM
> To: users@wicket.apache.org
> Subject: Re: Browser not jumping to Wicket Anchor
>
> Just looking at the HTML, do the anchor & the destination match
> correctly?
> Is the destination url just a normal page, or a form of some sort?
>
> /Gwyn
>
> On Mon, Jun 16, 2008 at 6:58 PM, Michael Mehrle
<[EMAIL PROTECTED]>
> wrote:
>
> > I created an Link to another page's anchor similar to the code shown
> > below. The anchor actually gets tagged on to the bookmarkable URL.
> > However, for some reason the browser does not jump to my anchor.
> >
> >
> >
> > Not sure what's going on - is there a particular way I have to
create
> an
> > anchor in Wicket so that the URL causes the browser to scroll
further
> > down in the page?
> >
> >
> >
> > Thanks,
> >
> >
> >
> > Michael
> >
> >
> >
> >
> >
> > public class AnchoredBookmarkablePageLink extends
BookmarkablePageLink
> {
> >
> >
> >
> >  private static final long serialVersionUID = 1L;
> >
> >
> >
> >  private IModel stringAnchor;
> >
> >
> >
> >  public AnchoredBookmarkablePageLink(String id, Class pageClass,
> IModel
> >
> >
> > anchor) {
> >
> >super(id, pageClass);
> >
> >this.stringAnchor = anchor;
> >
> >  }
> >
> >
> >
> >  public AnchoredBookmarkablePageLink(String id, Class pageClass,
> >
> > PageParameters params, IModel anchor) {
> >
> >super(id, pageClass, params);
> >
> >this.stringAnchor = anchor;
> >
> >  }
> >
> >
> >
> >  @Override
> >
> >  protected CharSequence appendAnchor(ComponentTag tag, CharSequence
> > url) {
> >
> >url = url + "#" + stringAnchor.getObject().toString();
> >
> >return url;
> >
> >  }
> >
> >
> >
> > }
> >
> >
> >
> >
>
> -
> 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]



Grabbing a form component's input before the form has been submitted

2008-06-17 Thread Michael Mehrle
I have a form that contains a date textfield. When a user fills out the
date and then launches a modal via another link I need to somehow pass
that field's input to the modal's panel. Problem is that the form at
that point has not been submitted yet. I already tried:

 

Date startDate = (Date)startTimeField.getConvertedInput();

 

However, it's always null. How can I do this?

 

Thanks in advance...

 

Michael



Re: Directions for Stateless Ajax

2008-06-17 Thread nate roe
I've written a stateless auto-complete TextField by adapting Wicket's own
JavaScript and using a servlet for the back end.  I don't like the servlet
and I would like to instead use Wicket to serve the auto-complete
suggestions list, but I'm not sure how.

It must take a GET param (the text to complete,) and return a  (but no
, , etc.,) or nothing (if there are no results.) It also must be
stateless (bookmarkable url.) Igor mentions using a SharedResource for this
purpose -- can someone elaborate? Is a Portlet useful here?

Thanks,
Nate

On Wed, May 28, 2008 at 11:32 AM, Erik van Oosten <[EMAIL PROTECTED]>
wrote:

> Well, under these circumstances: donĀ“t use wicket.
> Just write your own javascript and use a servlet.
>
> Regards,
>   Erik.
>
> Alan Romaniusc wrote:
>
>> Hi,
>>
>> I have been digging in how to make "stateless" ajax requests in
>> wicket. My application needs an autocomplete textfield that must work
>> "all the time", including after session expiration.
>> I found a solution using a timer to ping the server, but this solution
>> was rejected :(.
>>
>> Where/What should I be looking for?
>>
>> Thx
>>
>>
>>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Wicket Session Management (constructor called twice)

2008-06-17 Thread Ravi_116

Is there anyway around this problem?   I am trying to do automatic
authentication and  i would like the Wicket Session to be the same as a
HttpSession (so that the authentication will work).
Ravi


igor.vaynberg wrote:
> 
> wicket creates temporary session objects for stateless pages until the
> session is persisted.
> 
> -igor
> 
> On Tue, Jun 17, 2008 at 4:29 PM, Ravi_116 <[EMAIL PROTECTED]> wrote:
>>
>> Is there any reason why custom wicket web session is instantiated twice
>> when
>> presented with login screen. The application uses standard wicket-auth
>> implementation.
>>
>> public class LingoWebSession extends AuthenticatedWebSession
>> {
>>public LingoWebSession(AuthenticatedWebApplication application,
>> Request
>> request)
>>{
>>super(application, request);
>>InjectorHolder.getInjector().inject(this);
>>new Exception( "here" ).printStackTrace();
>>}
>> }
>>
>> public class MagicEightBallWebApplication extends
>> AuthenticatedWebApplication
>> {
>>@Override
>>protected Class
>> getWebSessionClass()
>>{
>>return LingoWebSession.class;
>>}
>> }
>>
>>
>> java.lang.Exception: here
>>at
>> com.semantra.web.LingoWebSession.(LingoWebSession.java:38)
>>at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>>at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>>at
>> org.apache.wicket.authentication.AuthenticatedWebApplication.newSession(AuthenticatedWebApplication.java:114)
>>at org.apache.wicket.Session.findOrCreate(Session.java:225)
>>at org.apache.wicket.Session.findOrCreate(Session.java:208)
>>at org.apache.wicket.Session.get(Session.java:244)
>>at
>> org.apache.wicket.authentication.AuthenticatedWebSession.get(AuthenticatedWebSession.java:43)
>>at
>> com.semantra.oem.mscrm.web.NtlmRequestCycle.onBeginRequest(NtlmRequestCycle.java:56)
>>at org.apache.wicket.RequestCycle.prepare(RequestCycle.java:1084)
>>at org.apache.wicket.RequestCycle.step(RequestCycle.java:1146)
>>at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245)
>>at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
>>at
>> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
>>at
>> org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:121)
>>at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>>at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
>>at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
>>at
>> com.semantra.oem.mscrm.web.setup.SetupConfigFilter.doFilter(SetupConfigFilter.java:38)
>>at
>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
>>at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
>>at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
>>at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
>>at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
>>at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
>>at
>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
>>at
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>>at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
>>at
>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
>>at
>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
>>at
>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>at org.mortbay.jetty.Server.handle(Server.java:285)
>>at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
>>at
>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
>>at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
>>at
>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
>>at
>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
>>at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
>>at
>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPo

Re: Wicket Session Management (constructor called twice)

2008-06-17 Thread Igor Vaynberg
wicket creates temporary session objects for stateless pages until the
session is persisted.

-igor

On Tue, Jun 17, 2008 at 4:29 PM, Ravi_116 <[EMAIL PROTECTED]> wrote:
>
> Is there any reason why custom wicket web session is instantiated twice when
> presented with login screen. The application uses standard wicket-auth
> implementation.
>
> public class LingoWebSession extends AuthenticatedWebSession
> {
>public LingoWebSession(AuthenticatedWebApplication application, Request
> request)
>{
>super(application, request);
>InjectorHolder.getInjector().inject(this);
>new Exception( "here" ).printStackTrace();
>}
> }
>
> public class MagicEightBallWebApplication extends
> AuthenticatedWebApplication
> {
>@Override
>protected Class getWebSessionClass()
>{
>return LingoWebSession.class;
>}
> }
>
>
> java.lang.Exception: here
>at com.semantra.web.LingoWebSession.(LingoWebSession.java:38)
>at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>at
> org.apache.wicket.authentication.AuthenticatedWebApplication.newSession(AuthenticatedWebApplication.java:114)
>at org.apache.wicket.Session.findOrCreate(Session.java:225)
>at org.apache.wicket.Session.findOrCreate(Session.java:208)
>at org.apache.wicket.Session.get(Session.java:244)
>at
> org.apache.wicket.authentication.AuthenticatedWebSession.get(AuthenticatedWebSession.java:43)
>at
> com.semantra.oem.mscrm.web.NtlmRequestCycle.onBeginRequest(NtlmRequestCycle.java:56)
>at org.apache.wicket.RequestCycle.prepare(RequestCycle.java:1084)
>at org.apache.wicket.RequestCycle.step(RequestCycle.java:1146)
>at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245)
>at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
>at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
>at
> org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:121)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
>at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
>at
> com.semantra.oem.mscrm.web.setup.SetupConfigFilter.doFilter(SetupConfigFilter.java:38)
>at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
>at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
>at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
>at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
>at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
>at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
>at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
>at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
>at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
>at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
>at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>at org.mortbay.jetty.Server.handle(Server.java:285)
>at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
>at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
>at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
>at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
>at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
>at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
>at
> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
>
>
>  application USERNAME admin
> java.lang.Exception: here
>at com.semantra.web.LingoWebSession.(LingoWebSession.java:38)
>at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> 

Wicket Session Management (constructor called twice)

2008-06-17 Thread Ravi_116

Is there any reason why custom wicket web session is instantiated twice when
presented with login screen. The application uses standard wicket-auth
implementation.

public class LingoWebSession extends AuthenticatedWebSession
{
public LingoWebSession(AuthenticatedWebApplication application, Request
request)
{
super(application, request);
InjectorHolder.getInjector().inject(this);
new Exception( "here" ).printStackTrace();
}
}

public class MagicEightBallWebApplication extends
AuthenticatedWebApplication
{
@Override
protected Class getWebSessionClass()
{
return LingoWebSession.class;
}
}


java.lang.Exception: here
at com.semantra.web.LingoWebSession.(LingoWebSession.java:38)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
org.apache.wicket.authentication.AuthenticatedWebApplication.newSession(AuthenticatedWebApplication.java:114)
at org.apache.wicket.Session.findOrCreate(Session.java:225)
at org.apache.wicket.Session.findOrCreate(Session.java:208)
at org.apache.wicket.Session.get(Session.java:244)
at
org.apache.wicket.authentication.AuthenticatedWebSession.get(AuthenticatedWebSession.java:43)
at
com.semantra.oem.mscrm.web.NtlmRequestCycle.onBeginRequest(NtlmRequestCycle.java:56)
at org.apache.wicket.RequestCycle.prepare(RequestCycle.java:1084)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1146)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
at
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:121)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
at
com.semantra.oem.mscrm.web.setup.SetupConfigFilter.doFilter(SetupConfigFilter.java:38)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:285)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)


 application USERNAME admin
java.lang.Exception: here
at com.semantra.web.LingoWebSession.(LingoWebSession.java:38)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
org.apache.wicket.authentication.AuthenticatedWebApplication.newSession(AuthenticatedWebApplication.java:114)
at org.apa

Re: Contributing CSS with Panel components?

2008-06-17 Thread Matej Knopp
Wicket detects the CSS being rendered and should load the CSS on fly
using ajax. Of course you will not see the css link in the page source
because it has been added later (and you only see the initial source).

You can try replacing AjaxTabbedPanel with the regular one to see if
the styling works. If it does it might be problem with Ajax header
contribution.

-Matej

On Wed, Jun 18, 2008 at 1:04 AM, Matej Knopp <[EMAIL PROTECTED]> wrote:
> Mind showing us some code? The pattern you are describing here is very
> common and it should work quite well.
>
> -Matej
>
> On Wed, Jun 18, 2008 at 12:55 AM, David Nedrow <[EMAIL PROTECTED]> wrote:
>> Hmm, Google is not being helpful.
>>
>> Is there a way to contribute CSS when a Panel is added to a page?
>>
>> I like the idea of keeping the CSS with the related class and html file, but
>> have not figured out if it is possible to add CSS at render time for
>> components contained in the page.
>>
>> IE., I have UserDetailsPanel.java, UserDetailsPanel.html, and
>> UserDetailsPanel.css.
>>
>> If I include the panel in an AjaxTabbedPanel(), with UserDetailsPanel.java
>> containing a HeaderContributor.forCss() pointing to UserDetailsPanel.css,
>> the rendered page does not contain the css link. Frankly, this is what I
>> would expect, given that the page header has already been rendered.
>>
>> Is this a circumstance in which I will need to contribute the CSS earlier in
>> the process, or is there a mechanism that can be used to do this when the
>> panel is rendered?
>>
>> -David
>>
>> -
>> 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: Contributing CSS with Panel components?

2008-06-17 Thread Igor Vaynberg
how do you know css is not contributed after ajax? do you not see it
applied or do you not see the link tag when you view source in the
browser? what version of wicket? what version of browser?

-igor

On Tue, Jun 17, 2008 at 3:55 PM, David Nedrow <[EMAIL PROTECTED]> wrote:
> Hmm, Google is not being helpful.
>
> Is there a way to contribute CSS when a Panel is added to a page?
>
> I like the idea of keeping the CSS with the related class and html file, but
> have not figured out if it is possible to add CSS at render time for
> components contained in the page.
>
> IE., I have UserDetailsPanel.java, UserDetailsPanel.html, and
> UserDetailsPanel.css.
>
> If I include the panel in an AjaxTabbedPanel(), with UserDetailsPanel.java
> containing a HeaderContributor.forCss() pointing to UserDetailsPanel.css,
> the rendered page does not contain the css link. Frankly, this is what I
> would expect, given that the page header has already been rendered.
>
> Is this a circumstance in which I will need to contribute the CSS earlier in
> the process, or is there a mechanism that can be used to do this when the
> panel is rendered?
>
> -David
>
> -
> 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: Contributing CSS with Panel components?

2008-06-17 Thread Matej Knopp
Mind showing us some code? The pattern you are describing here is very
common and it should work quite well.

-Matej

On Wed, Jun 18, 2008 at 12:55 AM, David Nedrow <[EMAIL PROTECTED]> wrote:
> Hmm, Google is not being helpful.
>
> Is there a way to contribute CSS when a Panel is added to a page?
>
> I like the idea of keeping the CSS with the related class and html file, but
> have not figured out if it is possible to add CSS at render time for
> components contained in the page.
>
> IE., I have UserDetailsPanel.java, UserDetailsPanel.html, and
> UserDetailsPanel.css.
>
> If I include the panel in an AjaxTabbedPanel(), with UserDetailsPanel.java
> containing a HeaderContributor.forCss() pointing to UserDetailsPanel.css,
> the rendered page does not contain the css link. Frankly, this is what I
> would expect, given that the page header has already been rendered.
>
> Is this a circumstance in which I will need to contribute the CSS earlier in
> the process, or is there a mechanism that can be used to do this when the
> panel is rendered?
>
> -David
>
> -
> 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]



Contributing CSS with Panel components?

2008-06-17 Thread David Nedrow

Hmm, Google is not being helpful.

Is there a way to contribute CSS when a Panel is added to a page?

I like the idea of keeping the CSS with the related class and html  
file, but have not figured out if it is possible to add CSS at render  
time for components contained in the page.


IE., I have UserDetailsPanel.java, UserDetailsPanel.html, and  
UserDetailsPanel.css.


If I include the panel in an AjaxTabbedPanel(), with  
UserDetailsPanel.java containing a HeaderContributor.forCss() pointing  
to UserDetailsPanel.css, the rendered page does not contain the css  
link. Frankly, this is what I would expect, given that the page header  
has already been rendered.


Is this a circumstance in which I will need to contribute the CSS  
earlier in the process, or is there a mechanism that can be used to do  
this when the panel is rendered?


-David

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



Re: NicEditTextAreaBehavior

2008-06-17 Thread francisco treacy
you're welcome!  what i would like is to put it in shape and
eventually share it through wicket stuff.

i admit i got lost in all those ajax behaviours, trying to figure out
if i could avoid forcing the client of the behavior to declare the
decorator:

> @Override
>  protected IAjaxCallDecorator getAjaxCallDecorator() {
>return nicEditTextAreaBehavior.NICEDIT_AJAX_BUTTON_DECORATOR;
>  }

ie  so that just doing  textarea.add(new NicEditTextAreaBehavior());
suffices. maybe you've got an idea?

anyway, after all these hacks seem to work!

francisco

On Tue, Jun 17, 2008 at 8:11 PM, Don Hass <[EMAIL PROTECTED]> wrote:
> Here is my version that appears to work with multiple textareas in a
> single form.
>
> Usage context:
>
>final NicEditTextAreaBehavior nicEditTextAreaBehavior = new
> NicEditTextAreaBehavior(true);
>
>final TextArea body1 = new TextArea("body1");
>body1.add(nicEditTextAreaBehavior);
>form.add(body1);
>
>final TextArea body2 = new TextArea("body2");
>body2.add(nicEditTextAreaBehavior);
>form.add(body2);
>
> Form submit button:
>
> @Override
>  protected IAjaxCallDecorator getAjaxCallDecorator() {
>return nicEditTextAreaBehavior.NICEDIT_AJAX_BUTTON_DECORATOR;
>  }
>
> 
>
> public class NicEditTextAreaBehavior extends AbstractBehavior {
>  private List textAreas = new ArrayList();
>  private Boolean fullPanel = Boolean.TRUE;
>
>  private static final ResourceReference NICEDIT_JAVASCRIPT = new
> JavascriptResourceReference(NicEditTextAreaBehavior.class,
> "nicEdit.js");
>  private static final ResourceReference NICEDIT_ICONS = new
> ResourceReference(NicEditTextAreaBehavior.class,
> "nicEditorIcons.gif");
>
>  public final AjaxCallDecorator NICEDIT_AJAX_BUTTON_DECORATOR = new
> AjaxCallDecorator() {
>@Override
>public CharSequence decorateScript(final CharSequence script) {
>  StringBuffer js = new StringBuffer();
>  for (Component component : textAreas) {
>String editorVarName = "wne" + component.getMarkupId();
>js.append(editorVarName).append(".nicInstances[0].saveContent();");
>  }
>  js.append(script);
>  return js.toString();
>}
>  };
>
>  public NicEditTextAreaBehavior() {
>  }
>
>  public NicEditTextAreaBehavior(Boolean fullPanel) {
>this.fullPanel = fullPanel;
>  }
>
>  @Override
>  @SuppressWarnings("unchecked")
>  public void bind(Component component) {
>component.setOutputMarkupPlaceholderTag(true);
>
>textAreas.add(component);
>System.out.println("bind: " + component.getMarkupId());
>  }
>
>  @Override
>  public void renderHead(IHeaderResponse response) {
>super.renderHead(response);
>StringBuffer js = new StringBuffer();
>response.renderJavascriptReference(NICEDIT_JAVASCRIPT);
>
>for (Component component : textAreas) {
>  String editorVarName = "wne" + component.getMarkupId();
>  response.renderJavascript("var " + editorVarName + ";", null);
>  js.append(editorVarName).append(" = new nicEditor({iconsPath : '");
>  js.append(RequestCycle.get().urlFor(NICEDIT_ICONS));
>  js.append("', fullPanel :
> ").append(fullPanel).append("}).panelInstance('").append(component.getMarkupId()).append("');");
>}
>
>if (js.length() > 0) response.renderOnDomReadyJavascript(js.toString());
>  }
>
> }
>
> So far it looks like it is working.  Not sure if it is "best form",
> but thanks to your feedback and a little hacking I have something that
> works better than the TinyMCE stuff I have been trying to use for the
> past 2 months!  Plus this is so much lighter and quick than MCE bloat.
>
> Thanks again for posting to the list since I didn't even know about
> NicEdit before your post!
>
> On Tue, Jun 17, 2008 at 1:49 PM, Don Hass <[EMAIL PROTECTED]> wrote:
>>
>> Yes, that got it working for one textarea in a form.  I have been trying to 
>> come up with a solution for multiple text areas in a single form now.
>>
>> On Tue, Jun 17, 2008 at 12:12 PM, francisco treacy <[EMAIL PROTECTED]> wrote:
>>>
>>> hey don,
>>>
>>> i'm sorry, i just published it too fast :)  i was having some trouble
>>> with my persistence layer so i thought the model was getting updated
>>> cause wasn't hitting the db.
>>>
>>> ajax or not, it wouldn't work either way. before calling the submit
>>> button, contents have to be updated.
>>>
>>> so here i came up with a new version that works (i believe with ajax
>>> only, and with one textarea for the moment). i'm by no  means an ajax
>>> expert (hmm, in fact, i dislike javascript :) so this is a call to
>>> wicket ajax gurus: could you help me improve this code?
>>>
>>> usage:
>>>
>>> (...)
>>> final NicEditTextAreaBehavior behavior = new NicEditTextAreaBehavior();
>>> textarea.add(behavior);
>>> (...)
>>>
>>> form.add(new AjaxFallbackButton("submit", form) {
>>>
>>>@Override
>>>protected IAjaxCallDecorator getAjaxCallDecorator() {
>>>   

Injecting Wicket Pages using Google Guice

2008-06-17 Thread cowwoc

Hi,

I've uploaded a patch that makes Wicket Pages (bookmarkable or otherwise)
injectable using Google Guice:
https://issues.apache.org/jira/browse/WICKET-1705

Thank you,
Gili
-- 
View this message in context: 
http://www.nabble.com/Injecting-Wicket-Pages-using-Google-Guice-tp17934024p17934024.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]



Flash on Bookmarkable Page

2008-06-17 Thread tdelesio

Hi,

I'm trying to add a flash file to a bookmarkablepage.  I used the
ShockwaveComponent and Objectcomponent from the following link:

http://cwiki.apache.org/WICKET/object-container-adding-flash-to-a-wicket-application.html

The BookmarkablePage is being passed a parm in the url to identify which
video to play.  When I try and hit the page the following exception is
thrown (1 is the value of the videoId):

ERROR - RequestCycle   - URL fragment has unmatched key/value
pair: videoId/1/sample05.swf
java.lang.IllegalStateException: URL fragment has unmatched key/value pair:
videoId/1/sample05.swf
at
org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy.decodeParameters(AbstractRequestTargetUrlCodingStrategy.java:174)
at
org.apache.wicket.request.target.coding.BookmarkablePageRequestTargetUrlCodingStrategy.decode(BookmarkablePageRequestTargetUrlCodingStrategy.java:76)


public WatchVideoPage()
{
super();
String vidId =
(String)getWebRequestCycle().getPageParameters().get("videoId");

//i would lookup the actual file name based on the
vidId...below is the value that is returned
add(new ShockWaveComponent("movie", "sample05.swf", "700",
"70"));
}

WatchVideoPage.html


I tried playing with the different URL mapping strategies and even hard
coding the sample05.swf in the html file and all the tests yield the same
error as shown above.  If I remove the flash or remove the parameter being
passed int he url the page renders fine.  Any ideas?


-- 
View this message in context: 
http://www.nabble.com/Flash-on-Bookmarkable-Page-tp17929480p17929480.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: Making all Wicket URL start with a subpath

2008-06-17 Thread aaime74

We did not, we're using Spring and in web.xml we're using a single wildcard
mapping that forwards to the Spring dispatcher, and then that forwards to
the Wicket Servlet wrapping controller. 
Page links seem to work, but all references back to the ajax js resources
are trying to hit /geoserver/resources instead of /geoserver/ui/resources,
and also PageLink are trying to hit /geoserver/... directly (whilst
Bookmarkable
ones are working fine).

Cheers
Andrea


jwcarman wrote:
> 
> Have you tried mounting the WicketFilter with a different url-mapping?
> 
> On Tue, Jun 17, 2008 at 11:04 AM, aaime74 <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>> at GeoServer (www.geoserver.org) we're switching the web UI from Struts2
>> to
>> Wicket. Looks promising, but there's one catch: we'd like all of our UI
>> paths to be located under /geoserver/ui instead of /geoserver directly,
>> even
>> for the wicket non mounted URLs. This is because we have other services
>> installed on other paths, and we'd like to keep everything separated.
>> So, is there any place where we can plugin in the general URL encoding
>> strategy to force all wicket url to start with /geoserver/ui?
>> --
>> View this message in context:
>> http://www.nabble.com/Making-all-Wicket-URL-start-with-a-subpath-tp17913538p17913538.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/Making-all-Wicket-URL-start-with-a-subpath-tp17913538p17922964.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: [Slightly OT] Country selection component with a nice GUI

2008-06-17 Thread Nino Martinez
Say if you get into troubles with the openlayers contrib



On Sat, Jun 14, 2008 at 6:59 PM, Kaspar Fischer <[EMAIL PROTECTED]>
wrote:

> Thanks a lot for the hint regarding openlayers!
>
>
> On 30.05.2008, at 20:43, Nino Saturnino Martinez Vazquez Wael wrote:
>
>  I dont think it would be too horrible to whip up such a component with
>> openlayers or gmap. Otherwise you could use image maps...
>>
>> Kaspar Fischer wrote:
>>
>>> Does anybody know of a Wicket-driven country selection component with
>>> a nice visual interface? Something a little more fancy than a drop-
>>> down menu: for instance, a world-map where you can select a region in
>>> a first step and then select the country in a second step ...
>>>
>>> Regards,
>>> Kaspar
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>> --
>> -Wicket for love
>>
>> 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]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: NicEditTextAreaBehavior

2008-06-17 Thread francisco treacy
well,

response.renderJavascript("var wicketNicEditor; function
wicketNicEditorUpdate() {
wicketNicEditor.nicInstances[0].saveContent(); };", null);

could just be

response.renderJavascript("var wicketNicEditor;", null);

francisco

On Tue, Jun 17, 2008 at 6:12 PM, francisco treacy
<[EMAIL PROTECTED]> wrote:
> hey don,
>
> i'm sorry, i just published it too fast :)  i was having some trouble
> with my persistence layer so i thought the model was getting updated
> cause wasn't hitting the db.
>
> ajax or not, it wouldn't work either way. before calling the submit
> button, contents have to be updated.
>
> so here i came up with a new version that works (i believe with ajax
> only, and with one textarea for the moment). i'm by no  means an ajax
> expert (hmm, in fact, i dislike javascript :) so this is a call to
> wicket ajax gurus: could you help me improve this code?
>
> usage:
>
> (...)
> final NicEditTextAreaBehavior behavior = new NicEditTextAreaBehavior();
> textarea.add(behavior);
> (...)
>
> form.add(new AjaxFallbackButton("submit", form) {
>
>@Override
>protected IAjaxCallDecorator getAjaxCallDecorator() {
>return behavior.NICEDIT_AJAX_BUTTON_DECORATOR;
>}
>
>(...)
>
> });
>
> (...)
>
>
>
>
> public class NicEditTextAreaBehavior extends AbstractAjaxBehavior {
>
>private Boolean fullPanel = Boolean.TRUE;
>
>private static final ResourceReference NICEDIT_JAVASCRIPT =
>new JavascriptResourceReference(NicEditTextAreaBehavior.class, 
> "nicEdit.js");
>
>private static final ResourceReference NICEDIT_ICONS = new
> ResourceReference(NicEditTextAreaBehavior.class,
>"nicEditorIcons.gif");
>
>public static final AjaxCallDecorator NICEDIT_AJAX_BUTTON_DECORATOR =
> new AjaxCallDecorator() {
>@Override
>public CharSequence decorateScript(final CharSequence script) {
>return
> "wicketNicEditor.nicInstances[0].saveContent();" + script;
>}
>};
>
>public NicEditTextAreaBehavior() {
>}
>
>public NicEditTextAreaBehavior(Boolean fullPanel) {
>this.fullPanel = fullPanel;
>}
>
>@Override
>protected void onBind() {
>super.onBind();
>getComponent().setOutputMarkupId(true);
>}
>
>@Override
>public void onRequest() {
>}
>
>@Override
>public void renderHead(IHeaderResponse response) {
>super.renderHead(response);
>response.renderJavascriptReference(NICEDIT_JAVASCRIPT);
>response.renderJavascript("var wicketNicEditor; function
> wicketNicEditorUpdate() {
> wicketNicEditor.nicInstances[0].saveContent(); };", null);
>response.renderOnDomReadyJavascript("wicketNicEditor = new
> nicEditor({iconsPath : '"+ RequestCycle.get().urlFor(
>NICEDIT_ICONS) +"', fullPanel : "+ fullPanel 
> +"}).panelInstance('"
> + getComponent().getMarkupId() + "');");
>}
>
> }
>
> give it a shot and please keep me updated.
>
> francisco
>
>
> On Mon, Jun 16, 2008 at 9:17 PM, Don Hass <[EMAIL PROTECTED]> wrote:
>>
>> Have you tried using this in a ajax based form in Wicket?  It seems that it
>> does not like ajax based submits but the "solutions" in the nicedit forums
>> seems to be fail as well.
>>
>> The problem is that the model for the textarea you add the nic behavior to,
>> never gets updated when you submit the form.  In the scenario I was testing,
>> it is AjaxButton for submission.
>>
>>
>>
>> francisco treacy-2 wrote:
>>>
>>> hi,
>>>
>>> i thought i'd like to share a simple behaviour for NicEdit
>>> (http://nicedit.com/).
>>>
>>> to use it, just download nicedit and modify NICEDIT_JAVASCRIPT and
>>> NICEDIT_ICONS accordingly.  (i chose to put them together in the same
>>> package).
>>> if you download the basic version (without xhtml/ code view), when
>>> adding the behaviour pass 'false' into the constructor, in order not
>>> to use the full panel.
>>>
>>> of course, you can use it with multiple textareas in the same page.
>>>
>>> let me know if you run into some problem using it. should this belong
>>> to the wiki as well?
>>>
>>> francisco
>>>
>>>
>>> public class NicEditTextAreaBehavior extends AbstractBehavior {
>>>
>>>   private Component> textArea;
>>>   private Boolean fullPanel = Boolean.TRUE;
>>>
>>>   private static final ResourceReference NICEDIT_JAVASCRIPT =
>>>   new JavascriptResourceReference(NicEditTextAreaBehavior.class,
>>> "nicEdit.js");
>>>
>>>   private static final ResourceReference NICEDIT_ICONS = new
>>> ResourceReference(NicEditTextAreaBehavior.class,
>>>   "nicEditorIcons.gif");
>>>
>>>   public NicEditTextAreaBehavior() {
>>>   }
>>>
>>>   public NicEditTextAreaBehavior(Boolean fullPanel) {
>>>  

Re: NicEditTextAreaBehavior

2008-06-17 Thread francisco treacy
hey don,

i'm sorry, i just published it too fast :)  i was having some trouble
with my persistence layer so i thought the model was getting updated
cause wasn't hitting the db.

ajax or not, it wouldn't work either way. before calling the submit
button, contents have to be updated.

so here i came up with a new version that works (i believe with ajax
only, and with one textarea for the moment). i'm by no  means an ajax
expert (hmm, in fact, i dislike javascript :) so this is a call to
wicket ajax gurus: could you help me improve this code?

usage:

(...)
final NicEditTextAreaBehavior behavior = new NicEditTextAreaBehavior();
textarea.add(behavior);
(...)

form.add(new AjaxFallbackButton("submit", form) {

@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return behavior.NICEDIT_AJAX_BUTTON_DECORATOR;
}

(...)

});

(...)




public class NicEditTextAreaBehavior extends AbstractAjaxBehavior {

private Boolean fullPanel = Boolean.TRUE;

private static final ResourceReference NICEDIT_JAVASCRIPT =
new JavascriptResourceReference(NicEditTextAreaBehavior.class, 
"nicEdit.js");

private static final ResourceReference NICEDIT_ICONS = new
ResourceReference(NicEditTextAreaBehavior.class,
"nicEditorIcons.gif");

public static final AjaxCallDecorator NICEDIT_AJAX_BUTTON_DECORATOR =
new AjaxCallDecorator() {
@Override
public CharSequence decorateScript(final CharSequence script) {
return
"wicketNicEditor.nicInstances[0].saveContent();" + script;
}
};

public NicEditTextAreaBehavior() {
}

public NicEditTextAreaBehavior(Boolean fullPanel) {
this.fullPanel = fullPanel;
}   

@Override
protected void onBind() {
super.onBind();
getComponent().setOutputMarkupId(true);
}

@Override
public void onRequest() {
}

@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.renderJavascriptReference(NICEDIT_JAVASCRIPT);
response.renderJavascript("var wicketNicEditor; function
wicketNicEditorUpdate() {
wicketNicEditor.nicInstances[0].saveContent(); };", null);
response.renderOnDomReadyJavascript("wicketNicEditor = new
nicEditor({iconsPath : '"+ RequestCycle.get().urlFor(
NICEDIT_ICONS) +"', fullPanel : "+ fullPanel 
+"}).panelInstance('"
+ getComponent().getMarkupId() + "');");
}

}

give it a shot and please keep me updated.

francisco


On Mon, Jun 16, 2008 at 9:17 PM, Don Hass <[EMAIL PROTECTED]> wrote:
>
> Have you tried using this in a ajax based form in Wicket?  It seems that it
> does not like ajax based submits but the "solutions" in the nicedit forums
> seems to be fail as well.
>
> The problem is that the model for the textarea you add the nic behavior to,
> never gets updated when you submit the form.  In the scenario I was testing,
> it is AjaxButton for submission.
>
>
>
> francisco treacy-2 wrote:
>>
>> hi,
>>
>> i thought i'd like to share a simple behaviour for NicEdit
>> (http://nicedit.com/).
>>
>> to use it, just download nicedit and modify NICEDIT_JAVASCRIPT and
>> NICEDIT_ICONS accordingly.  (i chose to put them together in the same
>> package).
>> if you download the basic version (without xhtml/ code view), when
>> adding the behaviour pass 'false' into the constructor, in order not
>> to use the full panel.
>>
>> of course, you can use it with multiple textareas in the same page.
>>
>> let me know if you run into some problem using it. should this belong
>> to the wiki as well?
>>
>> francisco
>>
>>
>> public class NicEditTextAreaBehavior extends AbstractBehavior {
>>
>>   private Component> textArea;
>>   private Boolean fullPanel = Boolean.TRUE;
>>
>>   private static final ResourceReference NICEDIT_JAVASCRIPT =
>>   new JavascriptResourceReference(NicEditTextAreaBehavior.class,
>> "nicEdit.js");
>>
>>   private static final ResourceReference NICEDIT_ICONS = new
>> ResourceReference(NicEditTextAreaBehavior.class,
>>   "nicEditorIcons.gif");
>>
>>   public NicEditTextAreaBehavior() {
>>   }
>>
>>   public NicEditTextAreaBehavior(Boolean fullPanel) {
>>   this.fullPanel = fullPanel;
>>   }
>>
>>   @Override @SuppressWarnings("unchecked")
>>   public void bind(Component component) {
>>   this.textArea = component;
>>   component.setOutputMarkupId(true);
>>   }
>>
>>   @Override
>>   public void renderHead(IHeaderResponse response) {
>>   super.renderHead(response);
>>   res

Re: MultiFileUploadField - uploads collection always empty

2008-06-17 Thread Igor Vaynberg
what happens if you move the form out into a top level form?

-igor

On Tue, Jun 17, 2008 at 8:21 AM, Kurt Heston <[EMAIL PROTECTED]> wrote:
> I took the code verbatim from the examples site and can't ever get anything
> from the "uploads" collection.  The UI components appear to work well in the
> browser and no errors are thrown, but when I try to iterate the collection
> upon hitting the Upload button, there's nothing there.
>
> My MultiFileUploadField and file list are on a tab within another form.  I'm
> thinking the problem is related to having a form within a form.  Any other
> suggestions?
>
> -
> 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]



MultiFileUploadField - uploads collection always empty

2008-06-17 Thread Kurt Heston
I took the code verbatim from the examples site and can't ever get 
anything from the "uploads" collection.  The UI components appear to 
work well in the browser and no errors are thrown, but when I try to 
iterate the collection upon hitting the Upload button, there's nothing 
there.


My MultiFileUploadField and file list are on a tab within another form.  
I'm thinking the problem is related to having a form within a form.  Any 
other suggestions?


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



Re: Validation in FormComponentPanel

2008-06-17 Thread Igor Vaynberg
instead of invalid() call error(msg);

-igor

On Tue, Jun 17, 2008 at 8:01 AM, NTS <[EMAIL PROTECTED]> wrote:
>
> Hi,
>   I have written a simple date component with 3 dropdowns using
> FormComponentPanel.
> In the method convertInput, I am doing
>
>Integer day = (Integer) day.getConvertedInput();
>Integer month = (Integer) month.getConvertedInput();
>Integer year = (Integer) year.getConvertedInput();
>LocalDate date;
>
>   try {
>date = new LocalDate(year, month, year);
>setConvertedInput(date);
>} catch (IllegalArgumentException e) {
>MyCalendarPanel.this.error(e.getMessage());
>invalid();
>}
>
> On the screen when I select 31-Nov-2008(wrong date!), the form is not
> submitted due to error but I am not getting error message on my feedback
> panel. Am I missing something?
>
> Regards,
> NTS
>
> -
> http://ntsrikanth.blogspot.com/
> --
> View this message in context: 
> http://www.nabble.com/Validation-in-FormComponentPanel-tp17913141p17913141.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: Making all Wicket URL start with a subpath

2008-06-17 Thread James Carman
Have you tried mounting the WicketFilter with a different url-mapping?

On Tue, Jun 17, 2008 at 11:04 AM, aaime74 <[EMAIL PROTECTED]> wrote:
>
> Hi,
> at GeoServer (www.geoserver.org) we're switching the web UI from Struts2 to
> Wicket. Looks promising, but there's one catch: we'd like all of our UI
> paths to be located under /geoserver/ui instead of /geoserver directly, even
> for the wicket non mounted URLs. This is because we have other services
> installed on other paths, and we'd like to keep everything separated.
> So, is there any place where we can plugin in the general URL encoding
> strategy to force all wicket url to start with /geoserver/ui?
> --
> View this message in context: 
> http://www.nabble.com/Making-all-Wicket-URL-start-with-a-subpath-tp17913538p17913538.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]



Making all Wicket URL start with a subpath

2008-06-17 Thread aaime74

Hi,
at GeoServer (www.geoserver.org) we're switching the web UI from Struts2 to
Wicket. Looks promising, but there's one catch: we'd like all of our UI
paths to be located under /geoserver/ui instead of /geoserver directly, even
for the wicket non mounted URLs. This is because we have other services
installed on other paths, and we'd like to keep everything separated.
So, is there any place where we can plugin in the general URL encoding
strategy to force all wicket url to start with /geoserver/ui? 
-- 
View this message in context: 
http://www.nabble.com/Making-all-Wicket-URL-start-with-a-subpath-tp17913538p17913538.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]



Validation in FormComponentPanel

2008-06-17 Thread NTS

Hi,
   I have written a simple date component with 3 dropdowns using
FormComponentPanel.
In the method convertInput, I am doing 

Integer day = (Integer) day.getConvertedInput();
Integer month = (Integer) month.getConvertedInput();
Integer year = (Integer) year.getConvertedInput();
LocalDate date;

   try {
date = new LocalDate(year, month, year);
setConvertedInput(date);
} catch (IllegalArgumentException e) {
MyCalendarPanel.this.error(e.getMessage());
invalid();
}

On the screen when I select 31-Nov-2008(wrong date!), the form is not
submitted due to error but I am not getting error message on my feedback
panel. Am I missing something?

Regards,
NTS

-
http://ntsrikanth.blogspot.com/
-- 
View this message in context: 
http://www.nabble.com/Validation-in-FormComponentPanel-tp17913141p17913141.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: isVisible vs. setVisible

2008-06-17 Thread Igor Vaynberg
yep. the problem right now is that we have:

set/isVisible - used by user to control visibility
set/isVisibleAllowed - used by the framework to enforce visibility
independent of user's choice
isRenderAllowed - used by authorization strategies

the true visibility of the component is actually the conjunction of
all three. this is really annoying because any time you want to really
make sure your component is visible you have to test all three and it
is not quiet obvious to the uninitiated.

imho you should be able to simply say component.isvisible() and use
that value because that is the most obvious method call. but this is a
big api break, so maybe in 1.5.

-igor

On Tue, Jun 17, 2008 at 12:15 AM, Johan Compagner <[EMAIL PROTECTED]> wrote:
> Igor already has plans to fix/change that
>
> something like isVisible and setVisible both final
> and then you can override visible() that we check for you in the isVisible()
> method (but first also we check our own flag)
> so both setVisible() and your overridden visible() are working fine. (and we
> can test other stuff like isVisibleInHierarchy and so on.
>
> johan
>
> On Mon, Jun 16, 2008 at 11:52 PM, Matthijs Wensveen <[EMAIL PROTECTED]>
> wrote:
>
>> Of course I have a few things to learn, and I hope I never stop learning.
>> The article you provide is interesting.
>>
>> My opinion is that for domain entity objects, getters and setters are
>> certainly not evil. For classes that are more service-like, getters and
>> setters could be useful but should be considered well. In case you choose
>> not to have a getter and a setter one should be extra careful when choosing
>> method names. I usually expect a setVisible method when there is also an
>> isVisible method. Immutable classes, or classes with read-only properties
>> can choose to only provide a getter for some properties. But if a method
>> like isVisible is intended to be overridden something like public boolean
>> visible() might be better. But I guess this is also a matter of style and
>> taste.
>>
>> As for Component.set/isVisible, I like that I can do both, even if it gives
>> me the possibility of ambiguous code like new Component() {isVisible()
>> {return true;};}.setVisible(false) or something like that (it is actually
>> not ambiguous at all of course, but you do have to read extra careful). So
>> whatever reason you (core devs) originally had for providing a setter, I am
>> thankful for that.
>>
>> Matthijs
>>
>>
>> Jonathan Locke wrote:
>>
>>> i think you may have a few things to learn and it is not exactly
>>> controversial to prefer immutability or encapsulation... setters break
>>> encapsulation and i think it is safe to say decades of experience with
>>> object systems is on my side, including industry luminaries like:
>>>
>>> http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html
>>>
>>>
>>> Matthijs Wensveen-2 wrote:
>>>
>>>
 Jonathan Locke wrote:


> true.
> in the isVisible impl you could lazy-init cache a transient Boolean
> until
> end request where you set it null.
> setters are evil.
>
>
 ..but it's good to have choice. *And* setVisible is not a normal setter,
 because it returns the component, which makes it easy to add an initially
 invisible component like: add(new Label("profanity",
 "[EMAIL PROTECTED]").setVisible(false));

 Also, with is/setVisible you van use the component with a propertymodel
 to have some other component toggle the visibility of another component.
 This way you have the best of both worlds.

 A little off-topic: It scares me a little when core developer make bold
 statements like: "setters are evil" and "I wouldn't mind final was the
 default in java". Maybe I'm just being paranoid here...

 Matthijs



> egolan74 wrote:
>
>
>> Yes but ...
>> isVisible may be triggered several times, while setVisible should only
>> be
>> called once (say if I do it only once after creating the component).
>> Usually I prefer the state driven way, but what if the logic has a lot
>> of
>> overhead?
>>
>>
>>
>> Jonathan Locke wrote:
>>
>>
>>> isVisible is generally better imo because it is state driven.  if you
>>> push instead of pull, the state can get stale.
>>>
>>>
>>>
>>>
>>
>>
>
>
 --
 Matthijs Wensveen
 Func. Internet Integration
 W http://www.func.nl
 T +31 20 423
 F +31 20 4223500

 -
 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: users, please give us your opinion: what is your take on generics with Wicket

2008-06-17 Thread Taranenko

Hi *,

My point of view, static type checking is more important as API cleareness.
In any case using modern IDE make more help in this area. 
Some exercises in also useful for programmers (but not coders though :).
Wicket was born as a framework for the qualified programmers. I think no
reason why wicket should demote self for anybody, who can not understand
generics.

1) Generifying* Wicket
   [x] Can best be done like currently in the 1.4 branch, where models
and components are both generified. I care most about the improved
static type checking generified models and components give Wicket.
   [ ] Can best be done in a limited fashion, where we only generify
IModel but not components. I care more about what generifying can do
for API clarity (declaring a component to only accept certain models
for instance) than static type checking.
   [ ] Should be avoided, I prefer the way 1.3 works. Because... (fill
in your opinion here).
   [ ]  (anything other than these choices?)

2) How strongly do you feel about your choice above?
   [x] Whatever choice ultimately made, I'll happily convert/ start
using 1.4 and up.
   [ ] I might rethink upgrading if my choice doesn't win.
   [ ] I definitively won't be using 1.4. if Wicket doesn't go for my
preference.

Thanks 
-- 
View this message in context: 
http://www.nabble.com/users%2C-please-give-us-your-opinion%3A-what-is-your-take-on-generics-with-Wicket-tp17589984p17902256.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: isVisible vs. setVisible

2008-06-17 Thread Matthijs Wensveen

Nice!

Johan Compagner wrote:

Igor already has plans to fix/change that

something like isVisible and setVisible both final
and then you can override visible() that we check for you in the isVisible()
method (but first also we check our own flag)
so both setVisible() and your overridden visible() are working fine. (and we
can test other stuff like isVisibleInHierarchy and so on.

johan

On Mon, Jun 16, 2008 at 11:52 PM, Matthijs Wensveen <[EMAIL PROTECTED]>
wrote:

  

Of course I have a few things to learn, and I hope I never stop learning.
The article you provide is interesting.

My opinion is that for domain entity objects, getters and setters are
certainly not evil. For classes that are more service-like, getters and
setters could be useful but should be considered well. In case you choose
not to have a getter and a setter one should be extra careful when choosing
method names. I usually expect a setVisible method when there is also an
isVisible method. Immutable classes, or classes with read-only properties
can choose to only provide a getter for some properties. But if a method
like isVisible is intended to be overridden something like public boolean
visible() might be better. But I guess this is also a matter of style and
taste.

As for Component.set/isVisible, I like that I can do both, even if it gives
me the possibility of ambiguous code like new Component() {isVisible()
{return true;};}.setVisible(false) or something like that (it is actually
not ambiguous at all of course, but you do have to read extra careful). So
whatever reason you (core devs) originally had for providing a setter, I am
thankful for that.

Matthijs


Jonathan Locke wrote:



i think you may have a few things to learn and it is not exactly
controversial to prefer immutability or encapsulation... setters break
encapsulation and i think it is safe to say decades of experience with
object systems is on my side, including industry luminaries like:

http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html


Matthijs Wensveen-2 wrote:


  

Jonathan Locke wrote:




true.
in the isVisible impl you could lazy-init cache a transient Boolean
until
end request where you set it null.
setters are evil.


  

..but it's good to have choice. *And* setVisible is not a normal setter,
because it returns the component, which makes it easy to add an initially
invisible component like: add(new Label("profanity",
"[EMAIL PROTECTED]").setVisible(false));

Also, with is/setVisible you van use the component with a propertymodel
to have some other component toggle the visibility of another component.
This way you have the best of both worlds.

A little off-topic: It scares me a little when core developer make bold
statements like: "setters are evil" and "I wouldn't mind final was the
default in java". Maybe I'm just being paranoid here...

Matthijs





egolan74 wrote:


  

Yes but ...
isVisible may be triggered several times, while setVisible should only
be
called once (say if I do it only once after creating the component).
Usually I prefer the state driven way, but what if the logic has a lot
of
overhead?



Jonathan Locke wrote:




isVisible is generally better imo because it is state driven.  if you
push instead of pull, the state can get stale.




  

  

--
Matthijs Wensveen
Func. Internet Integration
W http://www.func.nl
T +31 20 423
F +31 20 4223500

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





  



--
Matthijs Wensveen
Func. Internet Integration
W http://www.func.nl
T +31 20 423
F +31 20 4223500 



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



Re: JUnit tests for Swarm

2008-06-17 Thread Maurice Marrink
Well it depends on what you want to test.

with the 1.3-snapshots you can test independtly, see HiveTest which
tests your policy file. you can expand on that to test if certain
subjects have the permissions you expect them too, if all your pages
are accounted for in the policy file, etc.

But somethings just have to be tested with a running wicket
application, for instance componentpermission inheritance, or you end
up duplicating a lot. see for instance the testcases in the swarm
project.

Maurice


On Tue, Jun 17, 2008 at 2:03 PM, Andrea Jahn <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would like to write JUnit tests for the Swarm/Wasp security layer of our
> application.
>
> Am I right, that it would make sense to test the wicket layer independent of
> the security layer
> and separately the Wasp/Swarm functionality ?
>
> How could I start doing this or perhaps are there examples existing ???
>
>
> Thanks
> Andrea
>

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



JUnit tests for Swarm

2008-06-17 Thread Andrea Jahn
Hi,

I would like to write JUnit tests for the Swarm/Wasp security layer of our
application.

Am I right, that it would make sense to test the wicket layer independent of
the security layer
and separately the Wasp/Swarm functionality ?

How could I start doing this or perhaps are there examples existing ???


Thanks
Andrea


Re: Root cause:java.lang.IllegalArgumentException: Argument pageClass must be an instance of org.apache.wicket.Page

2008-06-17 Thread Eyal Golan
what does your getHomePage in the application return ?

On Tue, Jun 17, 2008 at 2:56 PM, Samit <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I am trying to deploy my basic HelloWorld Wicket application on weblogic
> 8.1
> But I am not able to view the home page.
>
> Root cause:java.lang.IllegalArgumentException: Argument pageClass must be
> an
> instance of org.apache.wicket.Page at
>
> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.(BookmarkablePageRequestTarget.java:107)
> at
>
> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.(BookmarkablePageRequestTarget.java:70)
> at
>
> org.apache.wicket.request.AbstractRequestCycleProcessor.resolveHomePageTarget(AbstractRequestCycleProcessor.java:319)
> at
>
> org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:159)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1152) at
> org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245) at
> org.apache.wicket.RequestCycle.request(RequestCycle.java:489) at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
> at
>
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
> at
> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
> at
>
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6724)
> at
>
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
> at
>
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
> at
>
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219) at
> weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
>
>
> Plz help me to resolve this...
>
> Thanks a lot
> Samit Katiyar
>
> :confused:
>
> -
> Samit :confused:
> --
> View this message in context:
> http://www.nabble.com/Root-cause%3Ajava.lang.IllegalArgumentException%3A-Argument-pageClass-must-be-an-instance-of-org.apache.wicket.Page-tp17890603p17890603.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]
>
>


-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74


Root cause:java.lang.IllegalArgumentException: Argument pageClass must be an instance of org.apache.wicket.Page

2008-06-17 Thread Samit

Hi,

I am trying to deploy my basic HelloWorld Wicket application on weblogic 8.1
But I am not able to view the home page.

Root cause:java.lang.IllegalArgumentException: Argument pageClass must be an
instance of org.apache.wicket.Page at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.(BookmarkablePageRequestTarget.java:107)

at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.(BookmarkablePageRequestTarget.java:70)

at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveHomePageTarget(AbstractRequestCycleProcessor.java:319)

at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:159)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1152) at
org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245) at
org.apache.wicket.RequestCycle.request(RequestCycle.java:489) at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6724)

at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)

at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)

at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219) at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)


Plz help me to resolve this...

Thanks a lot
Samit Katiyar 

:confused:

-
Samit :confused:
-- 
View this message in context: 
http://www.nabble.com/Root-cause%3Ajava.lang.IllegalArgumentException%3A-Argument-pageClass-must-be-an-instance-of-org.apache.wicket.Page-tp17890603p17890603.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: Dynamic Form Data Retrieval

2008-06-17 Thread wfroud

Thanks for your suggestion Maurice, I had a bit of trouble getting the syntax
to work correctly so resorted to another solution which I've explained below
for those that might come across this post. It's probably not the best
solution but it's good enough for my demo tomorrow!

Instead of passing a model as the second argument to the getParamPanels
method I passed an object.
This object is then used to hold a list of Models.
Then when adding the components to the list I added the models to a list as
well stored within this second object:

>for (QueryDefParam p : qdp) {

QueryParamValue valueModel = new QueryParamValue(); // this is a generic
model that I'm going to try and use for each component

>if ("TextField".equals(p.getName())) {
>params.add(new TextFieldPanel("panel", new
> CompoundPropertyModel(compModel), p.getDescription()));
>}
>else if ("CheckBox".equals(p.getName())) {
>params.add(new CheckBoxPanel("panel", null,
> p.getDescription()));
>}

response.addValues(valueModel); // we must add the new model to the list

>}

Then when the Submit button is pressed I am able to just loop through the
list from the response object.

Thanks again,

Will


Mr Mean wrote:
> 
> In the Button.onSubmit do getForm.visitChildren(FormComponent.class,
> new IVisitor()
> {
>public Object component(Component component)
>{
>   //do something with the models from the components here.
>}
> }
> 
> Maurice
> 
> On Fri, Jun 13, 2008 at 2:10 PM, wfroud <[EMAIL PROTECTED]> wrote:
>>
>> Hi All,
>>
>> I have successfully written some code to create a dynamic form depending
>> on
>> drop down selection.
>>
>> I have used the technique described here
>> http://cwiki.apache.org/WICKET/forms-with-dynamic-elements.html
>>
>> A shortened copy of the code is below.
>>
>> The problem I'm now having is how to extract data entered into the
>> dynamically generated components.
>> I'm starting with trying to get information from the TextField component,
>> so
>> any help regarding
>> this would be of enormous help. Please refer to the TODO comments below,
>> I
>> think I'm close.
>>
>>
>> // Define a model to hold values for any component, at the moment just
>> the
>> TextField.
>>
>> final ComponentPanelModel compPanelModel = new ComponentPanelModel();
>>
>> // Define the list model.
>>
>> final List paramsList = getParamPanels(queryDef, compPanelModel);
>>
>> IModel paramsModel = new LoadableDetachableModel() {
>>protected Object load() {
>>return paramsList;
>>}
>> };
>>
>> // Then add the list to the page.
>>
>> f.add(new ListView("paramsList", paramsModel) {
>>
>>@Override
>>public ListView setReuseItems(boolean arg) {
>>// According to
>> http://cwiki.apache.org/WICKET/using-listviews.html
>>// we need to add this or items will be removed and
>> re-added,
>>// without being validated.
>>return super.setReuseItems(true);
>>}
>>
>>@Override
>>protected void populateItem(ListItem item) {
>>Panel p = (Panel) item.getModelObject();
>>item.setModel(new CompoundPropertyModel(p));
>>item.add(p);
>>}
>>
>>private void optimizedItemRemoval() {
>>// According to
>> http://cwiki.apache.org/WICKET/forms-with-dynamic-elements.html
>>// this should be used to prevent components from
>> forgetting content.
>>// Not sure how to yet.
>>}
>> });
>>
>> // This is the method that returns the various panels:
>>
>> public List getParamPanels(QueryDef queryDef, ComponentPanelModel
>> compModel)
>> {
>>
>>List params = new ArrayList();
>>if (queryDef == null) {
>>return params;
>>}
>>
>>List qdp =
>> queryDefParamDao.getQueryDefParams(queryDef.getQueryDefId());
>>
>>for (QueryDefParam p : qdp) {
>>
>>if ("TextField".equals(p.getName())) {
>>params.add(new TextFieldPanel("panel", new
>> CompoundPropertyModel(compModel), p.getDescription()));
>>}
>>else if ("CheckBox".equals(p.getName())) {
>>params.add(new CheckBoxPanel("panel",
>> null, p.getDescription()));
>>}
>>
>>}
>>
>>return params;
>> }
>>
>> f.add(new Button("save") {
>>public void onSubmit() {
>>
>>// TODO Iterate through the list of panels, which may
>> differ TextField,
>> Check box etc.
>>// TODO For each one we need to be able to access the
>> model objects value.
>>
>>}
>> });
>>
>>
>> public class C

Re: After 1 minute the Pagemap null is still locked

2008-06-17 Thread Johan Compagner
start tomcat or jetty just with java in the command prompt. So that you have
a console window

Also you can use other tools like yourkit to see the stack traces (or jmx)
johan


On Tue, Jun 17, 2008 at 12:14 PM, lienok
<[EMAIL PROTECTED]<[EMAIL PROTECTED]>>
wrote:

>
> Hi Johan,
>
> I am sorry but I don't understand. How can I run wicket application just
> from the console?
> Which class should I lunch to start it?
>
>
> Johan Compagner wrote:
> >
> > run java.exe in a console and do CTRL-BREAK
> >
> >
> >
> > On Tue, Jun 17, 2008 at 11:57 AM, lienok
> > <[EMAIL PROTECTED] <[EMAIL PROTECTED]><[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> >>
> > wrote:
> >
> >>
> >> Hello
> >>
> >> I have the similar problem, but not running on Unix. Can you please help
> >> me
> >> how can get thread dump in windows?
> >>
> >> any advice appreciated
> >> Lenka
> >>
> >>
> >> On 18/03/2008, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> >> > Glad to be of help. kill -3 is one of those gems you should never
> >> >  forget as it can save your life. "Kill to save your life": nice
> >> >  slogan... :D
> >> >
> >> >
> >> >  Martijn
> >> >
> >> >
> >> >  On 3/19/08, Jeremy Levy <[EMAIL PROTECTED]> wrote:
> >> >  > Thanks Igor / Martijn for your help.
> >> >  >
> >> >  >  As you mentioned Wicket had nothing to do with it.  I had a piece
> >> of
> >> > code
> >> >  >  that was executed when a user clicked a certain link and was
> >> blocking
> >> > by
> >> >  >  accident, caught in a loop peging the CPU.  Your suggestions of
> >> kill
> >> > -3 to
> >> >  >  get the thread dump over a couple of samples helped me to narrow
> >> down
> >> > the
> >> >  >  issue and fix it.
> >> >  >
> >> >  >  Thanks very much.
> >> >  >
> >> >  >
> >> >  >  Jeremy
> >> >  >
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/After-1-minute-the-Pagemap-null-is-still-locked-tp16129637p17881661.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]
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/After-1-minute-the-Pagemap-null-is-still-locked-tp16129637p17881906.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: After 1 minute the Pagemap null is still locked

2008-06-17 Thread lienok

Hi Johan,

I am sorry but I don't understand. How can I run wicket application just
from the console? 
Which class should I lunch to start it?  


Johan Compagner wrote:
> 
> run java.exe in a console and do CTRL-BREAK
> 
> 
> 
> On Tue, Jun 17, 2008 at 11:57 AM, lienok
> <[EMAIL PROTECTED]<[EMAIL PROTECTED]>>
> wrote:
> 
>>
>> Hello
>>
>> I have the similar problem, but not running on Unix. Can you please help
>> me
>> how can get thread dump in windows?
>>
>> any advice appreciated
>> Lenka
>>
>>
>> On 18/03/2008, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
>> > Glad to be of help. kill -3 is one of those gems you should never
>> >  forget as it can save your life. "Kill to save your life": nice
>> >  slogan... :D
>> >
>> >
>> >  Martijn
>> >
>> >
>> >  On 3/19/08, Jeremy Levy <[EMAIL PROTECTED]> wrote:
>> >  > Thanks Igor / Martijn for your help.
>> >  >
>> >  >  As you mentioned Wicket had nothing to do with it.  I had a piece
>> of
>> > code
>> >  >  that was executed when a user clicked a certain link and was
>> blocking
>> > by
>> >  >  accident, caught in a loop peging the CPU.  Your suggestions of
>> kill
>> > -3 to
>> >  >  get the thread dump over a couple of samples helped me to narrow
>> down
>> > the
>> >  >  issue and fix it.
>> >  >
>> >  >  Thanks very much.
>> >  >
>> >  >
>> >  >  Jeremy
>> >  >
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/After-1-minute-the-Pagemap-null-is-still-locked-tp16129637p17881661.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]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/After-1-minute-the-Pagemap-null-is-still-locked-tp16129637p17881906.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: After 1 minute the Pagemap null is still locked

2008-06-17 Thread Johan Compagner
run java.exe in a console and do CTRL-BREAK



On Tue, Jun 17, 2008 at 11:57 AM, lienok
<[EMAIL PROTECTED]<[EMAIL PROTECTED]>>
wrote:

>
> Hello
>
> I have the similar problem, but not running on Unix. Can you please help me
> how can get thread dump in windows?
>
> any advice appreciated
> Lenka
>
>
> On 18/03/2008, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> > Glad to be of help. kill -3 is one of those gems you should never
> >  forget as it can save your life. "Kill to save your life": nice
> >  slogan... :D
> >
> >
> >  Martijn
> >
> >
> >  On 3/19/08, Jeremy Levy <[EMAIL PROTECTED]> wrote:
> >  > Thanks Igor / Martijn for your help.
> >  >
> >  >  As you mentioned Wicket had nothing to do with it.  I had a piece of
> > code
> >  >  that was executed when a user clicked a certain link and was blocking
> > by
> >  >  accident, caught in a loop peging the CPU.  Your suggestions of kill
> > -3 to
> >  >  get the thread dump over a couple of samples helped me to narrow down
> > the
> >  >  issue and fix it.
> >  >
> >  >  Thanks very much.
> >  >
> >  >
> >  >  Jeremy
> >  >
>
>
> --
> View this message in context:
> http://www.nabble.com/After-1-minute-the-Pagemap-null-is-still-locked-tp16129637p17881661.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: After 1 minute the Pagemap null is still locked

2008-06-17 Thread lienok

Hello 

I have the similar problem, but not running on Unix. Can you please help me
how can get thread dump in windows?

any advice appreciated
Lenka


On 18/03/2008, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> Glad to be of help. kill -3 is one of those gems you should never
>  forget as it can save your life. "Kill to save your life": nice
>  slogan... :D
>
>
>  Martijn
>
>
>  On 3/19/08, Jeremy Levy <[EMAIL PROTECTED]> wrote:
>  > Thanks Igor / Martijn for your help.
>  >
>  >  As you mentioned Wicket had nothing to do with it.  I had a piece of
> code
>  >  that was executed when a user clicked a certain link and was blocking
> by
>  >  accident, caught in a loop peging the CPU.  Your suggestions of kill
> -3 to
>  >  get the thread dump over a couple of samples helped me to narrow down
> the
>  >  issue and fix it.
>  >
>  >  Thanks very much.
>  >
>  >
>  >  Jeremy
>  >


-- 
View this message in context: 
http://www.nabble.com/After-1-minute-the-Pagemap-null-is-still-locked-tp16129637p17881661.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]



Two gmap2 applications

2008-06-17 Thread smallufo
FYI...

http://destiny.xfiles.to/app/calendar/StarTrans

http://destiny.xfiles.to/app/LuckyMap

BR


Re: The component(s) below failed to render

2008-06-17 Thread Michael_Bo

No that doesn't really help, because I do not want to edit the second bean, I
only want to see all objects of the second bean. And if possible that
objects in a dropdownlist.

chears Michael



Dan Syrstad-2 wrote:
> 
> In WWB, if you want the related bean to only show certain attributes, you
> can put something like:
> 
> YourBean { ...  props: name, -someOtherAttribute, ...;  ... }
> 
> in your beanprops file. This will remove "someOtherAttribute" from your
> view. Does that help?
> 
> -Dan
> 
> On Fri, Jun 13, 2008 at 6:02 AM, Michael_Bo <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> No, i've added the dropdownchoice to the markup and did not forgot. My
>> problem is a little bit more complex.
>> with wicket web beans you can't display a bean, that has a relation to an
>> another bean. This relationed bean is showed with all attributes. But i
>> Only
>> wan't one or two, like 'name'. So What i've tried was to remove first the
>> relationed attribut from the bean, then create a BeanForm, and then add
>> my
>> special DropDownChoice to this created BeanForm. But because using the
>> wicket templates, adding an own Componte doesn't realy work.
>>
>> Did you understand the problem?
>>
>> chears Michael
>>
>>
>> greeklinux wrote:
>> >
>> > Do you add the DropDownChoice to the markup and forgott the wicket id?
>> >
>> >
>> >
>> > Michael_Bo wrote:
>> >>
>> >> Hi,
>> >>
>> >> i have a problem with some Components. I'm using Wicket Web beans.
>> >> If tried to add an additional form to a beanFrom. Then I get The
>> >> following Error:
>> >>
>> >> WicketMessage: The component(s) below failed to render. A common
>> problem
>> >> is that you have added a component in code but forgot to reference it
>> in
>> >> the markup (thus the component will never be rendered).
>> >>
>> >> 1. [MarkupContainer [Component id = beanRForm, page =
>> >> metaWicket.EditPage, path =
>> >> 2:beanForm:beanRForm.TkDataBeanEditPanel$TkbeanForm, isVisible = true,
>> >> isVersioned = true]]
>> >> 2. [MarkupContainer [Component id = beanDropDown, page =
>> >> metaWicket.EditPage, path =
>> >> 2:beanForm:beanRForm:beanDropDown.DropDownChoice, isVisible = true,
>> >> isVersioned = false]]
>> >>
>> >> Root cause:
>> >>
>> >> org.apache.wicket.WicketRuntimeException: The component(s) below
>> failed
>> >> to render. A common problem is that you have added a component in code
>> >> but forgot to reference it in the markup (thus the component will
>> never
>> >> be rendered).
>> >>
>> >> 1. [MarkupContainer [Component id = beanRForm, page =
>> >> metaWicket.EditPage, path =
>> >> 2:beanForm:beanRForm.TkDataBeanEditPanel$TkbeanForm, isVisible = true,
>> >> isVersioned = true]]
>> >> 2. [MarkupContainer [Component id = beanDropDown, page =
>> >> metaWicket.EditPage, path =
>> >> 2:beanForm:beanRForm:beanDropDown.DropDownChoice, isVisible = true,
>> >> isVersioned = false]]
>> >>
>> >> at org.apache.wicket.Page.checkRendering(Page.java:1116)
>> >> at org.apache.wicket.Page.renderPage(Page.java:914)
>> >> at
>> >>
>> org.apache.wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:163)
>> >> at
>> >>
>> org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:58)
>> >> at
>> >>
>> org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
>> >> at
>> >>
>> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1172)
>> >> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243)
>> >> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
>> >> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>> >> at
>> >>
>> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
>> >> at
>> >>
>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
>> >> at
>> >>
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>> >> at
>> >>
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
>> >> at
>> >>
>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>> >> at
>> >>
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>> >> at
>> >>
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>> >> at
>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>> >> at
>> >>
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>> >> at org.mortbay.jetty.Server.handle(Server.java:295)
>> >> at
>> >>
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
>> >> at
>> >>
>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:827)
>> >> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:511)
>> >> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
>> >> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
>> >> at
>> >>
>> org.mortbay.jetty.bio.SocketC

Re: isVisible vs. setVisible

2008-06-17 Thread Johan Compagner
Igor already has plans to fix/change that

something like isVisible and setVisible both final
and then you can override visible() that we check for you in the isVisible()
method (but first also we check our own flag)
so both setVisible() and your overridden visible() are working fine. (and we
can test other stuff like isVisibleInHierarchy and so on.

johan

On Mon, Jun 16, 2008 at 11:52 PM, Matthijs Wensveen <[EMAIL PROTECTED]>
wrote:

> Of course I have a few things to learn, and I hope I never stop learning.
> The article you provide is interesting.
>
> My opinion is that for domain entity objects, getters and setters are
> certainly not evil. For classes that are more service-like, getters and
> setters could be useful but should be considered well. In case you choose
> not to have a getter and a setter one should be extra careful when choosing
> method names. I usually expect a setVisible method when there is also an
> isVisible method. Immutable classes, or classes with read-only properties
> can choose to only provide a getter for some properties. But if a method
> like isVisible is intended to be overridden something like public boolean
> visible() might be better. But I guess this is also a matter of style and
> taste.
>
> As for Component.set/isVisible, I like that I can do both, even if it gives
> me the possibility of ambiguous code like new Component() {isVisible()
> {return true;};}.setVisible(false) or something like that (it is actually
> not ambiguous at all of course, but you do have to read extra careful). So
> whatever reason you (core devs) originally had for providing a setter, I am
> thankful for that.
>
> Matthijs
>
>
> Jonathan Locke wrote:
>
>> i think you may have a few things to learn and it is not exactly
>> controversial to prefer immutability or encapsulation... setters break
>> encapsulation and i think it is safe to say decades of experience with
>> object systems is on my side, including industry luminaries like:
>>
>> http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html
>>
>>
>> Matthijs Wensveen-2 wrote:
>>
>>
>>> Jonathan Locke wrote:
>>>
>>>
 true.
 in the isVisible impl you could lazy-init cache a transient Boolean
 until
 end request where you set it null.
 setters are evil.


>>> ..but it's good to have choice. *And* setVisible is not a normal setter,
>>> because it returns the component, which makes it easy to add an initially
>>> invisible component like: add(new Label("profanity",
>>> "[EMAIL PROTECTED]").setVisible(false));
>>>
>>> Also, with is/setVisible you van use the component with a propertymodel
>>> to have some other component toggle the visibility of another component.
>>> This way you have the best of both worlds.
>>>
>>> A little off-topic: It scares me a little when core developer make bold
>>> statements like: "setters are evil" and "I wouldn't mind final was the
>>> default in java". Maybe I'm just being paranoid here...
>>>
>>> Matthijs
>>>
>>>
>>>
 egolan74 wrote:


> Yes but ...
> isVisible may be triggered several times, while setVisible should only
> be
> called once (say if I do it only once after creating the component).
> Usually I prefer the state driven way, but what if the logic has a lot
> of
> overhead?
>
>
>
> Jonathan Locke wrote:
>
>
>> isVisible is generally better imo because it is state driven.  if you
>> push instead of pull, the state can get stale.
>>
>>
>>
>>
>
>


>>> --
>>> Matthijs Wensveen
>>> Func. Internet Integration
>>> W http://www.func.nl
>>> T +31 20 423
>>> F +31 20 4223500
>>>
>>> -
>>> 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]
>
>