Re: Extending the DataTable class doesnt work

2014-03-14 Thread Martin Grigorov
Hi,

Again I have problems identifying the description of the problem in your
mails.
it seems not working doesn't say anything. Just avoid using such
statements.
Better add info about what is expected and what is the actual result.

Next time I will just ignore your mail.

Martin Grigorov
Wicket Training and Consulting


On Fri, Mar 14, 2014 at 6:53 AM, chathuraka.waas
chathuraka.w...@gmail.comwrote:

 Hi,

 i'm trying to migrate my application from 1.4 to 6.14. i have a class
 extending the DataTable and it seems not working after the migration.

 i tried replacing the extended class with the DataTable class and it worked
 fine.

 this is my code for extending the DataTable class.

 public class TestTableT,Object extends DataTableT,Object {


Here you shadow a real type - java.lang.Object.
It is not problem per se, but it is very easy to become such.



 private static final long serialVersionUID = 1L;


 public TestTable(String id, ListIColumnlt;T, Object columns,
 IDataProviderT dataProvider, int rowsPerPage) {
 super(id, columns, dataProvider, rowsPerPage);
 }

 }

 am i doing something wrong here. please shed some light on this. Thanks in
 advance.

 Regards,

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952.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: Extending the DataTable class doesnt work

2014-03-14 Thread Ernesto Reinaldo Barreiro
Hi,

I just remember at some point there were some incompatible changes on
DataTable: remember having to adjust the markup of an extension to get it
working again...

But as Martin states, your mail is not very helpful as you don't clearly
state what the problem is: class does not compile?, you get an exception at
runtime? If so, stackrace? Help other help you, and value their time.


On Fri, Mar 14, 2014 at 5:53 AM, chathuraka.waas
chathuraka.w...@gmail.comwrote:

 Hi,

 i'm trying to migrate my application from 1.4 to 6.14. i have a class
 extending the DataTable and it seems not working after the migration.

 i tried replacing the extended class with the DataTable class and it worked
 fine.

 this is my code for extending the DataTable class.

 public class TestTableT,Object extends DataTableT,Object {

 private static final long serialVersionUID = 1L;


 public TestTable(String id, ListIColumnlt;T, Object columns,
 IDataProviderT dataProvider, int rowsPerPage) {
 super(id, columns, dataProvider, rowsPerPage);
 }

 }

 am i doing something wrong here. please shed some light on this. Thanks in
 advance.

 Regards,

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952.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




-- 
Regards - Ernesto Reinaldo Barreiro


Re: Pass exception to internal error page

2014-03-14 Thread Martin Grigorov
Hi,



On Fri, Mar 14, 2014 at 1:16 AM, jchappelle jchappe...@4redi.com wrote:

 I am using wicket 6.14.0.

 I have a RequestCycleListener that listens for onException. I handle
 PageExpiredException, UnauthorizedInstantiationException(this is custom),
 and by default I redirect to a custom ErrorPage class that takes the
 Exception object in the constructor. It also contains a list of ignored
 exceptions that it will return null for. This custom ErrorPage actually
 reports an error to our JIRA bug tracker when it renders to the user.

 The problem I am having is we are getting a lot of bug reports for things
 like StalePageException and ComponentNotFoundException when I think wicket


Indeed Wicket handles StalePageException.
ComponentNotFoundException usually means that there is an error in the
application, so I think it is good to handle it as you do now.


 can handle those without the user knowing. While I can add them to the
 ignored list, I don't think this is a good design because as wicket
 changes,
 these exceptions can change.

 I would like a way to just register my internal error page with
 getApplicationSettings().setInternalErrorPage(...) but I can't because I
 won't have my Exception passed to my error page. Is there a way to do this?
 Or is there some way to access the last exception associated with the
 session?

 I suppose I can create an Exception variable in my Session class and set it
 in my RequestCycleListener but I'm hoping there is a better way.


storing it in the session is the best place.
other places to store it are RequestCycle's metadata or a ThreadLocal but
usually Wicket will make a http redirect to load the configured internal
error page and those won't be valid any more.

How do you check whether a given type of error is logged in Jira just once ?
An attacker can create thousands of tickets in Jira by just reloading a
page that leads to a problem.



 Thanks!

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Pass-exception-to-internal-error-page-tp4664951.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: Extending the DataTable class doesnt work

