Append wicketAjaxget() after some javascripts

2012-05-08 Thread jiayang
Hi, I want to clear the focused text fields by using java script instead of
through wicket. Thus, I want the onfocus=this.value=' '; var
wcall=wicketAjaxGet(url,function, function,function);   Is there any way to
implement this? 
Since there are several text fields with different Url, I can't hard code a
function called callWicket() for all the fields.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Append-wicketAjaxget-after-some-javascripts-tp4615517.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 Examples

2012-05-08 Thread Martin Grigorov
http://www.wicket-library.com/wicket-examples/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.FormPage
works OK for me

On Tue, May 8, 2012 at 12:43 AM, Corbin, James jcor...@iqnavigator.com wrote:
 The wicket examples (www.wicket-library.com/wicket-examples/) seems to be 
 having issues.

 I select the Contacts Editor option under the repeaters section and I get a 
 permgen error.

 Is this site working properly?  I assume the URL above is appropriate?

 J.D.



-- 
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: TableComponentAsXlsHandler Problem

2012-05-08 Thread khanshan
Let me give an example, 
I have a resultset with 90.000 records, 
after onclick. it stucks on page and doesnt post excel file.
I know it stucks on loading from listview to excell file, but there must be
a better to way fasten it.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TableComponentAsXlsHandler-Problem-tp4616754p4616832.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: TableComponentAsXlsHandler Problem

2012-05-08 Thread Martin Grigorov
Hi,

TableComponentAsXlsHandler helps to save a Wicket Repeater component
to Excel (.xls).
Do you print 90.000 records in the web page and then try to save them in .xls ?
You better print the records with paging and add a button Print all
which uses Apache POI directly to create the .xls from your data
(without using TableComponentAsXlsHandler at all).

On Tue, May 8, 2012 at 10:53 AM, khanshan hakansende...@yahoo.com wrote:
 Let me give an example,
 I have a resultset with 90.000 records,
 after onclick. it stucks on page and doesnt post excel file.
 I know it stucks on loading from listview to excell file, but there must be
 a better to way fasten it.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/TableComponentAsXlsHandler-Problem-tp4616754p4616832.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: Append wicketAjaxget() after some javascripts

2012-05-08 Thread Martin Grigorov
Hi,

You can use IAjaxCallDecorator that prepends this JS code for all Ajax
behaviors you need.

On Mon, May 7, 2012 at 9:42 PM, jiayang yangjian0...@gmail.com wrote:
 Hi, I want to clear the focused text fields by using java script instead of
 through wicket. Thus, I want the onfocus=this.value=' '; var
 wcall=wicketAjaxGet(url,function, function,function);   Is there any way to
 implement this?
 Since there are several text fields with different Url, I can't hard code a
 function called callWicket() for all the fields.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Append-wicketAjaxget-after-some-javascripts-tp4615517.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: WicketStuff HTML validator 1.5-rc3 released

2012-05-08 Thread Martijn Dashorst
Probably coming friday.

Martijn

On Tue, May 8, 2012 at 7:56 AM, northar josef.anders...@gmail.com wrote:
 Any updates coming to this component soon, as it don't seem to be in the repo
 at https://github.com/wicketstuff?

 Are there any other good alternatives to this component for validating on
 the fly in wicket?

 Thanks for any hints!

 /Northar


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/WicketStuff-HTML-validator-1-5-rc3-released-tp3478279p4616629.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




-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



Re: TableComponentAsXlsHandler Problem

2012-05-08 Thread khanshan
Hi Martin,

First of all thanks for your reply,

Actually my main problem is listing all 90.000 records on webpage, loading
aListview from resultset takes so long time, and it stucks while webpage is
adding component to itself.

I wanted to avioid adding listwiew object if number of records are bigger
than optimum number of records ( it is around 5.000) and export directly via
excell for not freezing webpage.

It s quite messy isnt it?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TableComponentAsXlsHandler-Problem-tp4616754p4616896.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: TableComponentAsXlsHandler Problem

2012-05-08 Thread Martin Grigorov
Hi,

Printing that many items is a bad idea. This will be a very big page
and the browser may become unresponsive.
If you still need to print them all then better create your own
component which generates the HTML by concatenating strings. See how
DropDownChoice does this for its options.

