Re: Inmethod datagrid and Twitter bootstrap

2012-03-18 Thread Martin Grigorov
Hi,

Few years ago my company needed to customize InMethod Grid to look
like our application and our web designer provided
a custom theme for that. It was quite easy.
Twitter bootstrap requires from you to add some CSS classes in the
produced HTML so you may need to add AttributeModifier here and there
but I think it should be possible to do.

On Sat, Mar 17, 2012 at 5:08 PM, bjolletz daniel.akerl...@pagero.com wrote:
 Hi,

 I've been playing around a bit with the Twitter bootstrap css framework and
 think it looks really nice. Now, it would be very nice if it was possible to
 make the inmethod datagrid (which I use a lot) get the look and feel of the
 twitter bootstrap table. I'm thinking of making the inmethod datagrid look
 something like this:

 http://datatables.net/media/blog/bootstrap/

 This means that I would also like to use the paging look and feel from
 twitter botostrap.

 I know there is a setTheme() method on the DataGrid component, but before I
 start digging too deep into that, it would be nice to hear from someone more
 involved with the inmethod DatGrid project if they think that what I'm
 trying to do is at all possible to achieve. Or maybe someone has already
 done it?

 Any thought on this would be very appreciated. Thanks for reading!

 /Daniel

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Inmethod-datagrid-and-Twitter-bootstrap-tp4480711p4480711.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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

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



Re: I don't want url page count parameter: localhost:8080/context/?0

2012-03-18 Thread Martin Grigorov
On Sun, Mar 18, 2012 at 4:47 AM, Dan Retzlaff dretzl...@gmail.com wrote:
 Paolo,

 If you add stateful components or behaviors to your page, Wicket introduces
 the page version into the URL so that subsequent requests can be routed to
 the correct component and behavior instances. To get rid of the parameter,
 you should (1) make your page stateless, (2) implement your own
 IRequestMapper to track versions in another way, or (3) set
 IRequestCycleSettings#setRenderStrategy(RenderStrategy.REDIRECT_TO_RENDER).

Actually it is RenderStrategy.ONE_PASS_RENDER

 I expect none of these will feel like a perfect solution for you, but you
 should evaluate them for yourself.

 Dan

 On Sat, Mar 17, 2012 at 6:51 PM, Paolo irresistible...@gmail.com wrote:

 Hi,
 I read this old post to solve the my same problem:

 ---
 I'm using Wicket 1.5.3, an application with a number of tabbed panels.

 My application's url is, lets say http://localhost:9080/context/

 When I enter this URL, the browse immediately changes this to
 http://localhost:9080/context/?0

 I don't want that!!

 When I enter userdata and switch some tabs, nothing happens, but when I hit
 F5 the URL changes to
 http://localhost:9080/context/?9 or another number, depending on my
 activity.
 I don't want that!!
 
 I read this suggested link:

 http://stackoverflow.com/questions/8081143/components-not-reloading-on-url-change-in-wicket-1-5-2

 http://stackoverflow.com/questions/8135755/wicket-1-5-new-urls/8139152#8139152


 BUT I DON'T UNDERSTAND TO SOLVE THE SIMPLE PROBLEM!

 I tried to change from

 String id = inparams.get(id).toString();

   TO

    RequestCycle requestCycle = RequestCycle.get();
    Request request = requestCycle.getRequest();
    IRequestParameters irp = request.getRequestParameters();
    String id = irp.getParameterValue(id).toString();

 BUT NOTHING CHANGED!

 Please Help me, in this stupid wicket issue.

 Thank you





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

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



Re: I don't want url page count parameter: localhost:8080/context/?0

2012-03-18 Thread Pointbreak
Create a class NoVersionMount:

/**
 * Provides a mount strategy that drops the version number from
 * stateful page urls.
 */
public class NoVersionMount extends MountedMapper {
public NoVersionMount(String path, Class? extends
IRequestablePage pageClass) {
super(path, pageClass, new PageParametersEncoder());
}

@Override protected void encodePageComponentInfo(Url url,
PageComponentInfo info)
{
// do nothing so that component info does not get
// rendered in url
}

@Override public Url mapHandler(IRequestHandler
requestHandler)
{
if (requestHandler instanceof
ListenerInterfaceRequestHandler) {
return null;
} else {
return super.mapHandler(requestHandler);
}
}
}

And mount your pages using that mounted mapper, e.g.:

mount(new NoVersionMount(myPage, MyPage.class));

Cheers, Gerrit