2014-03-14 Thread chathuraka.waas
Hi Thanks for your replies. 

what i ment from not working was it doesnt give any compilation errors or
runtime errors but simply it doesnt show the table as in the html. 

I tried implementing the basics of DataTable just to try out. here's my
code. 

ListIColumnlt;TestData,String columns = new
ArrayListIColumnlt;TestData,String();

columns.add(new PropertyColumnTestData, String(new ModelString(Name),
o.name)
{
@Override
public String getCssClass()
{
return sampleCss;
}
});

table = new DefaultDataTableOfferData,
String(OffersTable,columns,dataProvider,5);
table.setOutputMarkupId(true);
table.addTopToolbar(new AjaxFallbackHeadersToolbar(table, dataProvider));

i have this code inside a panel and i'm adding the panel to my page. when i
inspected the generated html i cant find any tabel elements. the column
headers are shown inside span tags.  and also the css classes are not
applied to the columns as well. 

what am i doing wrong in here. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952p4664956.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: Extending the DataTable class doesnt work

2014-03-14 Thread Martin Grigorov
Show us the markup of the panel where this table is added please.

Martin Grigorov
Wicket Training and Consulting


On Fri, Mar 14, 2014 at 10:09 AM, chathuraka.waas chathuraka.w...@gmail.com
 wrote:

 Hi Thanks for your replies.

 what i ment from not working was it doesnt give any compilation errors or
 runtime errors but simply it doesnt show the table as in the html.

 I tried implementing the basics of DataTable just to try out. here's my
 code.

 ListIColumnlt;TestData,String columns = new
 ArrayListIColumnlt;TestData,String();

 columns.add(new PropertyColumnTestData, String(new ModelString(Name),
 o.name)
 {
 @Override
 public String getCssClass()
 {
 return sampleCss;
 }
 });

 table = new DefaultDataTableOfferData,
 String(OffersTable,columns,dataProvider,5);
 table.setOutputMarkupId(true);
 table.addTopToolbar(new AjaxFallbackHeadersToolbar(table, dataProvider));

 i have this code inside a panel and i'm adding the panel to my page. when i
 inspected the generated html i cant find any tabel elements. the column
 headers are shown inside span tags.  and also the css classes are not
 applied to the columns as well.

 what am i doing wrong in here.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952p4664956.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: Extending the DataTable class doesnt work

2014-03-14 Thread chathuraka.waas
hi,

this is my markup for the panel 

wicket:panel xmlns:wicket=http://wicket.apache.org/;
div wicket:id=OffersTable/div
/wicket:panel

and the generated markup is this, 
div id=id28 class=offer-type-panel
   div id=id29
   Name
   Name
   divNo Records Found/div
   div class=navigatorLabel
   div class=navigator
   /div
/div

Regards, 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952p4664958.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: Extending the DataTable class doesnt work

2014-03-14 Thread Martin Grigorov
On Fri, Mar 14, 2014 at 10:30 AM, chathuraka.waas chathuraka.w...@gmail.com
 wrote:

 hi,

 this is my markup for the panel

 wicket:panel xmlns:wicket=http://wicket.apache.org/;
 div wicket:id=OffersTable/div


change div to table

I am not sure why Wicket allows this.
DataTable can check the name of its tag and throw exception when it is not
table ...


 /wicket:panel

 and the generated markup is this,
 div id=id28 class=offer-type-panel
div id=id29
Name
Name
divNo Records Found/div
div class=navigatorLabel
div class=navigator
/div
 /div

 Regards,

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952p4664958.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: Extending the DataTable class doesnt work

2014-03-14 Thread Martin Grigorov
https://issues.apache.org/jira/browse/WICKET-5534

Martin Grigorov
Wicket Training and Consulting


On Fri, Mar 14, 2014 at 10:33 AM, Martin Grigorov mgrigo...@apache.orgwrote:



 On Fri, Mar 14, 2014 at 10:30 AM, chathuraka.waas 
 chathuraka.w...@gmail.com wrote:

 hi,

 this is my markup for the panel

 wicket:panel xmlns:wicket=http://wicket.apache.org/;
 div wicket:id=OffersTable/div


 change div to table

 I am not sure why Wicket allows this.
 DataTable can check the name of its tag and throw exception when it is not
 table ...


 /wicket:panel

 and the generated markup is this,
 div id=id28 class=offer-type-panel
