Mounting dynamic resources , wicket 1.5

2014-08-06 Thread Jayakrishnan R
Hi All,

I am trying out the Mounting dynamic resources as explained in  the
following article.

http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/

in the App.java , I have the following.
 mountResource(/images/${imgName}, new ImageResourceReference());

The image resource class is exactly the same.

I can see that a nice URL  is getting generated. But getting the following
exception on the page and the URL not working.

WARN  WicketObjects : Could not resolve class [undefined]
 java.lang.ClassNotFoundException: undefined
at
org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509)
at
org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
org.apache.wicket.application.AbstractClassResolver.resolveClass(AbstractClassResolver.java:107)
at
org.apache.wicket.util.lang.WicketObjects.resolveClass(WicketObjects.java:71)
at
org.apache.wicket.request.mapper.AbstractComponentMapper.getPageClass(AbstractComponentMapper.java:138)
at
org.apache.wicket.request.mapper.BookmarkableMapper.parseRequest(BookmarkableMapper.java:110)
at
org.apache.wicket.request.mapper.AbstractBookmarkableMapper.mapRequest(AbstractBookmarkableMapper.java:269)
at
org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:141)
at
org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:184)
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:209)
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at
com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at
com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at
com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)




-- 
Thanks  Regards
JK


Re: Mounting dynamic resources , wicket 1.5

2014-08-06 Thread Jayakrishnan R
Hi Martin,

The URL I currently get ( by printing in the log)  is
*https://localhost:8181/testApp/wicket/images/52p23eepiph3_20140515_015558_1_.jpg
https://localhost:8181/testApp/wicket/images/52p23eepiph3_20140515_015558_1_.jpg*

But When I check in the browser console , I get the following.
Failed to load resource: the server responded with a status of 404 (Not
Found)
* https://localhost:8181/testApp/wicket/bookmarkable/undefined
https://localhost:8181/testApp/wicket/bookmarkable/undefined*

How should I go about resolving it ?


On Wed, Aug 6, 2014 at 11:23 AM, Martin Grigorov mgrigo...@apache.org
wrote:

 Hi,

 Check in the browser dev tools console which url exactly fails with error
 500.
 BookmarkableMapper is used for urls like :
 /wicket/bookmarkable/com.example.MyPage
 Your image urls should be: /images/someName.jpg

 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov


 On Wed, Aug 6, 2014 at 12:17 PM, Jayakrishnan R jk.h...@gmail.com wrote:

  Hi All,
 
  I am trying out the Mounting dynamic resources as explained in  the
  following article.
 
  http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
 
  in the App.java , I have the following.
   mountResource(/images/${imgName}, new ImageResourceReference());
 
  The image resource class is exactly the same.
 
  I can see that a nice URL  is getting generated. But getting the
 following
  exception on the page and the URL not working.
 
  WARN  WicketObjects : Could not resolve class [undefined]
   java.lang.ClassNotFoundException: undefined
  at
 
 
 org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509)
  at
 
 
 org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:247)
  at
 
 
 org.apache.wicket.application.AbstractClassResolver.resolveClass(AbstractClassResolver.java:107)
  at
 
 
 org.apache.wicket.util.lang.WicketObjects.resolveClass(WicketObjects.java:71)
  at
 
 
 org.apache.wicket.request.mapper.AbstractComponentMapper.getPageClass(AbstractComponentMapper.java:138)
  at
 
 
 org.apache.wicket.request.mapper.BookmarkableMapper.parseRequest(BookmarkableMapper.java:110)
  at
 
 
 org.apache.wicket.request.mapper.AbstractBookmarkableMapper.mapRequest(AbstractBookmarkableMapper.java:269)
  at
 
 
 org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:141)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:184)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:209)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
  at
 
 
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
  at
 
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
  at
 
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
  at
 
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
  at
 
 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
  at
 
 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
  at
 
 
 org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
  at
 
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
  at
 
 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
  at
 
 
 org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
  at
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
  at
 
 
 com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
  at
 
 
 com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
  at
  com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
  at
 com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
  at
 com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
  at
 
 
 com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
  at
 
 
 com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
  at
 
 com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
  at
 
 com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
  at
  com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
  at
 
 
 com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
  at
 
 
 com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59