On Sun, Mar 18, 2012, at 02:51, Paolo wrote:
 Hi,
 I read this old post to solve the my same problem:
 
 ---
 I'm using Wicket 1.5.3, an application with a number of tabbed panels.
 
 My application's url is, lets say http://localhost:9080/context/
 
 When I enter this URL, the browse immediately changes this to
 http://localhost:9080/context/?0
 
 I don't want that!!
 
 When I enter userdata and switch some tabs, nothing happens, but when I
 hit
 F5 the URL changes to
 http://localhost:9080/context/?9 or another number, depending on my
 activity.
 I don't want that!!
 
 I read this suggested link:
 http://stackoverflow.com/questions/8081143/components-not-reloading-on-url-change-in-wicket-1-5-2
 http://stackoverflow.com/questions/8135755/wicket-1-5-new-urls/8139152#8139152
 
 
 BUT I DON'T UNDERSTAND TO SOLVE THE SIMPLE PROBLEM!
 
 I tried to change from
 
 String id = inparams.get(id).toString();
 
TO
 
 RequestCycle requestCycle = RequestCycle.get();
 Request request = requestCycle.getRequest();
 IRequestParameters irp = request.getRequestParameters();
 String id = irp.getParameterValue(id).toString();
 
 BUT NOTHING CHANGED!
 
 Please Help me, in this stupid wicket issue.
 
 Thank you
 
 

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



Wicket + JPA lazy-loading

2012-03-18 Thread Bálint Kriván
Hey!

It seems that when wicket is trying to serialize the persistent objects
(probably to session) the lazy loading kicks in and it retrieves the whole
graph.
Not sure if wicket is using the default java serialization or a special
one, but is there anybody else who is/were experiencing the same? By any
chance would you have any suggestion how can I overcome this?
It would be a great solution if an association is persisted when it's
loaded, but if it isn't then do not lazy load it, just leave it null.

Thanks!

Regards,
Bálint Kriván


Re: Wicket 1.5 error : cannot find component id

2012-03-18 Thread kshitiz
Hi,

Thank you for ur reply. I have added the form by writing
*add(registerForm);* in the* constructor*. But I have just resolved by
problem by replacing *wicket:id* in html page with *wickeT:id*

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-error-cannot-find-component-id-tp4481835p4482073.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket + JPA lazy-loading

2012-03-18 Thread James Carman
Use a LoadableDetachableModel.  You shouldn't be serializing
persistent objects (unless of course you're in the middle of editing
them or something).

On Sun, Mar 18, 2012 at 8:36 AM, Bálint Kriván bal...@krivan.hu wrote:
 Hey!

 It seems that when wicket is trying to serialize the persistent objects
 (probably to session) the lazy loading kicks in and it retrieves the whole
 graph.
 Not sure if wicket is using the default java serialization or a special
 one, but is there anybody else who is/were experiencing the same? By any
 chance would you have any suggestion how can I overcome this?
 It would be a great solution if an association is persisted when it's
 loaded, but if it isn't then do not lazy load it, just leave it null.

 Thanks!

 Regards,
 Bálint Kriván

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



Re: Wicket + JPA lazy-loading

2012-03-18 Thread Bálint Kriván
I don't want to serialize them but wicket does (I have a list of objects
which I pass to a ListView).
IIRC, If I use LDM I can make wicket to serialize only an ID and when it is
readed back I can reach the backend to get the correct object for that ID.
If I would switch to this probably it would be more query than now, because
even the parent objects should be retrieved from the DB one-by-one.
It would be enough for me if I could make wicket not to try to serialize
these objects (these are retrieved in the constructor so I don't see the
need to save them on the first place)

On Sun, Mar 18, 2012 at 1:56 PM, James Carman ja...@carmanconsulting.comwrote:

 Use a LoadableDetachableModel.  You shouldn't be serializing
 persistent objects (unless of course you're in the middle of editing
 them or something).

 On Sun, Mar 18, 2012 at 8:36 AM, Bálint Kriván bal...@krivan.hu wrote:
  Hey!
 
  It seems that when wicket is trying to serialize the persistent objects
  (probably to session) the lazy loading kicks in and it retrieves the
 whole
  graph.
  Not sure if wicket is using the default java serialization or a special
  one, but is there anybody else who is/were experiencing the same? By any
  chance would you have any suggestion how can I overcome this?
  It would be a great solution if an association is persisted when it's
  loaded, but if it isn't then do not lazy load it, just leave it null.
 
  Thanks!
 
  Regards,
  Bálint Kriván

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




-- 
Üdv,
Kriván Bálint


Re: Wicket + JPA lazy-loading

