Re: Cache Wicket Pages rather than Construct New Objects

2011-08-18 Thread Mauro Ciancio
Yes, but AFAIR there could be multithreading issues if you share a page
object among differents threads.
Am I wrong?

Regards.

On Thu, Aug 18, 2011 at 4:26 PM, Hans Lesmeister <
hans.lesmeis...@lessy-software.de> wrote:

> > The link's action is to setResponsePage(MyPage.class), but that creates a
> > new object. Suppose we were keeping all our Page objects in a Session. Is
> > there a way to setResponsePage() to an existing Page instance?
>
> You can replace or extend the DefaultPageFactory (IPageFactory)
>
> Regards
> Hans
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Mauro Ciancio
http://about.me/maurociancio


Re: Before deployment checklist

2011-03-10 Thread Mauro Ciancio
I usually use two set of configuration for Sprint (in case that you're
using it) and also maven profiles allows you to forget setting the
proper one. Also I have two set of logger configs and maven chooses
the correct one.

If you need more details just reply me.

Regards.

On Wed, Mar 9, 2011 at 10:11 AM, Henrique Boregio  wrote:
> Hello. I am getting close to deploying my first wicket web
> application. It's not huge but it does have lots of classes,
> components, database stuff, search features, etc.
>
> I was wondering if anyone had some kind of checklist on what things to
> definitely check before deploying a wicket application into
> production.
>
> Thanks.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Mauro Ciancio
http://about.me/maurociancio

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



Re: Run a standalone wicket app

2011-03-08 Thread Mauro Ciancio
Hello all!
Nice replies, I really appreciate them.

I liked the maven plugin, that was exactly what i was looking for.
Winstone also looked like a good alternative.

Thanks for the replies.
Regards!

On Tue, Mar 8, 2011 at 9:02 PM, Nitnatsnok  wrote:
> To create a runnable .war file with just a maven plugin I used this tool:
>
> http://simplericity.com/2009/11.html
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Run-a-standalone-wicket-app-tp3339521p3342507.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Mauro Ciancio
http://about.me/maurociancio

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



Run a standalone wicket app

2011-03-07 Thread Mauro Ciancio
Hello all,
I'd like to create a jar with a wicket application inside that can be
run from the command line as it were a desktop application. I'm using
maven and jetty and it would be great if jetty could start and listen
on a port.

Any hints or links would be really appreciated.

Thanks in advance.
Regards.
-- 
Mauro Ciancio
http://about.me/maurociancio

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



Re: DatePicker css

2010-11-28 Thread Mauro Ciancio
Hello,

On Wed, Apr 28, 2010 at 3:58 PM, shetc  wrote:
> Stefan -- please show me what the trick was. Thanks, Steve

I came across with this thread and saved me hours!

I wanted to change the background for the month/year selector.
Using this snippet worked great:

.yui-skin-sam .yui-calendar .calheader {
   background-color : white !important;
}

Regards.
-- 
Mauro Ciancio

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



Re: need help with spring annotations

2010-11-25 Thread Mauro Ciancio
Hi,

> How do you inject Hibernate DAOs into your Spring Services using
> annotations? Is that possible?
> I also seem to be having some problems with the sessionFactory being inject
> into the DAOs.
>
> Any ideas?

That is configured with Spring, doesn't depends on Wicket at all. I
usually configure dependencies in XML files but AFAIR you can use
@Autowired annotation.

Regards.
-- 
Mauro Ciancio

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



Re: need help with spring annotations

2010-11-25 Thread Mauro Ciancio
Hello,

>   �...@springbean(name="userService")
>    transient private UserService userService;

Do not use injected beans as transient fields, because it will produce
that the field is not serialized and thus the reference will be null
after the page is hydrated.

If you mark fields with @SpringBean, Wicket will automatically inject
a serializable proxy that can be reconstructed after hydratation.

HTH.
Regards.
-- 
Mauro Ciancio

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



Re: If-Modified-Since header

2010-11-03 Thread Mauro Ciancio
Sorry for bringing up this thread, but I'm still looking for advices.
Should I implement this or Wicket can do it for me?

Regards.

On Sun, Oct 31, 2010 at 2:11 PM, Mauro Ciancio  wrote:
> Hi Martin,
>
> I didn't explain myself very well. I'm using wicket resources, I
> inherited from WebResource and implemented the abstract methods.
>
> Also, I mounted the resources using the following code:
>
> String resourceKey = "photos";
> String alias = "photos"
>
> SharedResources sharedResources = application.getSharedResources();
> sharedResources.putClassAlias(MyWebResource.class, alias);
> sharedResources.add(MyWebResource.class, resourceKey, null, null, new
> MyWebResource());
> webApplication.mount(new
> IndexedSharedResourceCodingStrategy("/photos", alias + "/" +
> resourceKey));
>
> So, I get the pretty urls I wanted. My resources gets mounted at
> "domain.com/photos/my/parameters" and according to the parameters I
> serve differents photos.
>
> Once the photos are uploaded they never change, so I'd like the photos
> be cached. I'm expecting to get a 304 not modified, but the
> If-Modified-Since header is ignored because of the mount path is not
> under '/resources'.
>
> Is this clearer?
> Should I implement the checking for the header or it's supposed that
> wicket could do that for me?
>
> Thanks in advance.
> Regards.
>
> On Sun, Oct 31, 2010 at 6:15 AM, Martin Grigorov  wrote:
>> Hi Mauro,
>>
>> /resources is a special path managed by Wicket, e.g.
>> ResourceReference(MyComponent.class, "myImage.gif") will be reachable at
>> /resources/com.mypackage.MyComponent/myImage.gif
>>
>> Resources which are put in next to WEB-INF folder are not managed by WIcket
>> and they are served directly by the web container
>> Take a look at http://code.google.com/p/wro4j/
>>
>> On Sun, Oct 31, 2010 at 1:11 AM, Mauro Ciancio wrote:
>>
>>> Hello everyone:
>>>
>>> I've been trying to get properly working the caching in my site's
>>> resources using the if-modified-since header. I've noticed that the
>>> check for the header is only done if the resource is mounted under the
>>> '/resources' url (wicket filter @ line 1130, Wicket 1.4).
>>>
>>> My resources are mounted under another url ('/photos'). I was
>>> wondering why the check is restricted to that url. Also, I've tried to
>>> mount my resources under /resources/photos but I get an exception that
>>> says 'cannot be mounted under /resources'.
>>>
>>> Any advices?
>>> Thanks in advance.
>>> --
>>> Mauro Ciancio
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>
>
>
> --
> Mauro Ciancio
>