div id=id29
Name
Name
divNo Records Found/div
div class=navigatorLabel
div class=navigator
/div
 /div

 Regards,

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952p4664958.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: Extending the DataTable class doesnt work

2014-03-14 Thread chathuraka.waas
Got the basic datatable to show in the page. Thanks Martin. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952p4664961.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: Extending the DataTable class doesnt work

2014-03-14 Thread chathuraka.waas
hi,

i'm still trying to fix my initial issue where i have a customized DataTable
class. I have a panel and inside that i have the table i'm extended from the
Data Table. 

the code for my extended table is this. 

public class OfferTableT,S extends DataTableT,S {

private static final long serialVersionUID = 1L;


public OfferTable(String id, ListIColumnlt;T, S columns,
IDataProviderT dataProvider, int rowsPerPage) {
super(id, columns, dataProvider, rowsPerPage);
}

}


and i have the corresponding markup file for this class. 

wicket:panel xmlns=http://www.w3.org/1999/xhtml;
xmlns:wicket=http://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=blob_plain;f=wicket-core/src/main/resources/META-INF/wicket-1.5.xsd;hb=master;




wicket:container wicket:id=topToolbars/wicket:container

tfoot
wicket:container wicket:id=bottomToolbars
class=fan-nav/wicket:container
/tfoot




[cell]



div class=last-row-bottom-border/div




/wicket:panel


i'm creating a instance out of this Table class and placing it in my panel. 

ListIColumnlt;OfferData, String columns = new
ArrayListIColumnlt;OfferData, String();
columns.add(name);
columns.add(fans);
 
table = new OfferTableOfferData,String(OffersTable, columns,
dataProvider, 5) {

private static final long serialVersionUID =
8235090332329499560L;

@Override
protected Item newRowItem(String id, int index, IModel model) {
Item item = new Item(id, index, model);
item.add(new AttributeModifier(class, new
ModelString(index % 2 == 0 ? current
: altrow)));
return item;
}
};


table.setOutputMarkupId(true);
table.addTopToolbar(new AjaxFallbackHeadersToolbar(table, dataProvider));


when  i do this the table does not gets generated. i cant find any compile
time errors or runtime errors. 
what am i doing wrong in here. 



 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952p4664962.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: Extending the DataTable class doesnt work

2014-03-14 Thread Martin Grigorov
On Fri, Mar 14, 2014 at 11:42 AM, chathuraka.waas chathuraka.w...@gmail.com
 wrote:

 hi,

 i'm still trying to fix my initial issue where i have a customized
 DataTable
 class. I have a panel and inside that i have the table i'm extended from
 the
 Data Table.

 the code for my extended table is this.

 public class OfferTableT,S extends DataTableT,S {

 private static final long serialVersionUID = 1L;


 public OfferTable(String id, ListIColumnlt;T, S columns,
 IDataProviderT dataProvider, int rowsPerPage) {
 super(id, columns, dataProvider, rowsPerPage);
 }

 }


 and i have the corresponding markup file for this class.

 wicket:panel xmlns=http://www.w3.org/1999/xhtml;
 xmlns:wicket=
 http://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=blob_plain;f=wicket-core/src/main/resources/META-INF/wicket-1.5.xsd;hb=master
 





 wicket:container wicket:id=topToolbars/wicket:container

 tfoot
 wicket:container wicket:id=bottomToolbars
 class=fan-nav/wicket:container
 /tfoot




 [cell]



 div class=last-row-bottom-border/div


 /wicket:panel


The DataTable (the Panel) is used with table HTML element.
table can look like:
table
   trtd/td/tr
/table

or
table
theadtrth/th/tr/thead
tbodytrtd/td/tr/tbody
tfoottrtd/td/tr/tfoot

With your markup you create invalid HTML.
I guess this is the reason why the browser doesn't render it.



 i'm creating a instance out of this Table class and placing it in my panel.

 ListIColumnlt;OfferData, String columns = new
 ArrayListIColumnlt;OfferData, String();
 columns.add(name);
 columns.add(fans);

 table = new OfferTableOfferData,String(OffersTable, columns,
 dataProvider, 5) {

 private static final long serialVersionUID =
 8235090332329499560L;

 @Override
 protected Item newRowItem(String id, int index, IModel model) {
 Item item = new Item(id, index, model);
 item.add(new AttributeModifier(class, new
 ModelString(index % 2 == 0 ? current
 : altrow)));
 return item;
 }
 };


 table.setOutputMarkupId(true);
 table.addTopToolbar(new AjaxFallbackHeadersToolbar(table, dataProvider));


 when  i do this the table does not gets generated. i cant find any compile
 time errors or runtime errors.
 what am i doing wrong in here.





 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952p4664962.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: Extending the DataTable class doesnt work