2012-03-18 Thread James Carman
Try with an ldm I'd say.
On Mar 18, 2012 9:04 AM, Bálint Kriván bal...@krivan.hu wrote:

 I don't want to serialize them but wicket does (I have a list of objects
 which I pass to a ListView).
 IIRC, If I use LDM I can make wicket to serialize only an ID and when it is
 readed back I can reach the backend to get the correct object for that ID.
 If I would switch to this probably it would be more query than now, because
 even the parent objects should be retrieved from the DB one-by-one.
 It would be enough for me if I could make wicket not to try to serialize
 these objects (these are retrieved in the constructor so I don't see the
 need to save them on the first place)

 On Sun, Mar 18, 2012 at 1:56 PM, James Carman ja...@carmanconsulting.com
 wrote:

  Use a LoadableDetachableModel.  You shouldn't be serializing
  persistent objects (unless of course you're in the middle of editing
  them or something).
 
  On Sun, Mar 18, 2012 at 8:36 AM, Bálint Kriván bal...@krivan.hu wrote:
   Hey!
  
   It seems that when wicket is trying to serialize the persistent objects
   (probably to session) the lazy loading kicks in and it retrieves the
  whole
   graph.
   Not sure if wicket is using the default java serialization or a special
   one, but is there anybody else who is/were experiencing the same? By
 any
   chance would you have any suggestion how can I overcome this?
   It would be a great solution if an association is persisted when it's
   loaded, but if it isn't then do not lazy load it, just leave it null.
  
   Thanks!
  
   Regards,
   Bálint Kriván
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


 --
 Üdv,
 Kriván Bálint



LocaleFirstMapper in 1.5 and statefull home page

2012-03-18 Thread Girts Ziemelis
I am doing the conversion from 1.4 to 1.5.5 and at the same time trying 
to start using LocaleFirstMapper and CustomHomeMapper from wicket 
examples. Everything works nicely except, I have a statefull home page 
and seems CustomHomeMapper does not handle this case. Page renders fine, 
but Ajax requests do not work. I think the reason is, because 
CustomHomeMapper does not add the version number to the link, so the 
link stays /en, instead of /en?0 like in case, if CustomHomeMapper is 
not used (home page link is /?0).


Any easy solutions to fix this, before I start debugging wicket 1.5 
request handling, trying to understand how things work?


BTW, nice work on 1.5 wicket team. Thanks :)





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



Wicket 1.5: sessions

2012-03-18 Thread Pierre Goupil
Good evening,

I'm currently in the process of migrating my app from Wicket 1.4 to Wicket
1.5. I've read the migration guide and everything seems to go fine, except
for session management.

Here's my code:

public class MySession extends WebSession
{

  public static MySession get()
{
return (MySession)Session.get();
}

}

When call, the get() method gives this stacktrace:

Caused by: java.lang.ClassCastException:
org.apache.wicket.protocol.http.WebSession cannot be cast to MySession

Any help, please?

Regards,

Pierre Goupil


Re: Wicket 1.5: sessions

2012-03-18 Thread Jeremy Thomerson
On Sun, Mar 18, 2012 at 5:08 PM, Pierre Goupil goupilpie...@gmail.comwrote:

 Good evening,

 I'm currently in the process of migrating my app from Wicket 1.4 to Wicket
 1.5. I've read the migration guide and everything seems to go fine, except
 for session management.

 Here's my code:

 public class MySession extends WebSession
 {

  public static MySession get()
{
return (MySession)Session.get();
}

 }

 When call, the get() method gives this stacktrace:

 Caused by: java.lang.ClassCastException:
 org.apache.wicket.protocol.http.WebSession cannot be cast to MySession

 Any help, please?

 Regards,

 Pierre Goupil



Does your application override newSession and return a new MySession?

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


Re: Wicket 1.5: sessions

2012-03-18 Thread Pierre Goupil
Yes, absolutely:


public Session newSession(final Request request, final Response
response)
{
return new MySession(request);
}




On Sun, Mar 18, 2012 at 10:32 PM, Jeremy Thomerson 
jer...@wickettraining.com wrote:

 On Sun, Mar 18, 2012 at 5:08 PM, Pierre Goupil goupilpie...@gmail.com
 wrote:

  Good evening,
 
  I'm currently in the process of migrating my app from Wicket 1.4 to
 Wicket
  1.5. I've read the migration guide and everything seems to go fine,
 except
  for session management.
 
  Here's my code:
 
  public class MySession extends WebSession
  {
 
   public static MySession get()
 {
 return (MySession)Session.get();
 }
 
  }
 
  When call, the get() method gives this stacktrace:
 
  Caused by: java.lang.ClassCastException:
  org.apache.wicket.protocol.http.WebSession cannot be cast to MySession
 
  Any help, please?
 
  Regards,
 
  Pierre Goupil
 


 Does your application override newSession and return a new MySession?

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




-- 
Si tu penses que la violence ne résout rien, c'est que tu n'as pas tapé
assez fort.


Re: Wicket 1.5: sessions