-- 
Mauro Ciancio

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



Re: If-Modified-Since header

2010-10-31 Thread Mauro Ciancio
Hi Martin,

I didn't explain myself very well. I'm using wicket resources, I
inherited from WebResource and implemented the abstract methods.

Also, I mounted the resources using the following code:

String resourceKey = "photos";
String alias = "photos"

SharedResources sharedResources = application.getSharedResources();
sharedResources.putClassAlias(MyWebResource.class, alias);
sharedResources.add(MyWebResource.class, resourceKey, null, null, new
MyWebResource());
webApplication.mount(new
IndexedSharedResourceCodingStrategy("/photos", alias + "/" +
resourceKey));

So, I get the pretty urls I wanted. My resources gets mounted at
"domain.com/photos/my/parameters" and according to the parameters I
serve differents photos.

Once the photos are uploaded they never change, so I'd like the photos
be cached. I'm expecting to get a 304 not modified, but the
If-Modified-Since header is ignored because of the mount path is not
under '/resources'.

Is this clearer?
Should I implement the checking for the header or it's supposed that
wicket could do that for me?

Thanks in advance.
Regards.

On Sun, Oct 31, 2010 at 6:15 AM, Martin Grigorov  wrote:
> Hi Mauro,
>
> /resources is a special path managed by Wicket, e.g.
> ResourceReference(MyComponent.class, "myImage.gif") will be reachable at
> /resources/com.mypackage.MyComponent/myImage.gif
>
> Resources which are put in next to WEB-INF folder are not managed by WIcket
> and they are served directly by the web container
> Take a look at http://code.google.com/p/wro4j/
>
> On Sun, Oct 31, 2010 at 1:11 AM, Mauro Ciancio wrote:
>
>> Hello everyone:
>>
>> I've been trying to get properly working the caching in my site's
>> resources using the if-modified-since header. I've noticed that the
>> check for the header is only done if the resource is mounted under the
>> '/resources' url (wicket filter @ line 1130, Wicket 1.4).
>>
>> My resources are mounted under another url ('/photos'). I was
>> wondering why the check is restricted to that url. Also, I've tried to
>> mount my resources under /resources/photos but I get an exception that
>> says 'cannot be mounted under /resources'.
>>
>> Any advices?
>> Thanks in advance.
>> --
>> Mauro Ciancio
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>



-- 
Mauro Ciancio

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



If-Modified-Since header

2010-10-30 Thread Mauro Ciancio
Hello everyone:

I've been trying to get properly working the caching in my site's
resources using the if-modified-since header. I've noticed that the
check for the header is only done if the resource is mounted under the
'/resources' url (wicket filter @ line 1130, Wicket 1.4).

My resources are mounted under another url ('/photos'). I was
wondering why the check is restricted to that url. Also, I've tried to
mount my resources under /resources/photos but I get an exception that
says 'cannot be mounted under /resources'.

Any advices?
Thanks in advance.
-- 
Mauro Ciancio

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



Re: AjaxTabbedPanel and location line

2010-10-23 Thread Mauro Ciancio
Hello,
  I've implemented something like this but using a TabbedPanel and not
AjaxTabbedPanel. The issue with AjaxTabbedPane is that the url is
always the same while you're navigating through the tabs.

  I'll tell you what I've done: I subclassed TabbedPanel and I overrode:

protected WebMarkupContainer newLink(String linkId, int index)

  and I return a BookmarkablePageLink instead of a Link. In the
pageparameters I added a string that is the tab being clicked.
Something like this:

PageParameters pp = new PageParameters("0=" + tab.getBaseURL())
return new BookmarkablePageLink(linkId, target, pp);

  Also, I mounted the page containing the tabbedpanel with the
following strategy: IndexedHybridUrlCodingStrategy, so the url will
end up in: domain.com/page/tab1 or /page/tab2 according to the baseURL
method.

  And the last step is to parse the pageparameters when your page is
constructed and tell the tabbedpanel which one is the selected tab, so
the selected tab is shown.

HTH
Regards.

On Fri, Oct 22, 2010 at 9:26 AM, Alexander Monakhov  wrote:
> Hi, guys.
>
> I've got one page that contains AjaxTabbedPanel component. Each ITab
> contains AjaxTabbedPanel. So, page contains tabs and subtabs. When different
> tabs selected, location path isn't changed. Could you suggest me how to
> change location for every selected tab?
>
> For example, there are 'tab1' and 'tab2'. 'tab1' contains 'subtab1' and
> 'subtab2', The same for 'tab2'. I'd like it to work as following: when user
> selects tab1/subtab1 location line would contain
> http://domain.com/tab1/subtab2, when user selects tab2/subtab1 location line
> would contain http://domain.com/tab2/subtab1, etc.
>
> Also, it would be great if user types http://domain.com/tab2/subtab1 in
> location line and appropriated tab would be opened.
>
> Any idea how to make this?
>
> Best regards, Alexander.
>



-- 
Mauro Ciancio

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



Re: Bean injection

2010-10-08 Thread Mauro Ciancio
> For this particular use case (the current date), I would suggest you
> just calculate that on-the-fly, not at bean creation time.  It's not
> that expensive to calculate.

Yes, I appreciate your suggestion. :)
Thanks James.
Regards.
-- 
Mauro Ciancio

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



Re: Bean injection

2010-10-08 Thread Mauro Ciancio
Hi,