Re: Mounting dynamic resources , wicket 1.5

2014-08-06 Thread Jayakrishnan R
Hi Martin,

Thank you for the suggestions. I will check that.

I also have a question on securing such mounted resources when there is a
valid session. Is there a way to secure access to resources mounted like
this ?

I want such images to be accessible only for valid users when signed on.




On Wed, Aug 6, 2014 at 12:07 PM, Martin Grigorov mgrigo...@apache.org
wrote:

 Check the Dev tools Network tab.
 Sometimes there is a clue what triggered a request.
 You can disable the image resource reference (i.e. comment out the code)
 and  see whether the problem is still there.

 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov


 On Wed, Aug 6, 2014 at 12:36 PM, Jayakrishnan R jk.h...@gmail.com wrote:

  Hi Martin,
 
  The URL I currently get ( by printing in the log)  is
  *
 
 https://localhost:8181/testApp/wicket/images/52p23eepiph3_20140515_015558_1_.jpg
  
 
 https://localhost:8181/testApp/wicket/images/52p23eepiph3_20140515_015558_1_.jpg
  *
 
  But When I check in the browser console , I get the following.
  Failed to load resource: the server responded with a status of 404 (Not
  Found)
  * https://localhost:8181/testApp/wicket/bookmarkable/undefined
  https://localhost:8181/testApp/wicket/bookmarkable/undefined*
 
  How should I go about resolving it ?
 
 
  On Wed, Aug 6, 2014 at 11:23 AM, Martin Grigorov mgrigo...@apache.org
  wrote:
 
   Hi,
  
   Check in the browser dev tools console which url exactly fails with
 error
   500.
   BookmarkableMapper is used for urls like :
   /wicket/bookmarkable/com.example.MyPage
   Your image urls should be: /images/someName.jpg
  
   Martin Grigorov
   Wicket Training and Consulting
   https://twitter.com/mtgrigorov
  
  
   On Wed, Aug 6, 2014 at 12:17 PM, Jayakrishnan R jk.h...@gmail.com
  wrote:
  
Hi All,
   
I am trying out the Mounting dynamic resources as explained in  the
following article.
   
http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
   
in the App.java , I have the following.
 mountResource(/images/${imgName}, new ImageResourceReference());
   
The image resource class is exactly the same.
   
I can see that a nice URL  is getting generated. But getting the
   following
exception on the page and the URL not working.
   
WARN  WicketObjects : Could not resolve class [undefined]
 java.lang.ClassNotFoundException: undefined
at
   
   
  
 
 org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509)
at
   
   
  
 
 org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
   
   
  
 
 org.apache.wicket.application.AbstractClassResolver.resolveClass(AbstractClassResolver.java:107)
at
   
   
  
 
 org.apache.wicket.util.lang.WicketObjects.resolveClass(WicketObjects.java:71)
at
   
   
  
 
 org.apache.wicket.request.mapper.AbstractComponentMapper.getPageClass(AbstractComponentMapper.java:138)
at
   
   
  
 
 org.apache.wicket.request.mapper.BookmarkableMapper.parseRequest(BookmarkableMapper.java:110)
at
   
   
  
 
 org.apache.wicket.request.mapper.AbstractBookmarkableMapper.mapRequest(AbstractBookmarkableMapper.java:269)
at
   
   
  
 
 org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:141)
at
   
   
  
 
 org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:184)
at
   
   
  
 
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:209)
at
   
   
  
 
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at
   
   
  
 
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
at
   
   
  
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
at
   
   
  
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at
   
   
  
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at
   
   
  
 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at
   
   
  
 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
   
   
  
 
 org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at
   
  
 
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at
   
   
  
 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at
   
   
  
 
 org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at
   
  
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231

Re: Mounting dynamic resources , wicket 1.5

2014-08-06 Thread Jayakrishnan R
Thank you so much.