On Tue, May 8, 2012 at 11:26 AM, khanshan hakansende...@yahoo.com wrote:
 Hi Martin,

 First of all thanks for your reply,

 Actually my main problem is listing all 90.000 records on webpage, loading
 aListview from resultset takes so long time, and it stucks while webpage is
 adding component to itself.

 I wanted to avioid adding listwiew object if number of records are bigger
 than optimum number of records ( it is around 5.000) and export directly via
 excell for not freezing webpage.

 It s quite messy isnt it?



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/TableComponentAsXlsHandler-Problem-tp4616754p4616896.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: TableComponentAsXlsHandler Problem

2012-05-08 Thread khanshan
I aggree that,
loading to page after optimum number of records stucks page,
I dont have problem with less than 5000 records listviews,

So there should be a way to export all massive number of records via excell
file,
By exporting with excell, I dont need to load page,

Do you think I can use a tricky way for exporting data via excel without
using wicket components, lean java?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TableComponentAsXlsHandler-Problem-tp4616754p4616922.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: TableComponentAsXlsHandler Problem

2012-05-08 Thread Martin Grigorov
On Tue, May 8, 2012 at 11:46 AM, khanshan hakansende...@yahoo.com wrote:
 I aggree that,
 loading to page after optimum number of records stucks page,
 I dont have problem with less than 5000 records listviews,

 So there should be a way to export all massive number of records via excell
 file,
 By exporting with excell, I dont need to load page,

 Do you think I can use a tricky way for exporting data via excel without
 using wicket components, lean java?

yes, see how TableComponentAsXlsHandler does it.


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/TableComponentAsXlsHandler-Problem-tp4616754p4616922.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: TableComponentAsXlsHandler Problem

2012-05-08 Thread khanshan
??
Any idea?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TableComponentAsXlsHandler-Problem-tp4616754p4616938.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 Examples

2012-05-08 Thread Fergal Keating
I got a PermGen space error on that URL.

javax.servlet.ServletException: Filter execution threw an exception

*root cause*

java.lang.OutOfMemoryError: PermGen space


On 8 May 2012 08:31, Martin Grigorov mgrigo...@apache.org wrote:


 http://www.wicket-library.com/wicket-examples/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.FormPage
 works OK for me

 On Tue, May 8, 2012 at 12:43 AM, Corbin, James jcor...@iqnavigator.com
 wrote:
  The wicket examples (www.wicket-library.com/wicket-examples/) seems to
 be having issues.
 
  I select the Contacts Editor option under the repeaters section and I
 get a permgen error.
 
  Is this site working properly?  I assume the URL above is appropriate?
 
  J.D.



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




-- 
Fergal Keating
IT Senior Engineer
---
e. fergal.keat...@directski.com
p. NA
w. www.directski.com


Re: Wicket Examples

2012-05-08 Thread Martin Grigorov
I can see it now ...
Maybe it is because I uploaded the examples for 6.x, 1.5.x, 1.4.x,
inmethod-grid and Brix at it.
I'm not sure how much this machine can handle ...
I'll undeploy Brix and some old wicket-contrib examples.

On Tue, May 8, 2012 at 12:43 PM, Fergal Keating
fergal.keat...@directski.com wrote:
 I got a PermGen space error on that URL.

 javax.servlet.ServletException: Filter execution threw an exception

 *root cause*

 java.lang.OutOfMemoryError: PermGen space


 On 8 May 2012 08:31, Martin Grigorov mgrigo...@apache.org wrote:


 http://www.wicket-library.com/wicket-examples/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.FormPage
 works OK for me

 On Tue, May 8, 2012 at 12:43 AM, Corbin, James jcor...@iqnavigator.com
 wrote:
  The wicket examples (www.wicket-library.com/wicket-examples/) seems to
 be having issues.
 
  I select the Contacts Editor option under the repeaters section and I
 get a permgen error.
 
  Is this site working properly?  I assume the URL above is appropriate?
 
  J.D.



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




 --
 Fergal Keating
 IT Senior Engineer
 ---
 e. fergal.keat...@directski.com
 p. NA
 w. www.directski.com



-- 
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: Wicket Examples

2012-05-08 Thread Johan Compagner
Permspace is tricky
Do we have a nice management console on that server?