>> Yes: after "deserialization" :). And yes: after deserialization of
>> yout page version this bean is relocated from Spring again. You can
>> chcek this: go to the previous page version by clicking "back" button
>> and press refresh button (if page is cached in a browser). Then you
>> can see that a new bean instance is created. When you stays on the
>> same page and clicking statefull links this page is not deserialized
>> (correct me if I am wrong).
>>
>
> Yes, the most recent version of the page is kept in the session
> (in-memory most likely).

Wel, that explains the whole issue. If only if had known it before. :)
Thanks to all for the replies.
Regards.
-- 
Mauro Ciancio

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



Re: Bean injection

2010-10-07 Thread Mauro Ciancio
Hi, thanks for the quick replies.

> I think as a WorkAround is to get the beans yourself from the Spring context
> insteads of relying on the @SpringBean annotation

Yes, that would work.

> The code specifically checks to see if the bean is a singleton before
> it caches it.  Non-singleton beans should not be cached:
>
> http://svn.apache.org/repos/asf/wicket/trunk/wicket-spring/src/main/java/org/apache/wicket/spring/injection/annot/AnnotProxyFieldValueFactory.java
>
> Search for "isSingletonBean"

Yes, I've looked at that code and that's why I'm confused. I meant,
the bean is inyected properly when the page is constructed (via page
constructor, fresh bean). But when I stay in the same page instance
(using stateful links for example), in a later request I have the same
bean instance.

> So, every time you ask the bean, you want it to return the date/time
> when it was created (or when it was first asked for the current
> date/time)?  Is that an important date/time?

It's not so important, but I can't figure out why I have the same bean
instance, taking into account that the page is serialized at the end
of the request and the inyected bean is actually a proxy of the bean,
so no real bean is in the serialization.

I've double checked it, and the _same_ bean instance is holded in my
page en each request to the same page.

Shouldn't the bean get relocated after serialization?

Thanks again :)
Regards.
-- 
Mauro Ciancio

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



Re: Bean injection

2010-10-07 Thread Mauro Ciancio
Hi,

> Why are you using prototype scope anyway?

In order to get a new fresh instance every time is requested.

> AFAIR the once the bean is looked up from spring it is being cached by
> AnnotProxyFieldValueFactory itself.
>
> So using prototype scope will not work anyway: either way you always get a
> fresh bean (so you cannot keep state) or you will always get the same bean
> (even worse if the bean is stateful).
>
> You probably should convert your code to using singleton beans and pass
> appropriate state from wicket component itself.

OK, I understand, that explains my issue. However, I have a bean that
is stateful and the state cannot be sent by wicket componets (more
precisely it's a bean that provides the local date and local time, and
it's cached in a field so every time you invoke it, it returns the
same date).

So, I'm getting the same date when I navigate through a stateful page.

Is there any another workaround or the only way out is not to keep the
date cached?

Thanks for the replies.
Regards.
-- 
Mauro Ciancio

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



Bean injection

2010-10-06 Thread Mauro Ciancio
Hello everyone,
  I'm using spring in one wicket project and I'm lost about how the
proxy stuff works. I've realized that the fields marked with
@springbean are injected when the component injection listener runs.

  Also, I've looked in AnnotProxyFieldValueFactory.class to find out
how the bean proxy is created and how it can be serialized.

  Now, this is my issue. The page is created by wicket, the injection
is done and I have the bean ready for use. If the page is serialized,
the bean will be reconstructed using the bean factory (through the
proxy). But, somehow when I click a non bookmarkable link in my page,
the bean is never reconstructed and I have the previous reference to
the bean (I mean, the same object).

  Is this the correct behavior? Shouldn't this bean be reconstructed
when another request arrives?

  BTW, I've defined all the beans with prototype scope, so it's not a
spring issue.

  What am I missing?

Regards.
-- 
Mauro Ciancio

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



Re: Rendering Html on Ajax Request

2010-10-03 Thread Mauro Ciancio
Hello,
This could help you,
org.apache.wicket.Component#setEscapeModelStrings

That would disable the escape of strings.

Regards.