2014-03-14 Thread chathuraka.waas
hi,

thanks for your reply. I tried making the div to a 
 element in the panel markup. 

wicket:panel xmlns=http://www.w3.org/1999/xhtml;
xmlns:wicket=http://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=blob_plain;f=wicket-core/src/main/resources/META-INF/wicket-1.5.xsd;hb=master;


/wicket:panel

it didnt work out. 

then i tried removing the outer panel elements from the OfferTable.html
markup and it gave an runtime error asking for the panel markup element. 




wicket:container wicket:id=topToolbars/wicket:container





[cell]



div class=last-row-bottom-border/div 

tfoot
wicket:container wicket:id=bottomToolbars
class=fan-nav/wicket:container
/tfoot



as i tried earlier just placing the table content inside the panel and using
DataTable gets me the work done. but i'm trying to use this method since
there are few other places which uses this code. 

Regards, 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952p4664965.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: Extending the DataTable class doesnt work

2014-03-14 Thread Martin Grigorov
On Fri, Mar 14, 2014 at 12:10 PM, chathuraka.waas chathuraka.w...@gmail.com
 wrote:

 hi,

 thanks for your reply. I tried making the div to a
  element in the panel markup.

 wicket:panel xmlns=http://www.w3.org/1999/xhtml;
 xmlns:wicket=
 http://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=blob_plain;f=wicket-core/src/main/resources/META-INF/wicket-1.5.xsd;hb=master
 


 /wicket:panel


just remove OfferTable.html completely



 it didnt work out.

 then i tried removing the outer panel elements from the OfferTable.html
 markup and it gave an runtime error asking for the panel markup element.




 wicket:container wicket:id=topToolbars/wicket:container





 [cell]



 div class=last-row-bottom-border/div


You cannot have a div inside table.
The div can be inside a td.



 tfoot
 wicket:container wicket:id=bottomToolbars
 class=fan-nav/wicket:container
 /tfoot



 as i tried earlier just placing the table content inside the panel and
 using
 DataTable gets me the work done. but i'm trying to use this method since
 there are few other places which uses this code.

 Regards,

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Extending-the-DataTable-class-doesnt-work-tp4664952p4664965.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




wicket:header-items/

2014-03-14 Thread Martin Grigorov
Hi,

At http://wicketinaction.com/2014/03/header-contributions-positioning/ I've
added a short description of a new special wicket tag -
wicket:header-items/.
It will be available with Wicket 6.15.0.

I hope you will find it useful!

Martin Grigorov
Wicket Training and Consulting


Re: wicket:header-items/

2014-03-14 Thread Maxim Solodovnik
Great!
very useful tag


On Fri, Mar 14, 2014 at 7:50 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 At http://wicketinaction.com/2014/03/header-contributions-positioning/I've
 added a short description of a new special wicket tag -
 wicket:header-items/.
 It will be available with Wicket 6.15.0.

 I hope you will find it useful!

 Martin Grigorov
 Wicket Training and Consulting




-- 
WBR
Maxim aka solomax


Re: wicket:header-items/

2014-03-14 Thread Ernesto Reinaldo Barreiro
Very nice!


On Fri, Mar 14, 2014 at 1:53 PM, Maxim Solodovnik solomax...@gmail.comwrote:

 Great!
 very useful tag


 On Fri, Mar 14, 2014 at 7:50 PM, Martin Grigorov mgrigo...@apache.org
 wrote:

  Hi,
 
  At
 http://wicketinaction.com/2014/03/header-contributions-positioning/I've
  added a short description of a new special wicket tag -
  wicket:header-items/.
  It will be available with Wicket 6.15.0.
 
  I hope you will find it useful!
 
  Martin Grigorov
  Wicket Training and Consulting
 



 --
 WBR
 Maxim aka solomax




-- 
Regards - Ernesto Reinaldo Barreiro


AjaxSelfUpdatingTimerBehavior memory?