On Wed, Aug 6, 2014 at 2:09 PM, Martin Grigorov mgrigo...@apache.org
wrote:

 See https://issues.apache.org/jira/browse/WICKET-5012

 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov


 On Wed, Aug 6, 2014 at 2:47 PM, Jayakrishnan R jk.h...@gmail.com wrote:

  Hi Martin,
 
  Thank you for the suggestions. I will check that.
 
  I also have a question on securing such mounted resources when there is a
  valid session. Is there a way to secure access to resources mounted like
  this ?
 
  I want such images to be accessible only for valid users when signed on.
 
 
 
 
  On Wed, Aug 6, 2014 at 12:07 PM, Martin Grigorov mgrigo...@apache.org
  wrote:
 
   Check the Dev tools Network tab.
   Sometimes there is a clue what triggered a request.
   You can disable the image resource reference (i.e. comment out the
 code)
   and  see whether the problem is still there.
  
   Martin Grigorov
   Wicket Training and Consulting
   https://twitter.com/mtgrigorov
  
  
   On Wed, Aug 6, 2014 at 12:36 PM, Jayakrishnan R jk.h...@gmail.com
  wrote:
  
Hi Martin,
   
The URL I currently get ( by printing in the log)  is
*
   
  
 
 https://localhost:8181/testApp/wicket/images/52p23eepiph3_20140515_015558_1_.jpg

   
  
 
 https://localhost:8181/testApp/wicket/images/52p23eepiph3_20140515_015558_1_.jpg
*
   
But When I check in the browser console , I get the following.
Failed to load resource: the server responded with a status of 404
 (Not
Found)
* https://localhost:8181/testApp/wicket/bookmarkable/undefined
https://localhost:8181/testApp/wicket/bookmarkable/undefined*
   
How should I go about resolving it ?
   
   
On Wed, Aug 6, 2014 at 11:23 AM, Martin Grigorov 
 mgrigo...@apache.org
  
wrote:
   
 Hi,

 Check in the browser dev tools console which url exactly fails with
   error
 500.
 BookmarkableMapper is used for urls like :
 /wicket/bookmarkable/com.example.MyPage
 Your image urls should be: /images/someName.jpg

 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov


 On Wed, Aug 6, 2014 at 12:17 PM, Jayakrishnan R jk.h...@gmail.com
 
wrote:

  Hi All,
 
  I am trying out the Mounting dynamic resources as explained in
  the
  following article.
 
  http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
 
  in the App.java , I have the following.
   mountResource(/images/${imgName}, new
 ImageResourceReference());
 
  The image resource class is exactly the same.
 
  I can see that a nice URL  is getting generated. But getting the
 following
  exception on the page and the URL not working.
 
  WARN  WicketObjects : Could not resolve class [undefined]
   java.lang.ClassNotFoundException: undefined
  at
 
 

   
  
 
 org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509)
  at
 
 

   
  
 
 org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:247)
  at
 
 

   
  
 
 org.apache.wicket.application.AbstractClassResolver.resolveClass(AbstractClassResolver.java:107)
  at
 
 

   
  
 
 org.apache.wicket.util.lang.WicketObjects.resolveClass(WicketObjects.java:71)
  at
 
 

   
  
 
 org.apache.wicket.request.mapper.AbstractComponentMapper.getPageClass(AbstractComponentMapper.java:138)
  at
 
 

   
  
 
 org.apache.wicket.request.mapper.BookmarkableMapper.parseRequest(BookmarkableMapper.java:110)
  at
 
 

   
  
 
 org.apache.wicket.request.mapper.AbstractBookmarkableMapper.mapRequest(AbstractBookmarkableMapper.java:269)
  at
 
 

   
  
 
 org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:141)
  at
 
 

   
  
 
 org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:184)
  at
 
 

   
  
 
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:209)
  at
 
 

   
  
 
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
  at
 
 

   
  
 
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
  at
 
 

   
  
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
  at
 
 

   
  
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
  at
 
 

   
  
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217

Strict date pattern for DateTextField in Wicket

2013-07-03 Thread Jayakrishnan R
Hi All,

I have a DateTextField component in my application and I want the input of
date using a predefined pattern. The pattern that I need is -MM-dd. I
created the DateTextField using the following code.

DateTextField dtf_ExpiryDate =
DateTextField.forDatePattern(ExpDate, -MM-dd);
dtf_ExpiryDate.add(new DatePicker());