On Sun, Oct 3, 2010 at 11:21 PM,   wrote:
> Hi All,
>
>
> I have some property define in property file like below
>
> Myproperty.name = This is bold
>
> And on some Ajax request I am adding  this property to some label like this
>
> add(new Label("somelable", getLocalizer().getString("Myproperty.name."))
>
>
> My problem is , html  tags are rendered as text and  I am not getting bold 
> effect or any Html formatting.
>
>
> Hope someone know how to fix this.
>
> Thanks
>
>
>
>



-- 
Mauro Ciancio

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



Re: TextField that renders a link

2010-06-04 Thread Mauro Ciancio
Hello,

  An option is to create a panel that inside of it has
two components, a textbox and a link. Via ajax
you can update the textbox's model and show the
link if needed.

  I don't know if there is a pre-made component with
that functions, but I've wrapped two components
into a panel and it works pretty good.

Regards.

On Fri, Jun 4, 2010 at 1:27 PM, Josh Chappelle  wrote:

> Does anyone know of a TextField component or perhaps a Behavior that can be
> added to a TextField that will render a link when the user types a URL into
> it?
>
>
>
> Thanks,
>
>
>
> Josh
>
>


-- 
Mauro Ciancio 


Re: Dialog involving multiple pages and a VO: some best practices?

2010-06-03 Thread Mauro Ciancio
Hi,

On Wed, Jun 2, 2010 at 7:43 PM, Joseph Pachod
 wrote:
> I've recently been wondering about the following use case: an instance of Foo 
> class,
> used as a detached value object, is edited in a FooEditPage. For some 
> reasons, let's
> say this page then needs to launch dialogs spanning over different pages. 
> Each of
> these pages could then change some fields of the VO being passed around.

  Have you taken a look to wicket-wizards?
http://www.wicket-library.com/wicket-examples/wizard/

> in fact, I mainly wonder about the pages' serialization... are there some 
> pitfalls to avoid ?

  If you have to track the object's state through several pages,
you'll need a serializable
object, because reloading it using a LDM in every request will throw
away all the changes
made before.
  So, your Foo must implement Serializable, or you could create some
proxy object that
tracks the changes and when the user finish the editing process, apply
the changes to
the real model object.

On Thu, Jun 3, 2010 at 9:19 AM, Wilhelmsen Tor Iver  wrote:
> Sharing between pages is easier done by placing it in the Session which is 
> accessible
> from all of them.

  I think that storing a model object in the session is not a good
choice; if the user opens
two browser windows, what will happen?

Regards.
-- 
Mauro Ciancio 

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



Re: Clear URL parameters

2010-05-24 Thread Mauro Ciancio
Have you tried setRedirect(true)?

Cheers.

On Mon, May 24, 2010 at 12:13 PM, andres.santana
 wrote:
>
> A non-wicket application redirects to my wicket application with an URL full
> of parameters: for example
> http://mypc/myapp/auth?param1=value1¶m2=value. I receive this request in
> an intermediate page, and then I want to redirect to another page using
> setResponsePage(), but the URL keeps all this parameters, and I want to have
> a clear URL. I've mounted the page but it never removes URL parameters...
> Any ideas?
>
> -
> --
> arsh
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Clear-URL-parameters-tp2228705p2228705.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Mauro Ciancio 

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



Re: Survey -- Tool Success Theory Empirical Study - Apache Wicket

2010-05-03 Thread Mauro Ciancio
I also received the survey.
This has been discussed a few weeks ago. Search in the archives
and you'll find the survey's author mail.

Regards.

On Mon, May 3, 2010 at 1:06 PM, Fernando Wermus
 wrote:
> I did.
> don't know if valid. sorry :)
>
> On Mon, May 3, 2010 at 12:21 PM, Eric Reagan  wrote:
>
>> Hello All,
>>     I recieved an email entitled Tool Success Theory Empirical Study -
>> Apache Wicket. I was seeing if anyone else got this. Just wanted to make
>> sure that the request is valid before I go and fill out the survey.
>> Thanks
>>
>> --
>> Eric Reagan
>>
>
>
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
>



-- 
Mauro Ciancio 

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



Re: Wicket + Spring 3 + Hibernate

2010-04-15 Thread Mauro Ciancio
ns.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:109)
>    at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1387)
>    at 
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:244)
>    at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
>    at 
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
>    ... 53 more
> Apr 15, 2010 11:05:11 AM org.apache.catalina.core.ApplicationContext log
> INFO: Closing Spring root WebApplicationContext
>
>
>
>
>
>
> - Original Message 
> From: Sigmar Muuga 
> To: users@wicket.apache.org; Steven Haines 
> Sent: Thu, April 15, 2010 11:09:50 AM
> Subject: Re: Wicket + Spring 3 + Hibernate
>
> What error? Next time post the stack :)
>
> On Thu, Apr 15, 2010 at 5:47 PM, Steven Haines  wrote:
>
>> Hi,
>>
>> I am at a point where I need to upgrade my application from Spring 2.5.6 to
>> Spring 3.0.1.RELEASE. I have a working application and when I update Spring,
>> I see the following exception on deployment:
>>
>> Caused by:
>> org.springframework.beans.factory.BeanCurrentlyInCreationException: Error
>> creating bean with name 'sessionFactory': FactoryBean which is currently in
>> creation returned null from getObject
>>    at
>> org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:157)
>>    at
>> org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:109)
>>    at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1387)
>>
>>
>> I've simplified my Hibernate configuration to:
>>
>>    > class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
>>        
>>        
>>            
>>                > key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect
>>                validate
>>            
>>        
>>        
>>            
>>                com.mycompany.model
>>            
>>        
>>    
>>
>> Finally, here is the dependency list in Maven for my Spring and Hibernate
>> libraries with wicket.version=1.4.7 and spring.version=3.0.1.RELEASE:
>>        
>>            org.apache.wicket
>>            wicket-spring
>>            ${wicket.version}
>>        
>>        
>>            org.springframework
>>            org.springframework.context
>>            ${spring.version}
>>        
>>        
>>            org.springframework
>>            org.springframework.core
>>            ${spring.version}
>>        
>>        
>>            org.springframework
>>            org.springframework.web
>>            ${spring.version}
>>        
>>        
>>            org.springframework
>>            org.springframework.web.servlet
>>            ${spring.version}
>>        
>>        
>>            org.springframework
>>            org.springframework.beans
>>            ${spring.version}
>>        
>>        
>>            org.springframework
>>            org.springframework.oxm
>>            ${spring.version}
>>        
>>        
>>            org.springframework
>>            org.springframework.orm
>>            ${spring.version}
>>        
>>        
>>            javax.servlet
>>            servlet-api
>>            ${servlet-api.version}
>>            provided
>>        
>>        
>>            org.hibernate
>>            hibernate-core
>>            3.3.2.GA
>>        
>>        
>>            javax.persistence
>>            persistence-api
>>            1.0
>>        
>>        
>>            org.hibernate
>>            hibernate-annotations
>>            3.4.0.GA
>>        
>>
>>
>> I have successfully integrated Spring 3 and Hibernate in a RESTful web
>> service and I have successfully integrated Wicket 1.4.7 with Spring 2.5.6
>> and Hibernate, but I am seeing errors specifically with Wicket and Spring 3
>> with Hibernate. Has anyone successfully integrated the three technologies?
>>
>> Any suggestions?
>>
>> Thanks!
>> Steve
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Mauro Ciancio 

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



Re: Customizable PageParameters class?

2010-03-29 Thread Mauro Ciancio
Chris:

On Mon, Mar 29, 2010 at 10:22 PM, Chris Colman
 wrote:
> I wanted to add some error processing to some of the parameters I
> receive and the processing is 'generic' for any integer types.
>
> The easiest way to do this would be in a derivative of the
> PageParameters class. Given that wicket has lots of plug ins facilities
> and customizing options I was wondering if it's possible to specify a
> PageParameters factory to provide objects that wicket should use when
> processing a request.
>
> Does such a beasty exist?

You can intercept the page creation and parse the page parameters
and validate it if needed. Take a look at:

Application#getSessionSettings()
ISessionSettings#setPageFactory()
IPageFactory interface.