Because it looks like to little class/perm space mem us configured or we
leak classes when un deploying
On May 8, 2012 11:59 AM, Martin Grigorov mgrigo...@apache.org wrote:

 I can see it now ...
 Maybe it is because I uploaded the examples for 6.x, 1.5.x, 1.4.x,
 inmethod-grid and Brix at it.
 I'm not sure how much this machine can handle ...
 I'll undeploy Brix and some old wicket-contrib examples.

 On Tue, May 8, 2012 at 12:43 PM, Fergal Keating
 fergal.keat...@directski.com wrote:
  I got a PermGen space error on that URL.
 
  javax.servlet.ServletException: Filter execution threw an exception
 
  *root cause*
 
  java.lang.OutOfMemoryError: PermGen space
 
 
  On 8 May 2012 08:31, Martin Grigorov mgrigo...@apache.org wrote:
 
 
 
 http://www.wicket-library.com/wicket-examples/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.FormPage
  works OK for me
 
  On Tue, May 8, 2012 at 12:43 AM, Corbin, James jcor...@iqnavigator.com
 
  wrote:
   The wicket examples (www.wicket-library.com/wicket-examples/) seems
 to
  be having issues.
  
   I select the Contacts Editor option under the repeaters section and I
  get a permgen error.
  
   Is this site working properly?  I assume the URL above is appropriate?
  
   J.D.
 
 
 
  --
  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
 
 
 
 
  --
  Fergal Keating
  IT Senior Engineer
  ---
  e. fergal.keat...@directski.com
  p. NA
  w. www.directski.com



 --
 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: Wicket Examples

2012-05-08 Thread Martin Grigorov
I'm not very acquaint with these details.
Maybe Juergen can shed some light.

I know that there is some automatic restart of the Tomcat process
because I saw few times that Tomcat 6 instance is stopped and Tomcat 5
is started instead (by some cron job maybe) and that's the reason
Wicket 6.x examples to not work.

On Tue, May 8, 2012 at 1:34 PM, Johan Compagner jcompag...@gmail.com wrote:
 Permspace is tricky
 Do we have a nice management console on that server?

 Because it looks like to little class/perm space mem us configured or we
 leak classes when un deploying
 On May 8, 2012 11:59 AM, Martin Grigorov mgrigo...@apache.org wrote:

 I can see it now ...
 Maybe it is because I uploaded the examples for 6.x, 1.5.x, 1.4.x,
 inmethod-grid and Brix at it.
 I'm not sure how much this machine can handle ...
 I'll undeploy Brix and some old wicket-contrib examples.

 On Tue, May 8, 2012 at 12:43 PM, Fergal Keating
 fergal.keat...@directski.com wrote:
  I got a PermGen space error on that URL.
 
  javax.servlet.ServletException: Filter execution threw an exception
 
  *root cause*
 
  java.lang.OutOfMemoryError: PermGen space
 
 
  On 8 May 2012 08:31, Martin Grigorov mgrigo...@apache.org wrote:
 
 
 
 http://www.wicket-library.com/wicket-examples/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.FormPage
  works OK for me
 
  On Tue, May 8, 2012 at 12:43 AM, Corbin, James jcor...@iqnavigator.com
 
  wrote:
   The wicket examples (www.wicket-library.com/wicket-examples/) seems
 to
  be having issues.
  
   I select the Contacts Editor option under the repeaters section and I
  get a permgen error.
  
   Is this site working properly?  I assume the URL above is appropriate?
  
   J.D.
 
 
 
  --
  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
 
 
 
 
  --
  Fergal Keating
  IT Senior Engineer
  ---
  e. fergal.keat...@directski.com
  p. NA
  w. www.directski.com



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





-- 
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: Wicket Examples

2012-05-08 Thread Korbinian Bachl - privat

Hi,

some hints:

Make sure the jvm the server is running in is started with (I assume JRE 
1.6 - 1.6.0_32):


-server
-XX:+UseConcMarkSweepGC
-XX:+CMSPermGenSweepingEnabled
-XX:+CMSClassUnloadingEnabled

Also make sure permGen is specified big enough, e.g:
-XX:MaxPermSize=384m