It helps to prevent date input in most of other formats. But it accepts
input in dd-MM- format and converts it into some weird format. For
example, *12-06-2013* is automatically converted to *0012-06-20*.

Is there a way to throw an error when the date is given in dd-MM- ?

Javadocs of 
DateTextFieldhttp://wicket.apache.org/apidocs/1.4/org/apache/wicket/datetime/markup/html/form/DateTextField.htmlsays
that the conversion is done internally using the Joda time parser. Is
there a way to add more constraints ?

I really don't want the data to be captured as String and add a
StringValidator to check if it confirms to the pattern using Regex.

Thank you

-- 
Thanks  Regards
JK


Re: Wicket DefaultDataTable - Refresh it on browser back button

2013-03-27 Thread Jayakrishnan R
Hi Martin,

Thanks for the direction. I finally found the problem. The list of records
( collection ) was assigned to the data provider in the contructor of that
page. So when I press back button, the latest data was not getting
refreshed.

I still need to find a way to push the latest data on to the model.

Thanks
JK


On Mon, Mar 25, 2013 at 4:08 PM, Jayakrishnan R jk.h...@gmail.com wrote:


 Hi,

 Does that mean that the DataProvider returns primary key objects which are
 used in the LoadableDetachableModel to load the real object ?

 I am not sure. But one thing I noticed, the load() method of the
 LoadableDetachableModel is not being called when the back button is hit.

 I am getting exception the populateItem method .of the columns in the data
 table... see below.


 ListIColumnRecord columns = new ArrayListIColumnRecord();