HTH.
Cheers.
-- 
Mauro Ciancio 

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



Re: change background color when ListView iterate....

2010-03-28 Thread Mauro Ciancio
Take a look at:

ListItem#newItem(final int index)

and:

org.apache.wicket.markup.repeater.OddEvenItem.

Cheers.

On Sun, Mar 28, 2010 at 11:40 AM, Arnaud Garcia  wrote:
> Hello,
>
> Using a ListView on a  html markup, I would like to alternate the
> background color of each "new" tr when the list iterate...
>
> I just find how to do this on the label inside the td... not on the 
> level..., so just the background color of the title is changed and not the
> full line !
>
> here is an example of my code
>
> html:
> 
>
> 
>    
>       
>    
> 
>
>
> java:
> --
> ListView aList = new ListView("cdList",CDList) {
>
>         private boolean alternateLine = true; // to switch css class
> attribute at each new item...
>
>         @Override
>         protected void populateItem(ListItem item) {
>
>             Label title = new Label("title", new
> PropertyModel(item.getModelObject(), "title"));
>
>             if (alternateLine) {
>                 title.add(new SimpleAttributeModifier("class", "line1"));
> // change the color !
>             } else {
>                 title.add(new SimpleAttributeModifier("class", "line2"));
>             }
>             alternateLine = !alternateLine;
>
>             item.add(title)
>            }
> }
>
>
> thanks,
>
> Arnaud
>



-- 
Mauro Ciancio 

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



Re: AW: signout and redirect

2010-03-25 Thread Mauro Ciancio
  In order to implement my sign out page I've created a SignOutPage
that invokes the signOut method in AuthenticatedWebSession, then
setRedirect(true) and as final step I throw a:

throw new RestartResponseException(HomePage.class).

  This makes the home page be processed (and the url in the navigation
bar remains /your_home_page_url).

Here is the full code if you need it:

public class LogOutPage extends WebPage {

public LogOutPage() {
AuthenticatedWebSession.get().signOut();
setRedirect(true);
throw new RestartResponseException(HomePage.class);
}
}

Cheers.

On Thu, Mar 25, 2010 at 11:19 AM, fachhoch  wrote:
>
> I initially tried   etResponsePage(SSISignOutPage.class)  it did not worked ,
> so used the new approach ,
>
> regarding what my  SSISignOutPage it does nothing except for showing a link
> ,  before to that the control never goes to the page constructor ,
>
> I am assuming after a session is invalidated wicket removes all  its pages
> from page map and  its possible that it cannot find the page SSISignOutPage
> and for that reason do I get pageExpired error ?
>
>
>
>
> christian.giambalvo wrote:
>>
>> Depends on what your SSISignOutPage.class does.
>> But why don't use setResponsePage(SSISignOutPage.class) ??
>>
>> -Ursprüngliche Nachricht-
>> Von: tubin gen [mailto:fachh...@gmail.com]
>> Gesendet: Donnerstag, 25. März 2010 12:59
>> An: users
>> Betreff: signout and redirect
>>
>> here is my code to signout link.
>>
>> add(new Link("signout"){
>> @Override
>> public void onClick() {
>> ((AuditWebSession)(Session.get())).signout();
>> throw new RestartResponseException(SSISignOutPage.class);
>> }
>> });
>>
>> when user clicks on signout I expect to go to SSISignOutPage.
>> but I end up with a  different page which is set in applicationsettings
>>
>> IApplicationSettings settings= super.getApplicationSettings();
>> settings.setPageExpiredErrorPage(SessionExpiredPage.class);
>>
>>
>> the  SessionExpiredPage .
>> please tell me what could be causing this ?
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://old.nabble.com/signout-and-redirect-tp28027857p28029507.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Mauro Ciancio 

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



Re: Invoking Component#updateModel

2010-03-23 Thread Mauro Ciancio
thanks!

On Wed, Mar 24, 2010 at 1:30 AM, Igor Vaynberg  wrote:
> you are forcing an update without validation..up to you.
>
> -igor
>
> On Tue, Mar 23, 2010 at 8:15 PM, Mauro Ciancio  wrote:
>> Igor:
>>
>> On Tue, Mar 23, 2010 at 11:59 PM, Igor Vaynberg  
>> wrote:
>>> see iformcomponentvalidator, or use component.getconvertedvalue()
>>
>> Thanks for the advice.
>>
>>  But my textfield's model is a chained model. I mean, I construct the
>> textfield like this:
>>
>> DateTextField dateTextField = new DateTextField("id",
>>                new Date2LocalDateAdapterModel(new propertymodel(...) ));
>>
>>  So, if i call getconvertedvalue I would get a Date and not a LocalDate.
>>
>> If I call updateModel the value is propagated through the chained
>> models and i dont need an extra conversion.
>>
>> Is this too ugly?
>> Thanks.
>> --
>> Mauro Ciancio 
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -----
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Mauro Ciancio 

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



Re: Invoking Component#updateModel

2010-03-23 Thread Mauro Ciancio
Igor:

On Tue, Mar 23, 2010 at 11:59 PM, Igor Vaynberg  wrote:
> see iformcomponentvalidator, or use component.getconvertedvalue()

Thanks for the advice.

  But my textfield's model is a chained model. I mean, I construct the
textfield like this:

DateTextField dateTextField = new DateTextField("id",
new Date2LocalDateAdapterModel(new propertymodel(...) ));

  So, if i call getconvertedvalue I would get a Date and not a LocalDate.

If I call updateModel the value is propagated through the chained
models and i dont need an extra conversion.

Is this too ugly?
Thanks.
-- 
Mauro Ciancio 

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



Invoking Component#updateModel

2010-03-23 Thread Mauro Ciancio
Hello everyone,

  I'm coding a form validator that validates some condition in a form.
This validator needs the value from two textfields, but the model's
value isn't set when the validators run.

  Is a bad practice calling Component#updateModel to get the updated
value from the model?
  I could get the component's value using #getInput but I'd need
convert the raw value.

Cheers.
-- 
Mauro Ciancio 

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