2014-03-14 Thread Rob Audenaerde
I have a question on the AjaxSelfUpdatingTimerBehavior
I have some memory issues and wondered in the behavior could cause this (on 
Jetty)
When connected with jvisualvm I see the heap increasing each time the 
AjaxSelfUpdatingTimerBehavior is fired (with about 3M per request)
Is that what I should see?


?Thx

-Rob


Re: AjaxSelfUpdatingTimerBehavior memory?

2014-03-14 Thread Martin Grigorov
Hi,

Definitely not!
Capture some memory snapshots and see what is the difference between them.
I'm not sure whether VisualVM can do that but Eclipse MAT can.

Martin Grigorov
Wicket Training and Consulting


On Fri, Mar 14, 2014 at 3:29 PM, Rob Audenaerde rob.audenae...@valuecare.nl
 wrote:

 I have a question on the AjaxSelfUpdatingTimerBehavior
 I have some memory issues and wondered in the behavior could cause this
 (on Jetty)
 When connected with jvisualvm I see the heap increasing each time the
 AjaxSelfUpdatingTimerBehavior is fired (with about 3M per request)
 Is that what I should see?


 ?Thx

 -Rob



Re: Close Browser Behavior

2014-03-14 Thread Daniela L
Hi Martin,
it is definitely a problem in my code :-))
But unfortunately I do not understand how to update the database at that
stage using
@SpringBean? Is that impossible? Do I have to do this outside Wicket using
a HttpSessionListener?
I also tryid to make my custom session implement HttpSessionBindingListener
and override valueUnbound
but that makes no difference. Is there a example for this anywhere, that
seems to be such a common use case?
Best Regards
Daniela


2014-03-13 15:40 GMT+01:00 Martin Grigorov mgrigo...@apache.org:

 Hi,

 Maybe it is a problem in your code ;-)

  pIn case of session expiration this method is called in a non-worker
 thread, i.e.
  * there are no thread locals exported for the Application, RequestCycle
 and Session.
  * The Session is the current instance. The Application can be found by
 using
  * {@link Application#get(String)}. There is no way to get a reference to a
 RequestCycle/p
  */
 public void onInvalidate()
 {
 }

 The javadoc clearly says that when this method is called by the web
 container due to session expiration there are no thread locals.
 The thread locals are available in #onInvalidate() only if the application
 code called Session#invalidate[Now]() explicitly.

 Martin Grigorov
 Wicket Training and Consulting


 On Thu, Mar 13, 2014 at 4:34 PM, Daniela L danigal...@gmail.com wrote:

  Hi Martin,
  if found the reason why the data is not freed in onInvalidate,
  the Spring/Hibernate update to the database issues a There is no
  application attached to current thread
  ContainerBackgroundProcessor[StandardEngine[Catalina]]. Is this a wicket
  or a tomcat issue?
  Best Regards
  Daniela
 
 
  2014-03-12 14:31 GMT+01:00 Martin Grigorov mgrigo...@apache.org:
 
   On Wed, Mar 12, 2014 at 3:20 PM, Daniela L danigal...@gmail.com
 wrote:
  
Hi Martin,
thank you very much for your quick and brilliant answer :-)
Changing to AjaxCheckBox did the trick.
It seems to be very difficult to provide a secure way to invalidate
  user
data
cross browser compliant. I noticed that using a tablet with android
 or
   IOS
the
beforeunload is not triggered at all. Therefor I added a cleanup
 method
   to
the onInvalidate
of my custom session which should be triggered by the tomcats
session-timeout, but
it seems using mobile devices onInvalidate is not triggered?
   
  
   onInvalidate() is called by the server when the client hasn't
  touched/used
   its http session for session-timeout minutes.
   It shouldn't matter whether it is a desktop or mobile client.
  
  
Best Regards
Daniela
   
   
2014-03-12 13:21 GMT+01:00 Martin Grigorov mgrigo...@apache.org:
   
 Hi,

 On Wed, Mar 12, 2014 at 1:15 PM, Daniela L danigal...@gmail.com
   wrote:

  Hi,
  I am using a close browser behavior to clean up user data if the
  user
  closes
  the browser window. I also use a CheckBox to toggle the
 visibility
  of
 some
  Textfields. Unfortunately the refresh through the click of the
   CheckBox
  triggers the close browser
  behavior. How can this be avoided?
  Here is what I did (with wicket 6.12.0):
 
 
  customerFirstName = new