2012-03-18 Thread Jeremy Thomerson
Put a breakpoint in the WebSession constructor and see where it's getting
called.

Or, perhaps you won't see anything there if this is happening because you
are in a serialized WebSession.  You can test that by clearing all cookies,
etc, and starting a new session.

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

On Sun, Mar 18, 2012 at 5:40 PM, Pierre Goupil goupilpie...@gmail.comwrote:

 Yes, absolutely:


public Session newSession(final Request request, final Response
 response)
{
return new MySession(request);
 }




 On Sun, Mar 18, 2012 at 10:32 PM, Jeremy Thomerson 
 jer...@wickettraining.com wrote:

  On Sun, Mar 18, 2012 at 5:08 PM, Pierre Goupil goupilpie...@gmail.com
  wrote:
 
   Good evening,
  
   I'm currently in the process of migrating my app from Wicket 1.4 to
  Wicket
   1.5. I've read the migration guide and everything seems to go fine,
  except
   for session management.
  
   Here's my code:
  
   public class MySession extends WebSession
   {
  
public static MySession get()
  {
  return (MySession)Session.get();
  }
  
   }
  
   When call, the get() method gives this stacktrace:
  
   Caused by: java.lang.ClassCastException:
   org.apache.wicket.protocol.http.WebSession cannot be cast to MySession
  
   Any help, please?
  
   Regards,
  
   Pierre Goupil
  
 
 
  Does your application override newSession and return a new MySession?
 
  --
  Jeremy Thomerson
  http://wickettraining.com
  *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
 



 --
 Si tu penses que la violence ne résout rien, c'est que tu n'as pas tapé
 assez fort.



Re: Wicket 1.5: sessions

2012-03-18 Thread Pierre Goupil
Actually, this error occurs in my unit tests. I can't launch the app at
this very moment, because some more things need to be managed during the
migration. But this simple test should work as it all compiles.

As expected, the constructor from WebSession is called by
MyApplication#newSession(Request request, Response response)

Regards,

Pierre Goupil




On Sun, Mar 18, 2012 at 10:48 PM, Jeremy Thomerson 
jer...@wickettraining.com wrote:

 Put a breakpoint in the WebSession constructor and see where it's getting
 called.

 Or, perhaps you won't see anything there if this is happening because you
 are in a serialized WebSession.  You can test that by clearing all cookies,
 etc, and starting a new session.

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

 On Sun, Mar 18, 2012 at 5:40 PM, Pierre Goupil goupilpie...@gmail.com
 wrote:

  Yes, absolutely:
 
 
 public Session newSession(final Request request, final Response
  response)
 {
 return new MySession(request);
  }
 
 
 
 
  On Sun, Mar 18, 2012 at 10:32 PM, Jeremy Thomerson 
  jer...@wickettraining.com wrote:
 
   On Sun, Mar 18, 2012 at 5:08 PM, Pierre Goupil goupilpie...@gmail.com
   wrote:
  
Good evening,
   
I'm currently in the process of migrating my app from Wicket 1.4 to
   Wicket
1.5. I've read the migration guide and everything seems to go fine,
   except
for session management.
   
Here's my code:
   
public class MySession extends WebSession
{
   
 public static MySession get()
   {
   return (MySession)Session.get();
   }
   
}
   
When call, the get() method gives this stacktrace:
   
Caused by: java.lang.ClassCastException:
org.apache.wicket.protocol.http.WebSession cannot be cast to
 MySession
   
Any help, please?
   
Regards,
   
Pierre Goupil
   
  
  
   Does your application override newSession and return a new MySession?
  
   --
   Jeremy Thomerson
   http://wickettraining.com
   *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
  
 
 
 
  --
  Si tu penses que la violence ne résout rien, c'est que tu n'as pas tapé
  assez fort.
 




-- 
Si tu penses que la violence ne résout rien, c'est que tu n'as pas tapé
assez fort.


converter

2012-03-18 Thread neo
Hello I am new in wicket , i have number in textfield  in format -x(five
digits) but if i input number like 22 , 222 it can by convert with padding
zero like 00022,00222 how can do it?thank you very much

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

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



Re: Wicket 1.5: sessions

2012-03-18 Thread Sven Meier
Perhaps a classloader issue? Check whether you have two Wicket versions 
in your project.


Sven

On 03/18/2012 10:56 PM, Pierre Goupil wrote:

Actually, this error occurs in my unit tests. I can't launch the app at
this very moment, because some more things need to be managed during the
migration. But this simple test should work as it all compiles.

As expected, the constructor from WebSession is called by
MyApplication#newSession(Request request, Response response)

Regards,

Pierre Goupil