Re: Bookmarkable Links & Session

2010-03-16 Thread Mauro Ciancio
Anteoine,
  thanks for the reply. It worked great.

Cheers.

On Tue, Mar 16, 2010 at 5:21 PM, Antoine van Wel
 wrote:
> When you have a stateless page, no session is created when you land on
> such a page first, or to be more precise: a temporary session is
> created. So that should explain the difference you see.
>
> Calling Session.get().bind() when logging in should fix that.
>
> Better, call Session.get().replaceSession() when logging in, that
> should both solve your problem and fix a potential security hole.
>
>
>
> Antoine
>
>
> On Tue, Mar 16, 2010 at 8:32 PM, Mauro Ciancio  wrote:
>> Hello everyone,
>>
>>  I'm developing an application that uses a lot of bookmarkable links
>> in order to
>> get pretty urls. When I log in with my user&password, I'm redirected
>> to the home page. This
>> behavior is ok, but the session appears to be not created, so i still see the
>> login link (and not the welcome message 'you are logged in').
>>
>>  However, if before login I browse a page that contains state and
>> then i go to the login page,
>> it works well.
>>
>> I guess the session is not being created, but it should be created
>> when I try to login.
>>
>> Any ideas?
>> Cheers.
>> --
>> Mauro Ciancio 
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Mauro Ciancio 

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



Bookmarkable Links & Session

2010-03-16 Thread Mauro Ciancio
Hello everyone,

  I'm developing an application that uses a lot of bookmarkable links
in order to
get pretty urls. When I log in with my user&password, I'm redirected
to the home page. This
behavior is ok, but the session appears to be not created, so i still see the
login link (and not the welcome message 'you are logged in').

  However, if before login I browse a page that contains state and
then i go to the login page,
it works well.

I guess the session is not being created, but it should be created
when I try to login.

Any ideas?
Cheers.
-- 
Mauro Ciancio 

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



Re: Where is InjectorHolder for Guice?

2010-02-28 Thread Mauro Ciancio
José María,
  For example, sometimes I need an injected object in a DataProvider, but
this is constructed in the context of a page. So, I can easily pass the injected
object into the page to the DataProvider.

Code:
public page extends page {

  @inject
  myservice

  page() {
new provider(myservice);
  }
}

  Is this your case?

PS: I think you would have understood me better if I wrote to you in spanish :)

Cheers.

2010/2/28 José María Ruiz :
> Hi, I'm trying to inject an object that it's not a Component. I've found
> that, with Spring, is as simple as using:
>
> InjectorHolder.getInjector().inject(this);
>
> But there aren't anything similar for Guice, the nearest thing looks to be:
>
> ((GuiceInjectorHolder) ((MyApplication)
> MyApplication.get()).getMetaData(GuiceInjectorHolder.INJECTOR_KEY)).getInjector().injectMembers(this);
>
> as said in:
>
> http://old.nabble.com/Problem-with-Wicket-and-Guice-td14787021.html
>
> Is there a simpler way? If not, are there plans to introduce something
> similar in Wicket-Guice?
>
> Best regards.
> --
> José María Ruiz
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Mauro Ciancio 

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



Re: wicket-guicier -- Another Guice integration for Wicket

2010-02-28 Thread Mauro Ciancio
Joachim,
  I've loved it! It reduces a lot the complexity of parsing the page parameters.

  I think would be nice to show a 404 not found error (or something else) if the
parameters doesn't match with the @inject constructors.

  I see another problem. When wicket-guice injects your annotated
fields in a page,
it injects a serializable proxy so the serialization process works
pretty well even
if the injected objects aren't serializable. I've tested it and you
inject the fields
after the page construction (PageConstructor @ line 192).
But, the wicket-guice already has injected the fields (through the
onComponentInstantionListener), so you're throwing away the
serializable object. And we get the NotSerializableException.

  This could be improved. I could provide you a patch in a few day if you like.

Thanks,
Cheers.

On Fri, Feb 26, 2010 at 11:56 PM, Joachim F. Kainz  wrote:
> Fellow Users,
>
> Because the retails application my team is developing is mostly
> stateless, we are quite frequently have to use PageParameters. The
> untyped nature of this class has let to some nasty code. To address the
> issue I have thrown together wicket-guicer, which is Yet Another Guice
> Integration for Wicket.
>
> There are two main feature Wicket-Guicier supports:
>     1. Use Guice constructor injection instead of member injection.
>     2. Use typed parameters in the page constructor instead of
>        PageParameters
>
> Version 1.0.4 of this component is available at
> http://code.google.com/p/jolira-tools/wiki/guicier?ts=1267238915&updated=guicier
>  The source is available at 
> http://jolira-tools.googlecode.com/svn/wicket-guicier/
>
> Any feedback would be appreciated.
>
> Best regards,
>
> Joachim
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Mauro Ciancio 

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



Re: [OT] Wicket App Hosting

2010-02-25 Thread Mauro Ciancio
Thanks all for the responses.

Cheers.

On Thu, Feb 25, 2010 at 12:46 PM, Apple Grew  wrote:
> I am using http://www.eapps.com . Very good service and hosting option. They
> are not cheap but not too exorbitant either.
>
> Regards,
> Apple Grew
> my blog @ http://blog.applegrew.com/
>
>
> On Thu, Feb 25, 2010 at 7:15 PM, Fatih Mehmet Ucar  wrote:
>
>> linode is the best for me up to now
>>
>> www.linode.com  you may need to know a little bit linux/unix though
>>
>> On 25 February 2010 12:39, Josh Kamau  wrote:
>> > When i wanted to do the same,  i bought a server space at
>> > www.theserverexperts.com  and installed my staff there . ie. Jetty,
>> postgres
>> > and the like. I then bought a domain and liked it with my public ip
>> address.
>> >
>> > Regards.
>> >
>> > On Thu, Feb 25, 2010 at 3:50 AM, Mauro Ciancio > >wrote:
>> >
>> >> Hello everyone,
>> >>
>> >>  I need to deploy a couple of wicket apps (2 or 3 apps). I'm looking for
>> >> advices
>> >> in order to get a good hosting service. In fact, I think i'll get a vps
>> >> service.
>> >>
>> >> Any advices? Which vps providers are good?
>> >>
>> >> Thanks in advance.
>> >> Cheers!
>> >> --
>> >> Mauro Ciancio 
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >>
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>