Also, I wouldn't recommend to restart the tomcat too often, else you'll 
loose the goodies of the HotSpot VM;


Best



Am 08.05.12 11:59, schrieb Martin Grigorov:

I can see it now ...
Maybe it is because I uploaded the examples for 6.x, 1.5.x, 1.4.x,
inmethod-grid and Brix at it.
I'm not sure how much this machine can handle ...
I'll undeploy Brix and some old wicket-contrib examples.

On Tue, May 8, 2012 at 12:43 PM, Fergal Keating
fergal.keat...@directski.com  wrote:

I got a PermGen space error on that URL.

javax.servlet.ServletException: Filter execution threw an exception

*root cause*

java.lang.OutOfMemoryError: PermGen space


On 8 May 2012 08:31, Martin Grigorovmgrigo...@apache.org  wrote:



http://www.wicket-library.com/wicket-examples/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.FormPage
works OK for me

On Tue, May 8, 2012 at 12:43 AM, Corbin, Jamesjcor...@iqnavigator.com
wrote:

The wicket examples (www.wicket-library.com/wicket-examples/) seems to

be having issues.


I select the Contacts Editor option under the repeaters section and I

get a permgen error.


Is this site working properly?  I assume the URL above is appropriate?

J.D.




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





--
Fergal Keating
IT Senior Engineer
---
e. fergal.keat...@directski.com
p. NA
w. www.directski.com






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



Re: TableComponentAsXlsHandler Problem

2012-05-08 Thread khanshan
Mr Grigorov,

I would like to ask one last thing.
I handled generating excell workbook, and laoding all mass of data to excell
file,

Ijust need helf about posting back that excell file via onclick method.

I have excell file as,
HSSFWorkbook hwb=new HSSFWorkbook();

and I need to bind that excell file to onclick method?
Do you have any idea?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TableComponentAsXlsHandler-Problem-tp4616754p4617334.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: TableComponentAsXlsHandler Problem

2012-05-08 Thread Martin Grigorov
See DownloadLink and ResourceLink Wicket components

On Tue, May 8, 2012 at 3:33 PM, khanshan hakansende...@yahoo.com wrote:
 Mr Grigorov,

 I would like to ask one last thing.
 I handled generating excell workbook, and laoding all mass of data to excell
 file,

 Ijust need helf about posting back that excell file via onclick method.

 I have excell file as,
 HSSFWorkbook hwb=new HSSFWorkbook();

 and I need to bind that excell file to onclick method?
 Do you have any idea?


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/TableComponentAsXlsHandler-Problem-tp4616754p4617334.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



Persistence.

2012-05-08 Thread JASON HOLT




I'll repeat my plea for patience as I'm new to Java and Wicket, but have some 
minimal experience with ASP.net forms (not MVC). I've reached that point in the 
learning process where I want to interact with a database and I wish to use 
entities and Hibernate to make it easier. From what I've seen in various blogs 
and forums, some say you shouldn't use entities as models, yet others do it 
with LDMs. Since I'm taking baby steps, I want to start by using entities as 
models, unless someone convinces me I'm wasting my time. Following the basic 
Hibernate tutorials for persisting simple classes, I've managed to make the 
following work in Wicket. In the LDM load... @Override
public Person load()
{
   Session session =  WicketApp.sessionFactory.openSession();
   session.beginTransaction();
   Person person = (Person) session.get(Person.class, 1L);
   session.getTransaction().commit();
   session.close();
   return person;
} In the form I update the evil entity model with text boxes, using a CPM 
containing the LDM. In the submit button... public void onSubmit()
{
   Session session = WicketApp.sessionFactory.openSession();
   session.beginTransaction();
   session.update(ldm.getObject());
   session.getTransaction().commit();
   session.close();   this.setResponsePage(EndPage.class);
} The sessionFactory is a static member of the WicketApp application class, 
initialized in the init() method. This seems to work, but I suppose there are 
all kinds of faulty design patterns used here. My main concern is... how can I 
do this without opening a new Hibernate session in onSubmit()? During postback, 
I think I should be able to reuse the same session opened at ldm.load() in 
onSubmit() also, as it all occurs in the same request. Is this possible? Thanks 
for your assistance. Please feel free to point out every flaw.  
  

Re: Persistence.