On Sun, Mar 18, 2012 at 10:48 PM, Jeremy Thomerson
jer...@wickettraining.com  wrote:


Put a breakpoint in the WebSession constructor and see where it's getting
called.

Or, perhaps you won't see anything there if this is happening because you
are in a serialized WebSession.  You can test that by clearing all cookies,
etc, and starting a new session.

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

On Sun, Mar 18, 2012 at 5:40 PM, Pierre Goupilgoupilpie...@gmail.com

wrote:
Yes, absolutely:


public Session newSession(final Request request, final Response
response)
{
return new MySession(request);
 }




On Sun, Mar 18, 2012 at 10:32 PM, Jeremy Thomerson
jer...@wickettraining.com  wrote:


On Sun, Mar 18, 2012 at 5:08 PM, Pierre Goupilgoupilpie...@gmail.com

wrote:
Good evening,

I'm currently in the process of migrating my app from Wicket 1.4 to

Wicket

1.5. I've read the migration guide and everything seems to go fine,

except

for session management.

Here's my code:

public class MySession extends WebSession
{

  public static MySession get()
{
return (MySession)Session.get();
}

}

When call, the get() method gives this stacktrace:

Caused by: java.lang.ClassCastException:
org.apache.wicket.protocol.http.WebSession cannot be cast to

MySession

Any help, please?

Regards,

Pierre Goupil



Does your application override newSession and return a new MySession?

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




--
Si tu penses que la violence ne résout rien, c'est que tu n'as pas tapé
assez fort.







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



Re: support for L10N in templates

2012-03-18 Thread infiniter
Oh no. 
What I need is to be able to support something like the following, but for
TEMPLATES, 'cause I want to localize them:
 public void renderHead(IHeaderResponse response) {
response.renderJavascriptReference(new ResourceReference(
MyPage.class, my.js, getLocale(), getStyle()));
}

anyone?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/support-for-L10N-in-templates-tp4479741p4483475.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



What real life scenario calls for page ID?

2012-03-18 Thread Chris Colman
I've been thinking about the new 1.5 page ID/versioning feature (which
we disabled as soon as we discovered it) and wondering if there is
actually a real world scenario for stateful pages that actually requires
this functionality.

I understand the purpose is so that the browser's 'Back' function can
work properly (and maybe efficiently) but, in all the scenarios we
have at least, proper would be to re-render and not pull the page from
the cache.

For example, an online store with the current shopping cart displayed in
the right hand column:

Browser is showing page for product A, no products in shopping cart
shown in right column.

User goes to page for product B, adds product B to shopping cart.

Hit's back button.

Now wouldn't the 'page versioning/id' feature now show the cached page
for product A with a shopping cart that is still empty even though the
user just added product B? Or would it realize that the shopping cart
panel's model has changed and update it to reflect the newly added item?

In this scenario showing an empty shopping cart is a very definite
incorrect behavior that will freak out the user who believes that they
have added a product B (which they have) but it is not shown in the
shopping cart.

1.4 functionality (without page ID) worked fine. We never had a single
complaint about back button not displaying the correct result.

I'm half doubting whether page ID is a useful feature but half wondering
if it is a useful feature for which I just haven't discovered useful
scenarios where it is of benefit and so I should find these scenarios
and change my design to use it.

Thoughts?

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



RE: Inmethod datagrid and Twitter bootstrap

2012-03-18 Thread Chris Colman
 I'm thinking of making the inmethod datagrid look
 something like this:

 http://datatables.net/media/blog/bootstrap/

Ooooh! Yea please, can I have one of them ;) 

That Twitter Bootstrap table looks very Web 2012: nice clear,
uncluttered, easy to read.


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



Re: What real life scenario calls for page ID?

2012-03-18 Thread Paolo
Alle lunedì 19 marzo 2012, Chris Colman ha scritto:
 I've been thinking about the new 1.5 page ID/versioning feature (which
 we disabled as soon as we discovered it) and wondering if there is
 actually a real world scenario for stateful pages that actually requires
 this functionality.
 
 I understand the purpose is so that the browser's 'Back' function can
 work properly (and maybe efficiently) but, in all the scenarios we
 have at least, proper would be to re-render and not pull the page from
 the cache.
 
 For example, an online store with the current shopping cart displayed in
 the right hand column:
 
 Browser is showing page for product A, no products in shopping cart
 shown in right column.
 
 User goes to page for product B, adds product B to shopping cart.
 
 Hit's back button.
 
 Now wouldn't the 'page versioning/id' feature now show the cached page
 for product A with a shopping cart that is still empty even though the
 user just added product B? Or would it realize that the shopping cart
 panel's model has changed and update it to reflect the newly added item?
 
 In this scenario showing an empty shopping cart is a very definite
 incorrect behavior that will freak out the user who believes that they
 have added a product B (which they have) but it is not shown in the
 shopping cart.
 
 1.4 functionality (without page ID) worked fine. We never had a single
 complaint about back button not displaying the correct result.
 
 I'm half doubting whether page ID is a useful feature but half wondering
 if it is a useful feature for which I just haven't discovered useful
 scenarios where it is of benefit and so I should find these scenarios
 and change my design to use it.
 
 Thoughts?