-- 
Mauro Ciancio 

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



[OT] Wicket App Hosting

2010-02-24 Thread Mauro Ciancio
Hello everyone,

 I need to deploy a couple of wicket apps (2 or 3 apps). I'm looking for advices
in order to get a good hosting service. In fact, I think i'll get a vps service.

Any advices? Which vps providers are good?

Thanks in advance.
Cheers!
-- 
Mauro Ciancio 

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



Re: TimePicker component?

2010-02-18 Thread Mauro Ciancio
Martin:

On Thu, Feb 18, 2010 at 4:54 AM, Martin Grigorov  wrote:
> It is quite easy to use dojo components with Wicket, especially with the
> declarative approach.
>
> Here is a behavior that I wrote few days ago (so it is not bug free)
> that could be used for most of the dijit.form.** components:

Thanks you, I'll try how it works.
Cheers!
-- 
Mauro Ciancio 

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



TimePicker component?

2010-02-17 Thread Mauro Ciancio
Hello everyone,

  I'm looking for a TimePicker component. I searched in the list
and found the dojo time picker from wicket-stuff but isn't working
with wicket 1.4.x. Throws an exception when the component is
being rendered.

  Is there any other component? Is any dojo integration compatible
with 1.4.x?

Thanks in advance.
Cheers!
-- 
Mauro Ciancio 

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



Re: London Wicket Event, Saturday November 21st

2009-11-17 Thread Mauro Ciancio
Nicolas:

On Wed, Oct 7, 2009 at 3:25 PM, Nicolas Melendez
wrote:

> When a  Wicket Event in Buenos Aires, Argentina ?? We also have lots of
> pubs
> :)
>

I'm expecting for that event too. =)

Cheers!
-- 
Mauro Ciancio


Re: Help me with setting up Ubuntu, NetBeans, Maven2, Wicket, Jetty and Google App Engine

2009-11-07 Thread Mauro Ciancio
Piotr:

On Sat, Nov 7, 2009 at 11:55 AM, Piotr Tarsa  wrote:

> I need an up-to-date pom.xml files with short dependencies, ie. the
> ones I saw had a long list of dependencies.
>

I usually start with the wicket quickstart project and it fits my needs.
Later,
I add the dependecies that I need.


> I've set netbeans.deploy=false so NetBeans doesn't ask for deploying
> server (besides, I am using embedded Jetty to run that, so the
> question was weird), but sadly, now NetBeans doesn't open new browser
> window and doesn't stop Jetty before another run command.
>

You could use the option 'apply code changes' if you change a class. This
replace the old class file with the new one without needing to restart
the jetty. It's very usefull and reduces the deployment dead time.
In order to use this options you should run your start jetty in debug mode.


> Do you think that using Maven2 with that project makes sense? Maybe I
> should make regular NetBeans project...


In my opinion Maven is the correct option. Downloading the jars manually
is a ugly task.

Cheers.
-- 
Mauro Ciancio


Re: How to write HTML directly

2009-10-26 Thread Mauro Ciancio
Nick:

On Mon, Oct 26, 2009 at 2:43 PM, NiJK  wrote:

> Thanks for your reply. I understand that Wicket doesn't work the same way
> and was wondering how this could be achieved. Is there just no way to
> output
> HTML directly? How would you use wicket to send an XML file, for example,
> or
> an image?
>

As Igor said, you can send html directly using that code snippet. To send
an image to the browser you could use any of the following classes:

http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/image/resource/package-summary.html

Cheers,
-- 
Mauro Ciancio


Re: How to write HTML directly

2009-10-26 Thread Mauro Ciancio
Nick:

On Mon, Oct 26, 2009 at 2:27 PM, nick kitching wrote:

> I have a Java class which outputs HTML directly including , and
>  tags.
>
> Using JSP I simply include this class as a bean and then have the JSP do
> something like
> ${bean.itsMethod}
> to have those tags written directly into my page.
>

  Wicket does not works like that. You write a plain HTML and then add the
dynamic
content with a class which extends WebPage.
  Please take a look to the wicket quickstart project in
http://wicket.apache.org/quickstart.html .

Cheers,
-- 
Mauro Ciancio


Re: Create table with columns from a list

2009-10-18 Thread Mauro Ciancio
Igor:

On Sun, Oct 18, 2009 at 11:33 PM, Igor Vaynberg wrote:

> use GridView.
>

Excellent, I didnt know it. That's what I was looking for.
Thans again,
-- 
Mauro Ciancio


Re: Create table with columns from a list

2009-10-18 Thread Mauro Ciancio
Jeremy:

On Sun, Oct 18, 2009 at 9:51 PM, Jeremy Thomerson  wrote:

> create your own with, for example, repeating viw
>

Thanks you, I'll give it a try.
-- 
Mauro Ciancio


Create table with columns from a list

2009-10-18 Thread Mauro Ciancio
Hi everyone,

  I'm searching for a component which allows to me to create a table with
a few columns and put in each cell items from a list. But when the list
has more than n items, create a new row in the table with the remainings
items
in the list.

For example, if i have 5 items in the list and my table is created with 3
columns,
the result will be:

-
  x |  x | x
-
  x |  x |

Any ideas?
Should I create my own component?

Thanks in advance,
Cheers!
-- 
Mauro Ciancio


How to LDM refreshed after submit?

2009-07-19 Thread Mauro Ciancio
Hi wicketers!

  The question is the subject of this mail. I have a form with some fields
and
I want to those fields being updated after the form submit. All fields share
the same Loadable Detachable Model.

  The issue is that the LDM is loaded before onSubmit() and i have no chance
to update the model.

Any ideas?
Thanks in advance,
-- 
Mauro Ciancio


Re: AjaxSelfUpdatingTimerBehavior and Panels