RequiredTextFieldString(customer.firstName);
  customerFirstName.setOutputMarkupPlaceholderTag(true);
  closeBrowserBehavior =  new AbstractDefaultAjaxBehavior() {
 @Override
  protected void respond(AjaxRequestTarget target) {
 
  AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
  }
 
  @Override
  public void renderHead(Component component,
   IHeaderResponse
  response) {
  super.renderHead(component, response);
  response.render(new
 
  OnDomReadyHeaderItem(window.onbeforeunload =
  function (e) {
  + if (!window.dontAsk) {
  + Wicket.Ajax.get({u:
  '+getCallbackUrl()+', async: false});
  + var message = 'my message.',
  + e = e || window.event; + if
  (e)
   {
  + e.returnValue = message; +
  }} +
  return message;
  +
  };));
  }
  };
  customerFirstName.add(closeBrowserBehavior);
  form.add(customerFirstName);
 
  createAccountCB = new CheckBox(createAccountCB, new
  ModelBoolean(createAccount)){
  @Override
  protected void onSelectionChanged(Boolean
  newSelection) {
  super.onSelectionChanged(newSelection);
  createAccount = !createAccount;
  }
 
  @Override
  protected boolean
 wantOnSelectionChangedNotifications()
  

RE: AjaxSelfUpdatingTimerBehavior memory?

2014-03-14 Thread Rob Audenaerde
On Fri, Mar 14, 2014 at 3:29 PM, Rob Audenaerde rob.audenae...@valuecare.nl
 wrote:

 I have a question on the AjaxSelfUpdatingTimerBehavior
 I have some memory issues and wondered in the behavior could cause this
 (on Jetty)
 When connected with jvisualvm I see the heap increasing each time the
 AjaxSelfUpdatingTimerBehavior is fired (with about 3M per request)
 Is that what I should see?



I have reproduced it in a quickstart.

The screenshot is here: http://www.audenaerde.org/ajax/screenshot.png
The quickstart can be found here: http://www.audenaerde.org/ajax/ajaxmemory.zip

Note that I am running in debug mode; but that should not matter I suppose. 
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AjaxSelfUpdatingTimerBehavior memory?

2014-03-14 Thread Martin Grigorov
It looks OK.
The memory grows but after (manual) GC it is freed.

Martin Grigorov
Wicket Training and Consulting


On Fri, Mar 14, 2014 at 3:54 PM, Rob Audenaerde rob.audenae...@valuecare.nl
 wrote:

 On Fri, Mar 14, 2014 at 3:29 PM, Rob Audenaerde 
 rob.audenae...@valuecare.nl
  wrote:

  I have a question on the AjaxSelfUpdatingTimerBehavior
  I have some memory issues and wondered in the behavior could cause this
  (on Jetty)
  When connected with jvisualvm I see the heap increasing each time the
  AjaxSelfUpdatingTimerBehavior is fired (with about 3M per request)
  Is that what I should see?
 
 

 I have reproduced it in a quickstart.

 The screenshot is here: http://www.audenaerde.org/ajax/screenshot.png
 The quickstart can be found here:
 http://www.audenaerde.org/ajax/ajaxmemory.zip

 Note that I am running in debug mode; but that should not matter I suppose.
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Exception when trying to load resource from a properties file.

2014-03-14 Thread vdaras
Hello,

I'm playing around with Wicket and I got a serious problem with .properties
files.

I got this HomePage.html

!DOCTYPE html
html
head
meta charset=UTF-8
titleWelcome Page/title
/head
body
form wicket:id=userForm
wicket:message key=name/:nbspinput wicket:id=name
type=text/
wicket:message key=surname/:nbspinput wicket:id=surname
type=text /
/form
/body
/html

and HomePage.propeties

?xml version=1.0 encoding=UTF-8?
properties
entry key=nameName/entry
entry key=surnameSurname/entry
/properties

These two files are located in the same directory in my project. 

I get an org.apache.wicket.WicketRuntimeException: Property 'name' not
found in property files exception when trying to render HomePage.html. 

I've checked the .war file in the server's directory and the two files are
in the same directory. I've also noticed that a HomePage.properties.xml file
is also deployed for some reason.The .war is packaged by Maven, using the
pom file from the wicket quickstart archetype.

Any ideas?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Exception-when-trying-to-load-resource-from-a-properties-file-tp4664967.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: Pass exception to internal error page

2014-03-14 Thread Martin Grigorov
Hi,


On Fri, Mar 14, 2014 at 4:11 PM, jchappelle jchappe...@4redi.com wrote:

 Hi Martin,

 Thanks for the quick reply.

 We don't currently detect duplicate issues automatically. We do get several
 duplicates from users because they tend to click the same bad button over
 and over. I'm not too worried about attackers because you have to log in to
 get anywhere in our application. The way I have thought about doing it is
 having a sourceId in our ErrorReport class that would identify the report.
 The sourceId might be the page and breadcrumb trail or something of that
 nature. Then the ErrorReportingService would keep maybe keep a hash of the
 sourceId or store the sourceId's in the database and make sure others with
 that id are not sent for a certain time window. Although that is not
 perfect, because it could prevent errors from getting to us that need to.

 Can I make a new feature issue in JIRA for the DefaultExceptionMapper to
 pass the exception to the constructor of the internal error page? Maybe it
 could be a new type of UnexpectedExceptionDisplay in IExceptionSettings
 called SHOW_INTERNAL_ERROR_PAGE_WITH_EXCEPTION. That way it doesn't risk
 breaking existing users' internal error pages.


With a patch would be awesome!



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Pass-exception-to-internal-error-page-tp4664951p4664973.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: Exception when trying to load resource from a properties file.

2014-03-14 Thread Martin Grigorov
Hi,

On Fri, Mar 14, 2014 at 1:53 PM, vdaras vda...@gmail.com wrote:

 Hello,

 I'm playing around with Wicket and I got a serious problem with .properties
 files.

 I got this HomePage.html

 !DOCTYPE html
 html
 head
 meta charset=UTF-8
 titleWelcome Page/title
 /head
 body
 form wicket:id=userForm
 wicket:message key=name/:nbspinput wicket:id=name
 type=text/
 wicket:message key=surname/:nbspinput wicket:id=surname
 type=text /
 /form
 /body
 /html

 and HomePage.propeties


You use the XML format but you miss the .xml extension in the file name.
Also you miss 'r' in propeRties.



 ?xml version=1.0 encoding=UTF-8?
 properties
 entry key=nameName/entry
 entry key=surnameSurname/entry
 /properties

 These two files are located in the same directory in my project.

 I get an org.apache.wicket.WicketRuntimeException: Property 'name' not
 found in property files exception when trying to render HomePage.html.

 I've checked the .war file in the server's directory and the two files are
 in the same directory. I've also noticed that a HomePage.properties.xml
 file
 is also deployed for some reason.The .war is packaged by Maven, using the


It is interesting to find out how  HomePage.properties.xml appeared if you
didn't added it.


 pom file from the wicket quickstart archetype.

 Any ideas?


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Exception-when-trying-to-load-resource-from-a-properties-file-tp4664967.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 with X-editable

2014-03-14 Thread Jered Myers
Thanks for your response.  I agree, it looks like it would be easy to 
implement.  I will likely have to fork X-editable and add custom code 
for my needs (not just Wicket integration), so I am curious if anybody 
has actually used this and run into problems.


On 03/10/2014 10:21 PM, Ernesto Reinaldo Barreiro wrote:

IMHO this should be very easy to implement/integrate with  Wicket: judging
from the documentation. I haven't used the library myself, so I might be
missing some nuances/caveats...


On Tue, Mar 11, 2014 at 12:03 AM, Jered Myers
jer...@maplewoodsoftware.comwrote:


Has anybody tried to work with Wicket and X-editable (
http://vitalets.github.io/x-editable/index.html)?  If so, what was your
experience (e.g. X-editable stability, difficulty to implement, etc.)?  I
am curious if it would be a good idea to go down the road of making my
Wicket application run with the X-editable in-line editable fields.

--
Jered Myers







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



Link to Wicket page from Javascript

2014-03-14 Thread Bruce Lombardi
Hi,

 

An earlier question I asked about session timeouts was answered by Martin
Grigorov. I am implementing his suggestion and have a JQuery script  what
sets a timer that times out after a certain period of inactivity. The
timeout triggers a function call.  Currently,  for a quick test,  I have
that function use location.href to go to an arbitrary static web page like
this:

 

function whenUserIdle(){

location.href = 'http://www.natural-environment.com';

}  

 

That works fine, but now I need to make it go to a Wicket page in my
application, similar to what would happen if I had an anchor tag like:

 

a wicket:id= SessionTimeoutPage href=#SessionTimeoutPage/a

 

But I can't figure out how to do this in the javascript function. Can anyone
tell me how to call the Wicket page from the javascript function?

 

Thanks,

 

Bruce



Re: Link to Wicket page from Javascript

2014-03-14 Thread Ernesto Reinaldo Barreiro
Hi,

I would implement this as..

1- A JS function that counts how much time has passed since last AJAX
request. Once a certain threshold is passed an AJAX request is sent to the
page.
2- An AbstractAjaxBehavior that is added to the page. I would use it as
context for AJAX request on 1).
3- On the respond of AJAXBehavior you redirect to  SessionTimeoutPage and
invalidate the session.



On Fri, Mar 14, 2014 at 8:07 PM, Bruce Lombardi brlom...@gmail.com wrote:

 Hi,



 An earlier question I asked about session timeouts was answered by Martin
 Grigorov. I am implementing his suggestion and have a JQuery script  what
 sets a timer that times out after a certain period of inactivity. The
 timeout triggers a function call.  Currently,  for a quick test,  I have
 that function use location.href to go to an arbitrary static web page like
 this:



 function whenUserIdle(){

 location.href = 'http://www.natural-environment.com';

 }



 That works fine, but now I need to make it go to a Wicket page in my
 application, similar to what would happen if I had an anchor tag like:



 a wicket:id= SessionTimeoutPage href=#SessionTimeoutPage/a



 But I can't figure out how to do this in the javascript function. Can
 anyone
 tell me how to call the Wicket page from the javascript function?



 Thanks,



 Bruce




-- 
Regards - Ernesto Reinaldo Barreiro


RE: Link to Wicket page from Javascript

2014-03-14 Thread Bruce Lombardi
Thanks Ernesto,  I was hoping for something simpler since what I have now
with a simple Jquery timer does everything I need except go the the
SessionTimeoutPage, where I would, as you suggest, invalidate the session.
I'm sure your solution would work, but I'm not familiar enough with
AbstractAjaxBehavior to implement it easily and the examples I've seen look
complicated.

Bruce

-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Friday, March 14, 2014 3:26 PM
To: users@wicket.apache.org
Subject: Re: Link to Wicket page from Javascript

Hi,

I would implement this as..

1- A JS function that counts how much time has passed since last AJAX
request. Once a certain threshold is passed an AJAX request is sent to the
page.
2- An AbstractAjaxBehavior that is added to the page. I would use it as
context for AJAX request on 1).
3- On the respond of AJAXBehavior you redirect to  SessionTimeoutPage and
invalidate the session.