I support you!
I implemented class NoVersionMount thanks to pointbreak in my MainApplication.
And It will be my template for future app.
But to do it, I needed to understood the problem, check on google, read a lot 
of pages,
without found a solution, so post the question here, and after 3 post, got a 
right reply for me.
Why an wicket user have to do all this
Why not, wicket use the NoVersionMount as default Mount? Like in wicket 1.4.
And implement an VersionMount as an alternative for developer?

 
 -
 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



Why I cannot receive default value in Textfield?

2012-03-18 Thread xiaowang
Hi,
Now I am using:

html - 
input type=text wicket:id=ContactPerson1
input type=submit wicket:id=submit  value=Save

Java -
public class MerchantEditPanel extends Panel {
private String ContactPerson1 = some text;

   public MerchantEditPanel{
 TextFieldString ContactPerson1 = new
TextFieldString(ContactPerson1,new
PropertyModel(this,ContactPerson1));
   xxform. add(ContactPerson1);

frmEdit.add(new AjaxSubmitLink(submit) {
@Override
protected void onSubmit(AjaxRequestTarget ajaxRequestTarget,
Form? components) {
 Merchant m =
(Merchant)components.getModelObject();
..
Here I find m cannot get the default value from ContactPerson textfield,
or even I just add some words after some text, components.getModelObject()
cannot get the value from this textfield.
Ps:It can show default value some text in ContactPerson textfield.


And, if I try to use the code from
http://wicketstuff.org/wicket14/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.TextFieldPage,
there is no default value in Textfield...

Can anyone help me? Thanks in advanced. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-I-cannot-receive-default-value-in-Textfield-tp4483603p4483603.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: support for L10N in templates

2012-03-18 Thread Bertrand Guay-Paquet
Yeah I threw that out there in case it also applied to templates. I 
don't know anything about them in Wicket...


On 18/03/2012 8:19 PM, infiniter wrote:

Oh no.
What I need is to be able to support something like the following, but for
TEMPLATES, 'cause I want to localize them:
  public void renderHead(IHeaderResponse response) {
 response.renderJavascriptReference(new ResourceReference(
 MyPage.class, my.js, getLocale(), getStyle()));
 }

anyone?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/support-for-L10N-in-templates-tp4479741p4483475.html
Sent from the Users forum mailing list archive at Nabble.com.

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



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



RE: What real life scenario calls for page ID?

2012-03-18 Thread Chris Colman


-Original Message-
From: Paolo [mailto:irresistible...@gmail.com]
 Thoughts?
I support you!
I implemented class NoVersionMount thanks to pointbreak in my
MainApplication.
And It will be my template for future app.
But to do it, I needed to understood the problem, check on google, read
a
lot of pages,
without found a solution, so post the question here, and after 3 post,
got
a right reply for me.
Why an wicket user have to do all this

Why not, wicket use the NoVersionMount as default Mount? Like in wicket
1.4 and implement an VersionMount as an alternative for developer?

I agree. It sounds like it might be useful for some scenarios (but none
that I have discovered yet) but for most it seems like the 1.4 default
works perfectly well. 

Maybe the NoVersionMount should be the default and if some developers
have found a scenario that requires versioned pages they can turn it on
somehow.

Or, at least make the 1.4 default a 'configurable' option rather than
have to implement a class to set up something which seems like a much
more common requirement.



 -
 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



Re: What real life scenario calls for page ID?

2012-03-18 Thread Igor Vaynberg
On Sun, Mar 18, 2012 at 5:27 PM, Chris Colman
chr...@stepaheadsoftware.com wrote:
 I've been thinking about the new 1.5 page ID/versioning feature (which
 we disabled as soon as we discovered it) and wondering if there is
 actually a real world scenario for stateful pages that actually requires
 this functionality.

 I understand the purpose is so that the browser's 'Back' function can
 work properly (and maybe efficiently) but, in all the scenarios we
 have at least, proper would be to re-render and not pull the page from
 the cache.

 For example, an online store with the current shopping cart displayed in
 the right hand column:

 Browser is showing page for product A, no products in shopping cart
 shown in right column.

 User goes to page for product B, adds product B to shopping cart.

 Hit's back button.

 Now wouldn't the 'page versioning/id' feature now show the cached page
 for product A with a shopping cart that is still empty even though the
 user just added product B? Or would it realize that the shopping cart
 panel's model has changed and update it to reflect the newly added item?

 In this scenario showing an empty shopping cart is a very definite
 incorrect behavior that will freak out the user who believes that they
 have added a product B (which they have) but it is not shown in the
 shopping cart.

 1.4 functionality (without page ID) worked fine. We never had a single
 complaint about back button not displaying the correct result.

i think there is some confusion here. wicket 1.4 had page ids. it also
had page versions. in 1.5 we simply merged page id and page version
into the same variable - page id. this made things much simpler and
also allowed some usecases that were not possible when the two were
separate.

you dont have to go very far to come up with an example where page id is useful.

1. suppose you have a page with panel A that has a link
2. user hits a link on the page that swaps panel A for panel B
3. user presses the back button
4. user clicks the link on panel A

now if you turn off page id and therefore page versioning it goes like this
1. wicket creates page and assigns it id 1
2. page id 1 now has panel B instead of panel A
3. page with id 1 is rerendered
4. wicket loads page with id 1. user gets an error because it cannot
find the link component the user clicked since the page has panel B
instead of panel A

now same with page versioning enabled and page caching disabled

1. wicket creates page and assigns it id 1
2. wicket clones page with id 1 into a new instance with id 2. id 1
has panel A and id 2 has panel B
3. wicket renders page with id 1
4. wicket loads page with id 1, the link is executed

now same with page versioning enabled and page caching enabled

1. wicket creates page and assigns it id 1
2. wicket clones page with id 1 into a new instance with id 2. id 1
has panel A and id 2 has panel B
3. browser renders page from cache
4. wicket loads page with id 1 (page id is encoded in link's url), the
link is executed

in wicket 1.4 page id would not change but step 2 would increment the
page's version. there would still be two instances of the page: id1
version 1, id1 version 2

now you may be referring to the fact that unlike in 1.4 in 1.5 we
immediately redirect to a versioned url when a bookmarkable url is
accessed

in 1.4 when user hits /mount they would stay on that url
in 1.5 when user hits /mount they are redirected to /mount?2 where 2
is the next available page id

in 1.4 a lot of users complained that when the user access a
bookmarkable page and uses ajax to navigate/change the state of the
page all that state is lost when they refresh the page. this is
because when they refresh the page the browser requests the same url
(the bookmarkable one) and a new instance of the page is created. this
is really frustrating to users of ajax-based applications.

in 1.5 when the user navigates to a mount we immediately redirect to a
statefull url of the new page instance. now when the user makes a
bunch of changes via ajax and presses refresh the page is refreshed
with those changes preserved.

this is why 1.4 had hybrid url coding strategy, but because it wasnt
the default it still had some usecases that didnt work correctly.

since most applications use ajax we made this the default behavior of 1.5.

-igor



 I'm half doubting whether page ID is a useful feature but half wondering
 if it is a useful feature for which I just haven't discovered useful
 scenarios where it is of benefit and so I should find these scenarios
 and change my design to use it.

 Thoughts?

 -
 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



Images, ajax requests and caching

2012-03-18 Thread Bertrand Guay-Paquet

Hi,

I have image resources which fetch the proper thumbnail picture stored 
in a DB based on the image's file name. I used the file name instead of 
parameters to make sure client-side caching would work. By chance, I 
just discovered that the images are always reloaded on ajax requests.


This is caused by Image#shouldAddAntiCacheParameter and 
Image#addAntiCacheParameter which always add an anticache parameter to 
image src URLs on ajax requests.


In my case, the images are added to ajax requests as part of a table 
update containing lots of thumbnails so it's definitely 
counter-productive. I can see the need for anticaching for dynamically 
generated images which change per request, but should this be the 
default behavior?


Of course, I can easily work around this issue by subclassing Image, but 
I wanted to bring this to attention. At the very least, I would suggest 
creating a subclass (CachingImage?) of Image in core which does not do 
anticaching for stateless resource references.


Regards,
Bertrand

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



Re: Why I cannot receive default value in Textfield?

2012-03-18 Thread James Carman
Check the value of the ContactPerson1 field in your onSubmit() method.  It
should contain what gets submitted.  The merchant object is unrelated to
your text field.
On Mar 18, 2012 9:38 PM, xiaowang jy00807...@gmail.com wrote:

 Hi,
 Now I am using:

 html -
 input type=text wicket:id=ContactPerson1
 input type=submit wicket:id=submit  value=Save

 Java -
 public class MerchantEditPanel extends Panel {
 private String ContactPerson1 = some text;

   public MerchantEditPanel{
  TextFieldString ContactPerson1 = new
 TextFieldString(ContactPerson1,new
 PropertyModel(this,ContactPerson1));
   xxform. add(ContactPerson1);

 frmEdit.add(new AjaxSubmitLink(submit) {
 @Override
protected void onSubmit(AjaxRequestTarget ajaxRequestTarget,
 Form? components) {
 Merchant m =
 (Merchant)components.getModelObject();
 ..
 Here I find m cannot get the default value from ContactPerson textfield,
 or even I just add some words after some text,
 components.getModelObject()
 cannot get the value from this textfield.
 Ps:It can show default value some text in ContactPerson textfield.


 And, if I try to use the code from

 http://wicketstuff.org/wicket14/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.TextFieldPage
 ,
 there is no default value in Textfield...

 Can anyone help me? Thanks in advanced.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Why-I-cannot-receive-default-value-in-Textfield-tp4483603p4483603.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




RE: AjaxFormComponentUpdatingBehavior after validation problem

2012-03-18 Thread Evan Sable
Hello,

I think the problem is just that you're calling setValues on your
genericModelObject, which is set as the compoundpropertymodel for your
form, but you're not adding the form back to the ajax response - with the
AjaxRequestTarget, you're only adding the component dropDownId to get
re-rendered into the page, not the form with the updated model.  So, the
change made directly on the dropdown which is added to the ajaxRequestTarget
(calling setEnabled) is taking effect, but it's not finding the updated
model.  It should work if you add:
target.addComponent(get(formId));

Hope that helps,
-Evan

-Original Message-
From: Gytis [mailto:lietuvis...@mail.ru] 
Sent: Friday, March 16, 2012 5:32 AM
To: users@wicket.apache.org
Subject: AjaxFormComponentUpdatingBehavior after validation problem

Hello, I have such a problem with AjaxFormComponentUpdatingBehavior. 
I have some DropDownChoice and a CheckBox on a Form. I need to make a change
to DropDown, when I click on CheckBox. But as I try to submit a Form, got
some error, and then click CheckBox DropDown doesn`t change. The code looks
like this: 

   DropDownChoiceSomeEnum dropDownz = new
DropDownChoiceSomeEnum(dropDownId,
Arrays.asList(SomeEnum.values()), new
EnumChoiceRendererSomeEnum(this));
   getGenericModelObject().setValues(SomeEnum.FIRSTVALUE);
   CheckBox boxz = new CheckBox(BoxId);
   boxz.add(new AjaxFormComponentUpdatingBehavior(onchange)
{
@Override
protected void onUpdate(AjaxRequestTarget target) {
if (boxz.getModelObject())
{

getGenericModelObject().setValues(SomeEnum.SECONDVALUE);
get(dropDownId).setEnabled(false);

target.addComponent(get(dropDownId));
}
else
{
get(dropDownId).setEnabled(true);

target.addComponent(get(dropDownId));
}
}
@Override
protected void onError(AjaxRequestTarget target,
RuntimeException e) {
if (boxz.getModelObject())
{

getGenericModelObject().setValues(SomeEnum.SECONDVALUE);
get(dropDownId).setEnabled(false);

target.addComponent(get(dropDownId));
}
else
{
get(dropDownId).setEnabled(true);

target.addComponent(get(dropDownId));
}
super.onError(target, e);
}
});
 Form form = new Form(formId, getGenericModel());
 form.add(dropDownz);
 form.add(boxz);

So as I said, after form validation, if errors occur, it won`t change
dropdown to SECONDVALUE, but sets it as setEnabled(false), why this happens?

--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior
-after-validation-problem-tp4477705p4477705.html
Sent from the Users forum mailing list archive at Nabble.com.



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



Re: Images, ajax requests and caching

2012-03-18 Thread Igor Vaynberg
we have a noncachingimage subclass... :)

-igor

On Sun, Mar 18, 2012 at 9:33 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:
 Hi,

 I have image resources which fetch the proper thumbnail picture stored in a
 DB based on the image's file name. I used the file name instead of
 parameters to make sure client-side caching would work. By chance, I just
 discovered that the images are always reloaded on ajax requests.

 This is caused by Image#shouldAddAntiCacheParameter and
 Image#addAntiCacheParameter which always add an anticache parameter to
 image src URLs on ajax requests.

 In my case, the images are added to ajax requests as part of a table update
 containing lots of thumbnails so it's definitely counter-productive. I can
 see the need for anticaching for dynamically generated images which change
 per request, but should this be the default behavior?

 Of course, I can easily work around this issue by subclassing Image, but I
 wanted to bring this to attention. At the very least, I would suggest
 creating a subclass (CachingImage?) of Image in core which does not do
 anticaching for stateless resource references.

 Regards,
 Bertrand

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


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