2009-07-08 Thread Mauro Ciancio
On Wed, Jul 8, 2009 at 1:29 PM, Mauro Ciancio wrote:

> Thanks for the reply Igor. I could not test it yet.
> I'll test it and then write I'll write what happened.
>

It works pretty cool. Thanks for the advice!
-- 
Mauro Ciancio


Re: AjaxSelfUpdatingTimerBehavior and Panels

2009-07-08 Thread Mauro Ciancio
On Thu, Jul 2, 2009 at 2:43 AM, Igor Vaynberg wrote:

> you can attach the behavior to a container around the panels, just a
> simple webmarkupcontainer should do.


Thanks for the reply Igor. I could not test it yet.
I'll test it and then write I'll write what happened.

Cheers!
-- 
Mauro Ciancio


AjaxSelfUpdatingTimerBehavior and Panels

2009-07-01 Thread Mauro Ciancio
Hi everyone,
  I'm having an issue with the AjaxSelfUpdatingTimerBehavior and panels
in my page. The thing is I have a panel that is switched via ajax. All the
others parts of my page remains without change.
  In a specific panel (one of those being changed) I added an
AjaxSelfUpdatingTimerBehavior. It works fine, but when i replace the panel
with a new instance of the panel a new timer its appended to the page.
So, after that I have two timers refreshing my page.
  If the panel is replaced another time, a third timer come up.
  But, if the original panel is replaced with other panel, this exception is
thrown:

Root cause:

java.lang.NullPointerException
at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:96)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1240)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1319)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1418)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:544)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
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.SocketConnector$Connection.run(SocketConnector.java:226)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Any idea to fix this issue?
How should I do to make the panel changeable without having this issue?

Thanks in advance,
Cheers!
-- 
Mauro Ciancio


Re: guice-injection on page vs. components

2009-06-25 Thread Mauro Ciancio
On Wed, Jun 24, 2009 at 1:38 PM, Aaron Dixon  wrote:

>
> org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
> Unable to serialize class:
> com.mycompany.dao.MyDao$$EnhancerByGuice$$3e6e9f94
> Field hierarchy is:
>  2 [class=com.mycompany.pages.MyPage, path=2]
>private com.mycompany.dao.MyDao
>
> com.mycompany.pages.MyPage.myDao[class=com.mycompany.dao.MyDao$$EnhancerByGuice$$3e6e9f94]
> <- field that is not serializable
>at
>
> org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:342)
>at
>
> org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:610)
> ...
> 
>
> Has anyone else noticed this?
>

  Yes, it happens because the injected class isn't Serializable and when
your page
is serialized the exception is thrown.
  You could use for example a
LoadableDetachableModel<http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/model/LoadableDetachableModel.html>to
detach your DAO when
your page is serialized.
  Guice also comes with an interface named Provider. This could helps
because it
dont hold a reference to your un-serializable object.

Example:

class MyPage extends Page {
  LoadableDetachableModel daoModel = new loadable() {
object get() {
  return new dao();
 }
  };

  void something() {
 mydao = daoModel.getObject();
 //stuff
  }

  void ondetach() {
super.ondetach()
 daomodel.detach();
   }
 }

HTH
Cheers!
-- 
Mauro Ciancio


Re: LoadableDetachableModel onDetach() event

2009-05-03 Thread Mauro Ciancio
This issue has been solved today by Igor.
Thanks Igor

Greentings!

On Sun, May 3, 2009 at 12:29 PM, Mauro Ciancio wrote:

> Johan:
>
> On Sun, May 3, 2009 at 6:02 AM, Johan Compagner wrote:
>
>> We dont need to give the object to the method if we would call
>> ondetach first and then set the boolen/clear the reference.
>
>
> Exactly. I agree.
>
>
>> You can then just call getModelObject to get it. I dont see currently
>> all the implications if we change this. Can you make a jira issue so
>> that we can track this?
>>
>
> Yes, of course. I found a workaround to solve this, but it would be better
> if the onDetach() is called before than nulling the reference.
>
> Thanks!
> Greetings.
> --
> Mauro Ciancio
>



-- 
Mauro Ciancio


Re: LoadableDetachableModel onDetach() event

2009-05-03 Thread Mauro Ciancio
Johan:

On Sun, May 3, 2009 at 6:02 AM, Johan Compagner wrote:

> We dont need to give the object to the method if we would call
> ondetach first and then set the boolen/clear the reference.


Exactly. I agree.


> You can then just call getModelObject to get it. I dont see currently
> all the implications if we change this. Can you make a jira issue so
> that we can track this?
>

Yes, of course. I found a workaround to solve this, but it would be better
if the onDetach() is called before than nulling the reference.

Thanks!
Greetings.
-- 
Mauro Ciancio


LoadableDetachableModel onDetach() event

2009-05-02 Thread Mauro Ciancio
Hi everybody,

  The detach() code for LoadableDetachableModel is this:

public void detach()
{
if (attached)
{
attached = false;
transientModelObject = null;

onDetach();
}
}

  I have to invoke a model's method which releases resources, but it has
been set to null.
How could I do this?

I have to keep an extra reference to my object. Is not this better?:

onDetach(transientModelObject);
attached = false;
transientModelObject = null;


Just a thought.

Thanks!
Greetings,
-- 
Mauro Ciancio


Re: Data validation and form components

2009-04-28 Thread Mauro Ciancio
On Tue, Apr 28, 2009 at 5:40 PM, Peter Dotchev  wrote:

> Setter methods of my business logic classes perform validation and throw
> exceptions if given parameter is invalid.
> I don't have separate methods for data validation.
> In my wicket form I use CompoundPropertyModel which sets user entered
> values directly in the business object.
> If the user enters invalid value, the setter method throws some exception
> and the error page is shown.
> How can I intercept this exception and show the error message in a feedback
> panel keeping the form open?
>

Hi,
  IMO isnt a great idea that your form directly modifies your business logic
objects. You
could use a pattern like Value Object. You modifies a Value Object and then
updates
your model with that Value Object.

Cheers,
-- 
Mauro Ciancio