On Fri, Mar 14, 2014 at 8:07 PM, Bruce Lombardi brlom...@gmail.com wrote:

 Hi,



 An earlier question I asked about session timeouts was answered by 
 Martin Grigorov. I am implementing his suggestion and have a JQuery 
 script  what sets a timer that times out after a certain period of 
 inactivity. The timeout triggers a function call.  Currently,  for a 
 quick test,  I have that function use location.href to go to an 
 arbitrary static web page like
 this:



 function whenUserIdle(){

 location.href = 'http://www.natural-environment.com';

 }



 That works fine, but now I need to make it go to a Wicket page in my 
 application, similar to what would happen if I had an anchor tag like:



 a wicket:id= SessionTimeoutPage href=#SessionTimeoutPage/a



 But I can't figure out how to do this in the javascript function. Can 
 anyone tell me how to call the Wicket page from the javascript 
 function?



 Thanks,



 Bruce




--
Regards - Ernesto Reinaldo Barreiro


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



Re: wicket:header-items/

2014-03-14 Thread Tom Götz
This is really helpful, thanks for your time!

Cheers,
   -Tom

On 14.03.2014, at 13:50, Martin Grigorov mgrigo...@apache.org wrote:

 Hi,
 
 At http://wicketinaction.com/2014/03/header-contributions-positioning/ I've
 added a short description of a new special wicket tag -
 wicket:header-items/.
 It will be available with Wicket 6.15.0.
 
 I hope you will find it useful!
 
 Martin Grigorov
 Wicket Training and Consulting


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