2012-05-08 Thread Richard W. Adams
Gosh, you can use Hibernate if you want, but I write plain DAO classes 
with JDBC  Wicket  they work just fine. No fuss, no muss. Just my take 
on it, though. I know there are some that like Hibernate. But try as I 
might, I've never been able to justify yet another third party library for 
my needs.

There are three kinds of lies: lies, damn lies, and statistics.
Benjamin Disraeli

Then there was the man who drowned crossing a stream with an average 
depth of six inches.
W. I. E. Gates




From:   JASON HOLT j_holt5...@msn.com
To: users@wicket.apache.org
Date:   05/08/2012 03:37 PM
Subject:Persistence.







I'll repeat my plea for patience as I'm new to Java and Wicket, but have 
some minimal experience with ASP.net forms (not MVC). I've reached that 
point in the learning process where I want to interact with a database and 
I wish to use entities and Hibernate to make it easier. From what I've 
seen in various blogs and forums, some say you shouldn't use entities as 
models, yet others do it with LDMs. Since I'm taking baby steps, I want to 
start by using entities as models, unless someone convinces me I'm wasting 
my time. Following the basic Hibernate tutorials for persisting simple 
classes, I've managed to make the following work in Wicket. In the LDM 
load... @Override
public Person load()
{
   Session session =  WicketApp.sessionFactory.openSession();
   session.beginTransaction();
   Person person = (Person) session.get(Person.class, 1L);
   session.getTransaction().commit();
   session.close();
   return person;
} In the form I update the evil entity model with text boxes, using a CPM 
containing the LDM. In the submit button... public void onSubmit()
{
   Session session = WicketApp.sessionFactory.openSession();
   session.beginTransaction();
   session.update(ldm.getObject());
   session.getTransaction().commit();
   session.close();   this.setResponsePage(EndPage.class);
} The sessionFactory is a static member of the WicketApp application 
class, initialized in the init() method. This seems to work, but I suppose 
there are all kinds of faulty design patterns used here. My main concern 
is... how can I do this without opening a new Hibernate session in 
onSubmit()? During postback, I think I should be able to reuse the same 
session opened at ldm.load() in onSubmit() also, as it all occurs in the 
same request. Is this possible? Thanks for your assistance. Please feel 
free to point out every flaw.  


**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**


Re: Persistence.

2012-05-08 Thread James Carman
You should take a look at some of the RAD tools for persistence with
Wicket.  I wrote a library called Wicketopia that can probably help
you get started.

On Tue, May 8, 2012 at 4:35 PM, JASON HOLT j_holt5...@msn.com wrote:




 I'll repeat my plea for patience as I'm new to Java and Wicket, but have some 
 minimal experience with ASP.net forms (not MVC). I've reached that point in 
 the learning process where I want to interact with a database and I wish to 
 use entities and Hibernate to make it easier. From what I've seen in various 
 blogs and forums, some say you shouldn't use entities as models, yet others 
 do it with LDMs. Since I'm taking baby steps, I want to start by using 
 entities as models, unless someone convinces me I'm wasting my time. 
 Following the basic Hibernate tutorials for persisting simple classes, I've 
 managed to make the following work in Wicket. In the LDM load... @Override
 public Person load()
 {
   Session session =  WicketApp.sessionFactory.openSession();
   session.beginTransaction();
   Person person = (Person) session.get(Person.class, 1L);
   session.getTransaction().commit();
   session.close();
   return person;
 } In the form I update the evil entity model with text boxes, using a CPM 
 containing the LDM. In the submit button... public void onSubmit()
 {
   Session session = WicketApp.sessionFactory.openSession();
   session.beginTransaction();
   session.update(ldm.getObject());
   session.getTransaction().commit();
   session.close();   this.setResponsePage(EndPage.class);
 } The sessionFactory is a static member of the WicketApp application class, 
 initialized in the init() method. This seems to work, but I suppose there are 
 all kinds of faulty design patterns used here. My main concern is... how can 
 I do this without opening a new Hibernate session in onSubmit()? During 
 postback, I think I should be able to reuse the same session opened at 
 ldm.load() in onSubmit() also, as it all occurs in the same request. Is this 
 possible? Thanks for your assistance. Please feel free to point out every 
 flaw.

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