columns.add(new AbstractColumnRecord(
 new StringResourceModel(Record_number, this, null),
 Record_number) {

 @Override
 public void populateItem(Item item, String id, IModel
 rowModel) {
 }};





 On Mon, Mar 25, 2013 at 3:55 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 On Mon, Mar 25, 2013 at 5:50 PM, Jayakrishnan R jk.h...@gmail.com
 wrote:

  Hi All,
 
  In my application I am using *DefaultDataTable *with
  *SortableDataProvider *which
  has *LoadableDetachableModel *as the model.
 

 Does that mean that the DataProvider returns primary key objects which are
 used in the LoadableDetachableModel to load the real object ?

 Check why your DataProvider returns (the ids of) deleted objects when back
 button is used.


 
  I used it to display a set of records ( say RecordList page). When I
 add or
  remove some records and load the page RecordList again, it displays the
  changes. However, if I use the back button of the browser and go the
  RecordList page which was rentered earlier ( before adding/ removing the
  records ). The *DefaultDataTable *still has the old sets of records.
 This
  is a big issue when records are deleted.
 
  For example, If I delete a record and press back button then the page
 fails
  as the record it is trying to show does not exist in the database.
 Adding
  does not create an issue because it simply does not get listed in the
 set
  of records.
 
  In another page, I just have *PageableListView *with *
  LoadableDetachableModel*. It works fine with out an issue.
 
  Can someone advice me on how to refresh the data table on browser back
  button ?
 
  --
  Thanks  Regards
  JK
 



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




 --
 Thanks  Regards
 JK




-- 
Thanks  Regards
JK


Wicket DefaultDataTable - Refresh it on browser back button

2013-03-25 Thread Jayakrishnan R
Hi All,

In my application I am using *DefaultDataTable *with
*SortableDataProvider *which
has *LoadableDetachableModel *as the model.

I used it to display a set of records ( say RecordList page). When I add or
remove some records and load the page RecordList again, it displays the
changes. However, if I use the back button of the browser and go the
RecordList page which was rentered earlier ( before adding/ removing the
records ). The *DefaultDataTable *still has the old sets of records. This
is a big issue when records are deleted.

For example, If I delete a record and press back button then the page fails
as the record it is trying to show does not exist in the database. Adding
does not create an issue because it simply does not get listed in the set
of records.

In another page, I just have *PageableListView *with *
LoadableDetachableModel*. It works fine with out an issue.

Can someone advice me on how to refresh the data table on browser back
button ?

-- 
Thanks  Regards
JK


Re: Wicket DefaultDataTable - Refresh it on browser back button

2013-03-25 Thread Jayakrishnan R
Hi,
Does that mean that the DataProvider returns primary key objects which are
used in the LoadableDetachableModel to load the real object ?

I am not sure. But one thing I noticed, the load() method of the
LoadableDetachableModel is not being called when the back button is hit.

I am getting exception the populateItem method .of the columns in the data
table... see below.


ListIColumnRecord columns = new ArrayListIColumnRecord();

   columns.add(new AbstractColumnRecord(
new StringResourceModel(Record_number, this, null),
Record_number) {

@Override
public void populateItem(Item item, String id, IModel rowModel)
{
}};





On Mon, Mar 25, 2013 at 3:55 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 On Mon, Mar 25, 2013 at 5:50 PM, Jayakrishnan R jk.h...@gmail.com wrote:

  Hi All,
 
  In my application I am using *DefaultDataTable *with
  *SortableDataProvider *which
  has *LoadableDetachableModel *as the model.
 

 Does that mean that the DataProvider returns primary key objects which are
 used in the LoadableDetachableModel to load the real object ?

 Check why your DataProvider returns (the ids of) deleted objects when back
 button is used.


 
  I used it to display a set of records ( say RecordList page). When I add
 or
  remove some records and load the page RecordList again, it displays the
  changes. However, if I use the back button of the browser and go the
  RecordList page which was rentered earlier ( before adding/ removing the
  records ). The *DefaultDataTable *still has the old sets of records. This
  is a big issue when records are deleted.
 
  For example, If I delete a record and press back button then the page
 fails
  as the record it is trying to show does not exist in the database. Adding
  does not create an issue because it simply does not get listed in the set
  of records.
 
  In another page, I just have *PageableListView *with *
  LoadableDetachableModel*. It works fine with out an issue.
 
  Can someone advice me on how to refresh the data table on browser back
  button ?
 
  --
  Thanks  Regards
  JK
 



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




-- 
Thanks  Regards
JK


Wicket LoadableDetachableModel exception handling issue

2013-02-20 Thread Jayakrishnan R
In my project, I am using LoadableDetachableModel as given below.

public ReportPage(final Objectm, final PageReference pr) throws
CustomException{try{final LoadableDetachableModelListMaintReport
ldm =
 new LoadableDetachableModelListMaintReport() {

@Override
protected ListMaintReportload() {
**// Some Database operations //**
return x;
}
};
/*
Several LoadableDetachableModels, PageableListViews, Panels, Fragments  etc.
*/ } catch ( Exception ex){// create Custom Exception } finally {
 // Clean up of stuff }


My problem is that I am using AbstractColumn to display the objects in the
column and the overriden populateItem() method calls the load()
internally.  Since both the methods cannot throw Exceptions, I cannot
really catch exceptions and display appropriate messages.

Any help on this is really appreciated.

-- 
Thanks  Regards
JK


Re: Wicket LoadableDetachableModel exception handling issue

2013-02-20 Thread Jayakrishnan R
i have already done that as a back up plan.  Do you think wicket is a bit
wierd in handling exceptions.
On 20 Feb 2013 16:22, Ondrej Zizka ozi...@redhat.com wrote:

 How about wrapping it to a RuntimeException, or preferably, your own
 subclass of it?

 Ondra



 On 02/20/2013 04:51 PM, Jayakrishnan R wrote:

 In my project, I am using LoadableDetachableModel as given below.

 public ReportPage(final Objectm, final PageReference pr) throws
 CustomException{try{final LoadableDetachableModelList**MaintReport
 ldm =
   new LoadableDetachableModelList**MaintReport() {

  @Override
  protected ListMaintReportload() {
  **// Some Database operations //**
  return x;
  }
  };
 /*
 Several LoadableDetachableModels, PageableListViews, Panels, Fragments
  etc.
 */ } catch ( Exception ex){// create Custom Exception } finally {
   // Clean up of stuff }


 My problem is that I am using AbstractColumn to display the objects in the
 column and the overriden populateItem() method calls the load()
 internally.  Since both the methods cannot throw Exceptions, I cannot
 really catch exceptions and display appropriate messages.

 Any help on this is really appreciated.