Re: Question regarding old post (ResultSet and DataTable)

2007-08-23 Thread Ayodeji Aladejebi
create table mybean (id int primary key, name varchar, age int) bla bla
bla

//make a model
class MyBean implements Serializable {
 private String name;
 private int age;
}

//create your idataprovider

private class ResultSetDataProvider implements IDataProvider
{
private Connection c;

public ResultSetDataProvider (Connection _c){
c = _c;
}
public Iterator iterator(int start, int count) {
String query = SELECT name, age FROM mybean LIMIT  + start + , +  count;
PrepareStatement pq = c.createStatement(query );
ResultSet set = pq.executeQuery();
//make a list to carry your records via the bean to your datatable
ListMyBean  dataList = new LinkedListMyBean();
while(set.next()){
//create your bean for each record, hopefully JDBC 4 should soon be here
MyBean bean = new MyBean();
bean.setName(set.getString(name));
bean.setAge(set.getInt(age));
dataList.add(bean);
}
return dataList.iterator();
}
public int size() {
String countQ = SELECT COUNT(ID) FROM TABLE;
PrepareStatement pq = c.createStatement(countQ);
ResultSet set = pq.executeQuery();
if(set.next())
return set.getInt(1);
else
return 0;
}
public IModel model(Object arg0) {
return new Model((MyBean)arg);
}
}

//i would not know if there is some other more efficient manner but this is
as simple enough
// and it works with DataView, Paging, DataTable

this should not be too hard, is it? or you need something else

On 8/23/07, dtoffe [EMAIL PROTECTED] wrote:


 Uhh, well... yes, you are right.

 Excuse me but I fail to see how that could help to solve the problem I
 presented, please keep in mind that I'm not native english speaker and
 perhaps I'm not using the proper words, I'll try to explain that more
 precisely.

 As I said in my previous post, I do my database queries in this way:

 ResultSet rs = cs.executeQuery();

 In fact, later I'll use a code generator to ease the task, but let's
 assume for simplicity that I get the result in a java.sql.ResultSet. But,
 as
 stated in the Wicket Extension Javadoc, I must create the DataTable
 instances in this way:

 DataTable table = new DataTable(datatable, columns, new
 UserProvider(), 10);

 Specifically, the third parameter must implement
 wicket.markup.repeater.data.IDataProvider; which ResultSet doesn't
 implement, so I must provide for a means to overcome this.

 I didn't intended to mean that ResultSets are more generic that
 DataProviders. When I talked about a general way of handling ResultSet I
 tried to mean independently of whether I'm querying a Database Table,
 Stored
 Porcedure, with read-only or read-write cursors, uni or bi-directional,
 and
 so. I'm concerned about how well this will go in regard of sortable and
 pageable tables.

 Perhaps there is a mean to do all that already in the Wicket library,
 but I havent found it yet. In the examples I've seen so far the database
 is represented by some kind of static list, like in the ContactsDatabase
 and
 ContactGenerator classes in the DataTable example, but I'm looking for a
 way
 of using data from queries to a database engine.

 The way I see it, I'll have to develop a class which could perhaps
 extends ResultSet, or one of the RowSet implementations, and implements
 the
 IDataProvider interface, am I right on this one ??

 Thanks for your help !!

 Daniel



 igor.vaynberg wrote:
 
  actually idataprovider is more generic then resultset :)
 
  -igor
 
 
  On 8/22/07, dtoffe [EMAIL PROTECTED] wrote:
 
  Hi !!
 
  I've found this old thread:
 
 
 http://www.nabble.com/RE%3A-DataView-%28extensions%29-tf1287013.html#a3423281
 
  If there are new or better ways to do this that came up after this
  thread, I'm also interested in knowing. Having a way of easily handling
  the database resultset and a list of the resultset headers (column
  titles) would be great, the more generic, the better.
 
  Thanks !!
 
  Daniel
 
 

 --
 View this message in context:
 http://www.nabble.com/Question-regarding-old-post-%28ResultSet-and-DataTable%29-tf4314874.html#a12287761
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Question regarding old post (ResultSet and DataTable)

2007-08-23 Thread Igor Vaynberg
perhaps you can email frank and ask him, it is unfortunate he did not post
his code on a wiki page somewhere.

http://www.nabble.com/displaying-java.sql.Timestamp-tf1333211.html#a3561689

-igor


On 8/22/07, dtoffe [EMAIL PROTECTED] wrote:


 Uhh, well... yes, you are right.

 Excuse me but I fail to see how that could help to solve the problem I
 presented, please keep in mind that I'm not native english speaker and
 perhaps I'm not using the proper words, I'll try to explain that more
 precisely.

 As I said in my previous post, I do my database queries in this way:

 ResultSet rs = cs.executeQuery();

 In fact, later I'll use a code generator to ease the task, but let's
 assume for simplicity that I get the result in a java.sql.ResultSet. But,
 as
 stated in the Wicket Extension Javadoc, I must create the DataTable
 instances in this way:

 DataTable table = new DataTable(datatable, columns, new
 UserProvider(), 10);

 Specifically, the third parameter must implement
 wicket.markup.repeater.data.IDataProvider; which ResultSet doesn't
 implement, so I must provide for a means to overcome this.

 I didn't intended to mean that ResultSets are more generic that
 DataProviders. When I talked about a general way of handling ResultSet I
 tried to mean independently of whether I'm querying a Database Table,
 Stored
 Porcedure, with read-only or read-write cursors, uni or bi-directional,
 and
 so. I'm concerned about how well this will go in regard of sortable and
 pageable tables.

 Perhaps there is a mean to do all that already in the Wicket library,
 but I havent found it yet. In the examples I've seen so far the database
 is represented by some kind of static list, like in the ContactsDatabase
 and
 ContactGenerator classes in the DataTable example, but I'm looking for a
 way
 of using data from queries to a database engine.

 The way I see it, I'll have to develop a class which could perhaps
 extends ResultSet, or one of the RowSet implementations, and implements
 the
 IDataProvider interface, am I right on this one ??

 Thanks for your help !!

 Daniel



 igor.vaynberg wrote:
 
  actually idataprovider is more generic then resultset :)
 
  -igor
 
 
  On 8/22/07, dtoffe [EMAIL PROTECTED] wrote:
 
  Hi !!
 
  I've found this old thread:
 
 
 http://www.nabble.com/RE%3A-DataView-%28extensions%29-tf1287013.html#a3423281
 
  If there are new or better ways to do this that came up after this
  thread, I'm also interested in knowing. Having a way of easily handling
  the database resultset and a list of the resultset headers (column
  titles) would be great, the more generic, the better.
 
  Thanks !!
 
  Daniel
 
 

 --
 View this message in context:
 http://www.nabble.com/Question-regarding-old-post-%28ResultSet-and-DataTable%29-tf4314874.html#a12287761
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




{wicket 1.3 beta 2} AjaxFormComponentUpdatingBehavior broken?

2007-08-23 Thread Nino Saturnino Martinez Vazquez Wael

Hi

I have a page where theres two dropdownchoices and two panels 
acordingly. when you click dropdown a and select a new item panel a 
should be updated to the new item, I've used 
ajaxformComponentupdatingbehavior( have also tried 
ajaxformsubmittingbehavior).


However it seems as the model of the dropdown are never updated, im 
using compoundpropertymodel (have also tried reverting and just using a 
simple model).


I just cant figure out whats wrong. Please take a look any hints will be 
appreciated


http://papernapkin.org/pastebin/view/1386



Havent had the chance yet to tryout beta 3, not sure if its gone there.

regards Nino

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: wicket vs tapestry ?

2007-08-23 Thread Eelco Hillenius
 But since I'm currently learning, I can't help wondering at each step
 where the data gets stored magically. Likely that will go away once I
 know my way around Wicket. It's also not a complaint, just part of
 getting to know the best way of doing things.

I think it's a very good idea you have that in the back of your mind
all the time. I hope it doesn't spoil the experience too much, and
that you find Wicket's memory tradeoff acceptable.

Cheers,

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DownloadLink hanging

2007-08-23 Thread Thomas Singer

inside shared
resource you can simply call Session.get() to get to wicket session.


Unfortunately, it looks like this is not possible, because I'm getting 
following exception:



java.lang.IllegalStateException: you can only locate or create sessions in the 
context of a request cycle
org.apache.wicket.Session.findOrCreate(Session.java:250)
org.apache.wicket.Session.get(Session.java:279)

com.syntevo.hpsmart.DownloadResource.getResourceStream(DownloadResource.java:18)

org.apache.wicket.protocol.http.WicketFilter.getLastModified(WicketFilter.java:708)

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


Our resource code looks like this:


final class DownloadResource extends Resource {

  public IResourceStream getResourceStream() {
final OurSession session = (OurSession)Session.get();
if (session == null) {
  return null;
}

final File file = session.getFileToDownload();
if (file == null) {
  return null;
}

return new MyFileResourceStream(file);
  }


--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

you can register a shared resource and build a url for it. inside shared
resource you can simply call Session.get() to get to wicket session.

see application.getsharedresources();

alternatively you can extend WicketSessionFilter which will also allow you
to perform Session.get()


-igor


On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

Disclaimer: I'm not experienced with filters or wicket resources.

Is it possible to create a (shared) wicket resource which can be
filtered,
so it only is accessible when the right flag is set in OurWebSession?

Or would you suggest to write an own javax.servlet.Filter which does this
flag-check and redirects internally to a hidden location which then is
send
to the client by Tomcat when the right flag is set?

Thanks in advance.

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

Hi Igor,


yep, DownloadLinks will block because requests to the same page are
serialized.

Sorry, I don't understand, why links to downloadable resources should

be

blocking or serialized. Usually downloads are the larger parts of an
application and hence should never lock the application.


because this is how this component is designed to work. if you dont like

it

you can build your own that doesnt block.


to work around it register a shared resource or create a servlet that

can

stream the file (resoureces in wicket are not serialized), then create

a

link component that can build a download url.

Well, I guess, we can't use a servlet, because wicket is registered to
/*, so it will get everything.


wicket is a filter, so even though it is mapped to /* it will let urls

that

are not wicket urls pass through. how do you think it lets you download
static images...
so if you map your wicket filter on /* and the servlet on /download and

yo

have no download mount in wicket the filter will let /download/*

requests

go to the servlet.

-igor


Could you please give some more hints

about shared resources? I've tried to search
http://cwiki.apache.org/WICKET/ without luck.

Alternatively, is it possible to complete shut off the serialization
(which seems to cause this and maybe even other blocking problems)?

--
Best regards
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany


Igor Vaynberg wrote:

yep, DownloadLinks will block because requests to the same page are
serialized.

to work around it register a shared resource or create a servlet that

can

stream the file (resoureces in wicket are not serialized), then create

a

link component that can build a download url.

-igor


On 8/20/07, Thomas Singer [EMAIL PROTECTED] wrote:

Hi,

We are using Wicket 1.3 beta 2 running in Tomcat and have a couple of
DownloadLinks on a page (created with 'new DownloadPage(parameters)')

for

larger files (a couple of MB). I open different tabs of the same page

in

Opera and click these download links, so the downloads should happen

in

parallel. Unfortunately, the web-application seems to hang until the
previous files were completely downloaded. Even normal pages do not

show

up.

This does not happen for other websites (so our internet connection
couldn't
be the reason) and not for the same project with
old-JSP-/Servlet-technology
at a different server running in the same version of Tomcat.

Is this a known problem? How to work around?

--
Best regards,
Thomas Singer
_
SyyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: wicket vs tapestry ?

2007-08-23 Thread Eelco Hillenius
  If you're interested, a contribution for the address book example with
  exPOJO/ JPOX would be more than welcome.

 Definitely, not a problem. When do you need it by?

Whenever you feel like it.

 Where can I find the spec for the address book app?

No spec, only code :)

https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicket-phonebook

It's phonebook, not addressbook btw. Sorry my wrong. :)

Cheers,

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket Acegi Integration.

2007-08-23 Thread Maurice Marrink
There is no reason why Acegi should not be able to integrate with
swarm as long as you just use it for authentication (like
wicket-auth-roles does). In fact i think that by following the
auth-roles tutorial and replacing the auth-roles components with there
swarm counterpart you should be getting things up and running. That
being said the swarm-acegi integration is untested, it is on my todo
list but lack of time, the rest of my todo list and a complete void in
knowledge about acegi have prevented me from doing it. If you would be
willing to test this i would be very thankful.

In the mean time if you have any questions about swarm, I'll be happy
to answer them.

Maurice

On 8/23/07, Vincenzo Vitale [EMAIL PROTECTED] wrote:
 Thanks Erik,

 yes I also have seen something about Wicket and Swarm integration
 (http://wicketstuff.org/confluence/display/STUFFWIKI/Getting+started+with+Swarm)
 but Acegi is at the moment the most known technology in my department
 so at the moment I will use it, also because interested in showing how
 Wicket is well integrated with all the most important (and known)
 frameworks out there.


 Grazie,
 V.

 On 8/22/07, Erik van Oosten [EMAIL PROTECTED] wrote:
  Hi Vincenzo,
 
  Someone mentioned the project Swarm on the mailing list some time ago
  (http://www.nabble.com/forum/ViewPost.jtp?post=10853436framed=y).
 
  Since I do not know Swarm I can not advice on which way to go.
 
  Regards,
  Erik.
 
 
  Vincenzo Vitale wrote:
   Hi,
  
   In my project we are using Wicket  and it definitively rocks!!! J
  
   Now I want to integrate  authentication and authorization… I have red
   the wiki page in
   http://cwiki.apache.org/WICKET/acegi-and-wicket-auth-roles.html  where
   the acegi-wicket integration is explained, but you also mention a new
   project currently in works… could you please give me more information
   about that  or do you suggest at the moment to use wicket-auth-role
   and acegi? I'm using  wicket 1.3.0-beta2 version.
  
   Thanks a  lot,
   Vincenzo.
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  --
  Erik van Oosten
  http://2008.rubyenrails.nl/
  http://www.day-to-day-stuff.blogspot.com/
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket Acegi Integration.

2007-08-23 Thread Vincenzo Vitale
Ok.

Thanks for the clarification... I will let you know how we'll proceed.


Ciao,
V.

On 8/23/07, Maurice Marrink [EMAIL PROTECTED] wrote:
 There is no reason why Acegi should not be able to integrate with
 swarm as long as you just use it for authentication (like
 wicket-auth-roles does). In fact i think that by following the
 auth-roles tutorial and replacing the auth-roles components with there
 swarm counterpart you should be getting things up and running. That
 being said the swarm-acegi integration is untested, it is on my todo
 list but lack of time, the rest of my todo list and a complete void in
 knowledge about acegi have prevented me from doing it. If you would be
 willing to test this i would be very thankful.

 In the mean time if you have any questions about swarm, I'll be happy
 to answer them.

 Maurice

 On 8/23/07, Vincenzo Vitale [EMAIL PROTECTED] wrote:
  Thanks Erik,
 
  yes I also have seen something about Wicket and Swarm integration
  (http://wicketstuff.org/confluence/display/STUFFWIKI/Getting+started+with+Swarm)
  but Acegi is at the moment the most known technology in my department
  so at the moment I will use it, also because interested in showing how
  Wicket is well integrated with all the most important (and known)
  frameworks out there.
 
 
  Grazie,
  V.
 
  On 8/22/07, Erik van Oosten [EMAIL PROTECTED] wrote:
   Hi Vincenzo,
  
   Someone mentioned the project Swarm on the mailing list some time ago
   (http://www.nabble.com/forum/ViewPost.jtp?post=10853436framed=y).
  
   Since I do not know Swarm I can not advice on which way to go.
  
   Regards,
   Erik.
  
  
   Vincenzo Vitale wrote:
Hi,
   
In my project we are using Wicket  and it definitively rocks!!! J
   
Now I want to integrate  authentication and authorization… I have red
the wiki page in
http://cwiki.apache.org/WICKET/acegi-and-wicket-auth-roles.html  where
the acegi-wicket integration is explained, but you also mention a new
project currently in works… could you please give me more information
about that  or do you suggest at the moment to use wicket-auth-role
and acegi? I'm using  wicket 1.3.0-beta2 version.
   
Thanks a  lot,
Vincenzo.
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
   --
   Erik van Oosten
   http://2008.rubyenrails.nl/
   http://www.day-to-day-stuff.blogspot.com/
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: {wicket 1.3 beta 2} AjaxFormComponentUpdatingBehavior broken?

2007-08-23 Thread Oleg Taranenko
Hello Nino,

It seems to be the same issue as i've encountered a week ago.

see thread Order-Items master detail page started at 16 august


Possible Solution in you case:

declare anywhere posible in page
private Phone selectedItem;

in function
protected void onUpdate(AjaxRequestTarget target) {
...
   selectedItem = (Phone) phoneA.getObject();
...
}

And than everythingService.findAllStandardFeatures() (or other function) shoud 
get access to the
 field selectedItem.
Possible you need to create your own new IDataProvider.


Cheers,

Oleg.


am 23 August 2007 um 09:08 schrieben Sie:

 Hi

 I have a page where theres two dropdownchoices and two panels 
 acordingly. when you click dropdown a and select a new item panel a 
 should be updated to the new item, I've used 
 ajaxformComponentupdatingbehavior( have also tried 
 ajaxformsubmittingbehavior).

 However it seems as the model of the dropdown are never updated, im 
 using compoundpropertymodel (have also tried reverting and just using a
 simple model).

 I just cant figure out whats wrong. Please take a look any hints will be
 appreciated

 http://papernapkin.org/pastebin/view/1386



 Havent had the chance yet to tryout beta 3, not sure if its gone there.

 regards Nino

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-- 
Mit freundlichen Grüßen
Oleg Taranenko
mailto:[EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: {wicket 1.3 beta 2} AjaxFormComponentUpdatingBehavior broken?

2007-08-23 Thread Nino Saturnino Martinez Vazquez Wael
Hmm, im not using the dataview or iDataprovider, although I have a 
listview in one of the singlephonecomparepanels. However it seems as 
theres something about these two issues that match.


But the wierd thing are that it never ever picks up the change in the 
dropdownchoice. I'll try going back and doing this without ajax and see 
if that works any better.


I've tried your suggestion about declaring phone as a private on the 
page it did not fix the problem..


Wierd stuff are that I used the same approach in wicket 1.2.6 and it was 
working there(although not with the same combination of models)..


regards Nino

Oleg Taranenko wrote:

Hello Nino,

It seems to be the same issue as i've encountered a week ago.

see thread Order-Items master detail page started at 16 august


Possible Solution in you case:

declare anywhere posible in page
private Phone selectedItem;

in function
protected void onUpdate(AjaxRequestTarget target) {
...
   selectedItem = (Phone) phoneA.getObject();
...
}

And than everythingService.findAllStandardFeatures() (or other function) shoud 
get access to the
 field selectedItem.
Possible you need to create your own new IDataProvider.


Cheers,

Oleg.


am 23 August 2007 um 09:08 schrieben Sie:

  

Hi



  
I have a page where theres two dropdownchoices and two panels 
acordingly. when you click dropdown a and select a new item panel a 
should be updated to the new item, I've used 
ajaxformComponentupdatingbehavior( have also tried 
ajaxformsubmittingbehavior).



  
However it seems as the model of the dropdown are never updated, im 
using compoundpropertymodel (have also tried reverting and just using a

simple model).



  

I just cant figure out whats wrong. Please take a look any hints will be
appreciated



  

http://papernapkin.org/pastebin/view/1386





  

Havent had the chance yet to tryout beta 3, not sure if its gone there.



  

regards Nino



  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: {wicket 1.3 beta 2} AjaxFormComponentUpdatingBehavior broken?

2007-08-23 Thread Nino Saturnino Martinez Vazquez Wael

Thats wierd.

I've now changed it to not use ajax and are using 
wantonselectionchangednotifications..


This yields the same result, not working. This is really wierd cant 
belive that it should not work, some of the processing must be broken by 
some of the other components I add, are there any way to get some more 
describtive informations from wicket?



http://papernapkin.org/pastebin/view/1389


Nino Saturnino Martinez Vazquez Wael wrote:
Hmm, im not using the dataview or iDataprovider, although I have a 
listview in one of the singlephonecomparepanels. However it seems as 
theres something about these two issues that match.


But the wierd thing are that it never ever picks up the change in the 
dropdownchoice. I'll try going back and doing this without ajax and 
see if that works any better.


I've tried your suggestion about declaring phone as a private on the 
page it did not fix the problem..


Wierd stuff are that I used the same approach in wicket 1.2.6 and it 
was working there(although not with the same combination of models)..


regards Nino

Oleg Taranenko wrote:

Hello Nino,

It seems to be the same issue as i've encountered a week ago.

see thread Order-Items master detail page started at 16 august


Possible Solution in you case:

declare anywhere posible in page
private Phone selectedItem;

in function
protected void onUpdate(AjaxRequestTarget target) {
...
   selectedItem = (Phone) phoneA.getObject();
...
}

And than everythingService.findAllStandardFeatures() (or other 
function) shoud get access to the

 field selectedItem.
Possible you need to create your own new IDataProvider.


Cheers,

Oleg.


am 23 August 2007 um 09:08 schrieben Sie:

 

Hi



 
I have a page where theres two dropdownchoices and two panels 
acordingly. when you click dropdown a and select a new item panel a 
should be updated to the new item, I've used 
ajaxformComponentupdatingbehavior( have also tried 
ajaxformsubmittingbehavior).



 
However it seems as the model of the dropdown are never updated, im 
using compoundpropertymodel (have also tried reverting and just using a

simple model).



 
I just cant figure out whats wrong. Please take a look any hints 
will be

appreciated



 

http://papernapkin.org/pastebin/view/1386





 

Havent had the chance yet to tryout beta 3, not sure if its gone there.



 

regards Nino



 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: {wicket 1.3 beta 2} AjaxFormComponentUpdatingBehavior broken?

2007-08-23 Thread Nino Saturnino Martinez Vazquez Wael
Ok, i've removed all other stuff from the page, error are still there, 
wierd thing is that the dropdowns are working on the other pages.


I guess next step are to create a quickstart and see if it works there..

Should I try with beta 3 or?

regards Nino

Nino Saturnino Martinez Vazquez Wael wrote:

Thats wierd.

I've now changed it to not use ajax and are using 
wantonselectionchangednotifications..


This yields the same result, not working. This is really wierd cant 
belive that it should not work, some of the processing must be broken 
by some of the other components I add, are there any way to get some 
more describtive informations from wicket?



http://papernapkin.org/pastebin/view/1389


Nino Saturnino Martinez Vazquez Wael wrote:
Hmm, im not using the dataview or iDataprovider, although I have a 
listview in one of the singlephonecomparepanels. However it seems as 
theres something about these two issues that match.


But the wierd thing are that it never ever picks up the change in the 
dropdownchoice. I'll try going back and doing this without ajax and 
see if that works any better.


I've tried your suggestion about declaring phone as a private on the 
page it did not fix the problem..


Wierd stuff are that I used the same approach in wicket 1.2.6 and it 
was working there(although not with the same combination of models)..


regards Nino

Oleg Taranenko wrote:

Hello Nino,

It seems to be the same issue as i've encountered a week ago.

see thread Order-Items master detail page started at 16 august


Possible Solution in you case:

declare anywhere posible in page
private Phone selectedItem;

in function
protected void onUpdate(AjaxRequestTarget target) {
...
   selectedItem = (Phone) phoneA.getObject();
...
}

And than everythingService.findAllStandardFeatures() (or other 
function) shoud get access to the

 field selectedItem.
Possible you need to create your own new IDataProvider.


Cheers,

Oleg.


am 23 August 2007 um 09:08 schrieben Sie:

 

Hi



 
I have a page where theres two dropdownchoices and two panels 
acordingly. when you click dropdown a and select a new item panel a 
should be updated to the new item, I've used 
ajaxformComponentupdatingbehavior( have also tried 
ajaxformsubmittingbehavior).



 
However it seems as the model of the dropdown are never updated, im 
using compoundpropertymodel (have also tried reverting and just 
using a

simple model).



 
I just cant figure out whats wrong. Please take a look any hints 
will be

appreciated



 

http://papernapkin.org/pastebin/view/1386





 
Havent had the chance yet to tryout beta 3, not sure if its gone 
there.



 

regards Nino



 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



PageStore listener...

2007-08-23 Thread Jan Kriesten

Hi,

is there a way to add a listener to PageStore events (storePage/getPage)?

I'm still looking for a clean way to re-inject Pages/Components when they are
deserialized. This way I could just set some fields transient and have them
injected again if necessary.

I gave IComponentOnBeforeRenderListener a look as a hook to do this, but that is
called _after_ Components onBeforeRender(), so it's not usable for that.

Regards, --- Jan.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: PageStore listener...

2007-08-23 Thread Matej Knopp
Why can't you just implement read/writeObject on your page/component?

-Matej

On 8/23/07, Jan Kriesten [EMAIL PROTECTED] wrote:

 Hi,

 is there a way to add a listener to PageStore events (storePage/getPage)?

 I'm still looking for a clean way to re-inject Pages/Components when they are
 deserialized. This way I could just set some fields transient and have them
 injected again if necessary.

 I gave IComponentOnBeforeRenderListener a look as a hook to do this, but that 
 is
 called _after_ Components onBeforeRender(), so it's not usable for that.

 Regards, --- Jan.



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: PageStore listener...

2007-08-23 Thread Johan Compagner
Or make the fields itself not transient, but a proxy that has a transient
field
and the proxy can deserialize and inject itself again (see wicket-ioc
project)

johan


On 8/23/07, Matej Knopp [EMAIL PROTECTED] wrote:

 Why can't you just implement read/writeObject on your page/component?

 -Matej

 On 8/23/07, Jan Kriesten [EMAIL PROTECTED] wrote:
 
  Hi,
 
  is there a way to add a listener to PageStore events
 (storePage/getPage)?
 
  I'm still looking for a clean way to re-inject Pages/Components when
 they are
  deserialized. This way I could just set some fields transient and have
 them
  injected again if necessary.
 
  I gave IComponentOnBeforeRenderListener a look as a hook to do this, but
 that is
  called _after_ Components onBeforeRender(), so it's not usable for that.
 
  Regards, --- Jan.
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




RE: wicket vs tapestry ? (Back Button Detection-Support)

2007-08-23 Thread William Hoover
Possible starting point for a client solution for back button detection/support:

http://www.onjava.com/pub/a/onjava/2005/10/26/ajax-handling-bookmarks-and-back-button.html?page=1

-Original Message-
From: Matej Knopp [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 22, 2007 6:30 PM
To: users@wicket.apache.org
Subject: Re: wicket vs tapestry ?


Hi,

 2) I like the back button support.  My thinking is that extending Wicket's
 AJAX integration to also support the back button (somehow) is a must.
 Virtually everyone who uses Wicket will use it's AJAX functionality.  Almost
 all of these will need solve this problem.  Sure would be nice if it was
 included.
There are plans to do this. However, it's a complicate problem that a
simple solution won't cut. We have a server side part in place though.
It's the javascript that needs to be extended, but our resources are
too limited currently to do that.
 3) The design-by-inheritance model (WebPage, AbstractBehavior, etc). has
 produced a somewhat fragmented library.  Reminds me of the days of MFC.
 T5's approach in this respect seems quite attractive.
Would you mind elaborating on this a little? I kind of fail to see
what's wrong with inheritance and why are people avoiding it like a
plague nowadays.
Is it really that much better to have your code annotated and called
by reflection/bytecode generation? How discoverable such API is? How
can you navigate such code? (forget call hierarchy).

As a sidenote, I remember Igor building @OnBeforeRender like
annotations, but he wasn't very happy with it and neither was I.

-Matej

 Thanks for listening,
 Erik

 On 8/22/07, Konstantin Ignatyev [EMAIL PROTECTED] wrote:
 
  My story:
 
  I have been very satisfied Tapestry 3 used and T3 has
  helped tremendously with building applications in the
  past.
 
  Then I was busy doing other things although keeping
  eye on T and recently I needed to build a live
  prototype quickly, naturally my first reaction was to
  pick up Dreamweaver and try Tapestry 5.
 
  T5 is amazingly good BUT I needed Ajax support and at
  this moment Wicket makes leaps and bounds around T5 in
  this area.
 
  So I abandoned T5 and started using Wicket - so far I
  am very satisfied with it although worry if Wicket is
  production grade for high traffic sites because of its
  heavy use of HttpSession as storage.
 
  So for now I will use Wicket for prototyping and small
  apps and keep my eye on T5. T4 is no-go for me - I am
  too lazy
 
  --- Chris Chiappone [EMAIL PROTECTED]  wrote:
 
   A colleague of mine and I had a discussion about
   this because he was
   sorting through new frameworks to use for a new
   project.  I have been
   using Tapestry since v3 and wanted him to give it a
   try.  Unfotunately
   he ended up picking Wicket because of the fear that
   Tapestry has
   issues with backward compatibility.  I am now
   wondering if I made the
   right choice in choosing tapestry for my
   applications.   He built his
   application quickly and it is impressive using
   Wickets built in AJAX
   components.  Upgrading in Tapestry has been a pain
   going from 3 - 4
   and obviously 5 isn't even possible.  I wish I could
   have choose tap 5
   for my latest project but it was too beta and
   doesn't play well with
   other frameworks, ie a large legacy app with a
   Struts like framework.
  
   Anyway its a hard decision, they both have plus' and
   minus'
  
   ~chris
  
   On 8/22/07, John [EMAIL PROTECTED] wrote:
Hi Alex,
   
   
   
I would say Tapestry 5 wins the challenge unless
   you plane to use T4.
   
Tapestry 5 uses annotations, and this is a very
   important advanced feature
in Java. You don't need to extend WOComponent,
   WebPage or what ever.
   
   
   
I think all frameworks will use the annotations in
   the future; the question
is when is available.
   
T5 does and it's ready.
   
   
   
In other words, the real question you should ask
   Do I want to use
annotations or classical framework?
   
   
   
Try T5 a little, and you will fast mention the
   power of annotations.
   
   
   
   
   
Signature IT-Consult Armainak Sarkis
   
   
   
- Original Message -
From: Alex Shneyderman [EMAIL PROTECTED]
To:  [EMAIL PROTECTED];
   users@wicket.apache.org
Sent: Wednesday, August 22, 2007 10:13 AM
Subject: wicket vs tapestry ?
   
   
I just started to look for a component based
   framework. I came across
 both tapestry and wicket (and it would be hard
   not to as you guys
 share the same host) but I kind of fail to see
   what the differences
 are?

 From my limited experiments with both, wicket
   and tapestry seem to be
 quite similar. So, I wonder if there is anything
   I am not seeing?
 Anyone has a comparisson map of wicket vs
   tapestry?

 Alex.

 PS: I like both frameworks for their lightness I
   just feel that I will
 need to stick 

Re: PageStore listener...

2007-08-23 Thread Jan Kriesten

hi matej, hi johan,

 Why can't you just implement read/writeObject on your page/component?

that would be an effort... here a listview, there a link and over there another
image...

that way i loose all the benefits of using injection - i build new logic in the
components which i just wanted to get rid of.

 Or make the fields itself not transient, but a proxy that has a transient
 field and the proxy can deserialize and inject itself again (see wicket-ioc
 project)

possible, but that reminds me on the 'XYService.getInstance()' usage in the
times before IoC. it adds another indirection which makes should-be-easy things
more complex. instead of being able to just inject the right class instances, i
have to use proxies (so being on the save side when changing
classes/implementations break serialization).

there's the onComponentInstantiationListener() - easy to use and powerful. if
there would be some listener being called before any other component logic is
being performed that would be great. it would be enough to call this once during
a request-cycle to minimize the overhead.

btw, why is the OnBeforeRenderListener called after and not before
OnBeforeRender() of the component?

regards, --- jan.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Layout Panel

2007-08-23 Thread Paolo Di Tommaso
Umh .. I think the best things are simple ..

Why don't just handle the components position using html or css in your
panel?


Bye, Paolo



On 8/23/07, andrea pantaleoni [EMAIL PROTECTED] wrote:


 Hi,
 I have a little problem with Panel
 In a table I added a Panel
 Now in this Panel I want to add two different components, let's say, a
 dropdownchoice up and a textfield down.
 If I remember well, in swing it could be possible to add a layout to a
 panel
 and then for example add a component in north or in the south.
 Is there in wicket something similar?
 If I want to add the dropdownchoice component in the north of the panel
 and
 the textfield in the south is that possible
 Thanks for any help
 Andrea
 --
 View this message in context:
 http://www.nabble.com/Layout-Panel-tf4317423.html#a12293248
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Layout Panel

2007-08-23 Thread Ernesto Reinaldo Barreiro

What about

html xmlns=http://www.w3.org/1999/xhtml;
xmlns:wicket=http://wicket.sourceforge.net/;
wicket:panel
table cellpadding=2 cellspacing=2
   tr
   td
   bMyDropDown:/b
   /td
   td
   select wicket:id=MyDropDown/select
   /td
   /tr
   tr
   td
   bMyTextField:/b
   /td
   td
   input wicket:id=MyTextField/
   /td
   /tr   
/table

/wicket:panel
/html

On wicket you have the flexibility to design yourself the markup (as in 
plain old HTML...)


Ernesto

andrea pantaleoni wrote:
Hi, 
I have a little problem with Panel
In a table I added a Panel 
Now in this Panel I want to add two different components, let's say, a

dropdownchoice up and a textfield down.
If I remember well, in swing it could be possible to add a layout to a panel
and then for example add a component in north or in the south.
Is there in wicket something similar?
If I want to add the dropdownchoice component in the north of the panel and
the textfield in the south is that possible
Thanks for any help
Andrea  
  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: No get method defined for expression recorder when using Palette and CompoundPropertyModel

2007-08-23 Thread Federico Fanton
On Fri, 6 Jul 2007 08:48:56 -0700
Igor Vaynberg [EMAIL PROTECTED] wrote:

  Thanks for the tip but I absolutly need a compoundPropertyModel.
 
 https://issues.apache.org/jira/browse/WICKET-723

I had the same issue, thanks! Now I'm using beta3..
Another question though: I see that Recorder.initIds() assumes that 
getPalette().getModelCollection() is never null.. Is this by design? Should I 
check my backing bean for null collections before passing it to the 
CompoundPropertyModel?
(Or maybe I could override 
CompoundPropertyModel.AttachedCompoundPropertyModel.getObject() so that it 
creates the empty collection when needed.. X-) )

Many thanks in advance!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Layout Panel

2007-08-23 Thread Paolo Di Tommaso
I'm still thinking that's a pure html problem, Try with a table like this:

table height=100%
tr
td valign=top wicketcomponentup /td
td valign=bottom wicketcomponentdown /td
/tr
/table

Paolo



On 8/23/07, andrea pantaleoni [EMAIL PROTECTED] wrote:


 the reason is that I need to consider the panel as a single component
 which
 is used inside a listview
 Anyway you could be right I saw that in wicket you can create a html
 markup
 for each single component naming the file in this way:
 pagename$componentname.html

 So maybe I can add the  drodownchoice and textfield to the panel component
 and fix the layout in the  html file pagename$panelname.html

 table
 tr
 tdwicketcomponentup
 td
 tdwicketcomponentdown
 td
 /tr
 /table
 What do you think about? could that work?

 Thanks Paolo




 paolo di tommaso wrote:
 
  Umh .. I think the best things are simple ..
 
  Why don't just handle the components position using html or css in your
  panel?
 
 
  Bye, Paolo
 
 
 
  On 8/23/07, andrea pantaleoni [EMAIL PROTECTED] wrote:
 
 
  Hi,
  I have a little problem with Panel
  In a table I added a Panel
  Now in this Panel I want to add two different components, let's say, a
  dropdownchoice up and a textfield down.
  If I remember well, in swing it could be possible to add a layout to a
  panel
  and then for example add a component in north or in the south.
  Is there in wicket something similar?
  If I want to add the dropdownchoice component in the north of the panel
  and
  the textfield in the south is that possible
  Thanks for any help
  Andrea
  --
  View this message in context:
  http://www.nabble.com/Layout-Panel-tf4317423.html#a12293248
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Layout-Panel-tf4317423.html#a12293520
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Constructor of Component not DRY?

2007-08-23 Thread Martin Funk

Hi,

doing a little code reading and trying to understand what I read, I came 
across org.apache.wicket.Component 's constructors.
To my eyes the two constructors look very much alike and I wonder why 
they were not chained like this:


   public Component(final String id)
   {
   this(id, null);
   }

Which chapter in the Java schoolbook should I reread?

Martin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Constructor of Component not DRY?

2007-08-23 Thread Johan Compagner
i think that is grown this way, previously the model constructor did some
more i believe
Also i don't like this(id,null) because thats just horrible, If you call the
constructor with the model then the model shouldn't be null.

a nicer way could be

 public Component(final String id, IModel model)
{
this(id);
this.model = wrapModel(model);
}

johan



On 8/23/07, Martin Funk [EMAIL PROTECTED] wrote:

 Hi,

 doing a little code reading and trying to understand what I read, I came
 across org.apache.wicket.Component 's constructors.
 To my eyes the two constructors look very much alike and I wonder why
 they were not chained like this:

 public Component(final String id)
 {
 this(id, null);
 }

 Which chapter in the Java schoolbook should I reread?

 Martin

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Question regarding old post (ResultSet and DataTable)

2007-08-23 Thread dtoffe

Hi !!!

Thanks for your reply, this solution is simple, easy to understand and
is not hard to code at all. My only objection would be the MyBean class, if
I understood it right, the DataProvider is tied to the bean in a way that
makes it not reusable:

String query = SELECT name, age FROM mybean LIMIT  + start + , + 
count;

bean.setName(set.getString(name));
bean.setAge(set.getInt(age));

What I mean is, what happens if I want to query another table, do I have
to change the ResultSetDataProvider implementation, or provide another
implementation for each table ??

I'm not sure if is it even possible to do what I want, surely it would
be more complex and hard to do, but if it saves from creating custom code
for each query, I guess it would justify the extra work.

In most web usages, this implementation is ok because you don't have
that much database queries, but at my work we have been asked to port a
desktop application to a web implementation, and it uses lots of queries
with flexible filtering criteria, for example (Visual Basic pseudocode):

recordset1 = ExecuteQuery(SELECT a, b, c FROM table1);
datagrid1.setColumns(a, b, c);
datagrid1.setRecordSet(recordset1);
datagrid1.refresh();

Perhaps this simplified Visual Basic example shows what I'm trying to
do, as you can see, I don't have to cast the recordset to any specific bean
type, it's just a bunch of cells. That's why I'm looking for that kind of
more abstract approach.

Thanks for your help !!!

Daniel


Ayodeji Aladejebi wrote:
 
 create table mybean (id int primary key, name varchar, age int) bla bla
 bla
 
 //make a model
 class MyBean implements Serializable {
  private String name;
  private int age;
 }
 
 //create your idataprovider
 
 -
 
 //i would not know if there is some other more efficient manner but this
 is
 as simple enough
 // and it works with DataView, Paging, DataTable
 
 this should not be too hard, is it? or you need something else
 
 On 8/23/07, dtoffe [EMAIL PROTECTED] wrote:


 Uhh, well... yes, you are right.

 Excuse me but I fail to see how that could help to solve the problem
 I
 presented, please keep in mind that I'm not native english speaker and
 perhaps I'm not using the proper words, I'll try to explain that more
 precisely.
 -
 

-- 
View this message in context: 
http://www.nabble.com/Question-regarding-old-post-%28ResultSet-and-DataTable%29-tf4314874.html#a12295661
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: POJO Adapter in Wicket

2007-08-23 Thread Igor Vaynberg
i would use the pojos directly and put the presentation stuff into the model

-igor


On 8/23/07, Vincenzo Vitale [EMAIL PROTECTED] wrote:

 Hi All,

 I'm using Wicket (1.3.0 beta2), Hibernate and Spring.

 In my Wicket project for each POJO of my business model I created an
 Adapter maintaining the original object and having methods for the
 presentation layer (like getCompleteName()); I have not created a
 delegate getter or setter for all the properties of the target so in
 my wicket java code I simply bind the target properties with a name I
 choose.
 For example:

 final ApiAccountAdapter account = (ApiAccountAdapter) model.getObject();
 BoundCompoundPropertyModel accountModel = new
 BoundCompoundPropertyModel(account);
 TextField contactNameField = new TextField(contactName);
 accountModel.bind(contactNameField, target.contactName);


 I use cascades with Hibernate to create/update my objects so the
 unique problems with the adapters approach is that I always want to
 use Adapters in the presentation projects and I always want to
 navigate my objects starting from the main object I'm using.

 So for example if I'm editing a parent object with a child list, in
 Wicket I need to create a ParentAdapter with a method like
 ListChildAdapter getChildsList(); returning the List of adapters and
 I need to manually construct this method. If a child has also
 relations with other objects (directly or worst into Collections) the
 problem became rapidly really complex.

 Have you some suggestion on how to face in a better way the problem?

 My main requirements are:

 - I don't want to modify the POJOs adding presentation getters.
 - I want to use the dot notation in Wicket to easily access what I
 need: directly the pojo properties or some adapter (or whatever) with
 more complex getters.
 - When I have an input field in a page, representing a simple property
 in the main object or in some child object (like a property of a
 specific element of the child list) I don't want to manually map this
 field with the property of the object I want to be persisted. This
 work fine using adapters and mapping always an input field with
 target.property or a list with target.getListAdapter and then mapping
 the input fields in the list also with target.property.

 Sorry if I'm confusing you... :-)


 Thanks,
 Vicio.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Component Factory and code against interface

2007-08-23 Thread Igor Vaynberg
not really sure what you mean when you say marking components as dirty...

have you seen ajaxfallback* components? those will use ajax when its there,
and fallback on regular requests when its not. so you dont even need a
factory necessarily.

-igor


On 8/23/07, Sam Hough [EMAIL PROTECTED] wrote:


 Thanks Igor,

 Because we have to support Ajax and non-Ajax version I was wondering about
 hiding details of making components Ajax friendly in the factory. so
 setOutputMarkupId(true) etc and hiding Ajax specific handlers where
 possible. Have you seen anybody automatically marking components as dirty
 so
 they can be sent back via Ajax (Echo like)? I think that would handle 90%
 of
 our Ajax like stuff.

 Cheers

 Sam
 --
 View this message in context:
 http://www.nabble.com/Component-Factory-and-code-against-interface-tf4311047.html#a12290179
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: PageStore listener...

2007-08-23 Thread Igor Vaynberg
On 8/23/07, Jan Kriesten [EMAIL PROTECTED] wrote:


 hi matej, hi johan,

  Why can't you just implement read/writeObject on your page/component?

 that would be an effort... here a listview, there a link and over there
 another
 image...

 that way i loose all the benefits of using injection - i build new logic
 in the
 components which i just wanted to get rid of.

  Or make the fields itself not transient, but a proxy that has a
 transient
  field and the proxy can deserialize and inject itself again (see
 wicket-ioc
  project)

 possible, but that reminds me on the 'XYService.getInstance()' usage in
 the
 times before IoC. it adds another indirection which makes should-be-easy
 things
 more complex. instead of being able to just inject the right class
 instances, i
 have to use proxies (so being on the save side when changing
 classes/implementations break serialization).


really, so this is too complicated?

public mypanel extends panel {
@SpringBean private Service service;

...
}

 -igor


regards, --- jan.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: No get method defined for expression recorder when using Palette and CompoundPropertyModel

2007-08-23 Thread Igor Vaynberg
i dont know if it is by design or not. it makes sense to me that you pass in
a model with at least an empty collection, otherwise palette has to create
an instance of some collection which isnt as clean.

-igor


On 8/23/07, Federico Fanton [EMAIL PROTECTED] wrote:

 On Fri, 6 Jul 2007 08:48:56 -0700
 Igor Vaynberg [EMAIL PROTECTED] wrote:

   Thanks for the tip but I absolutly need a compoundPropertyModel.
 
  https://issues.apache.org/jira/browse/WICKET-723

 I had the same issue, thanks! Now I'm using beta3..
 Another question though: I see that Recorder.initIds() assumes that
 getPalette().getModelCollection() is never null.. Is this by design? Should
 I check my backing bean for null collections before passing it to the
 CompoundPropertyModel?
 (Or maybe I could override
 CompoundPropertyModel.AttachedCompoundPropertyModel.getObject() so that it
 creates the empty collection when needed.. X-) )

 Many thanks in advance!


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Bypass form validation

2007-08-23 Thread Andrew Klochkov

Juan Gabriel Arias wrote:

Hi,
i have a form, that is submited by different AjaxSubmitLinks.

I want that only one (completely identified) of those links triggers a
validation.

I though two main solutions:
- Add validation only to specific components, not to the complete form. (i
think is the cleanest, but dunno if it si possible, because nature of forms
and HTML)
- Specify that, in some cases, validation should be ignored.

Any ideas? Igor? =P

  

Try using Button.setDefaultProcessing(false)

--
Andrew Klochkov


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Layout Panel

2007-08-23 Thread Igor Vaynberg
only pages/panels/borders have associated markup files by default.

-igor


On 8/23/07, andrea pantaleoni [EMAIL PROTECTED] wrote:


 the reason is that I need to consider the panel as a single component
 which
 is used inside a listview
 Anyway you could be right I saw that in wicket you can create a html
 markup
 for each single component naming the file in this way:
 pagename$componentname.html

 So maybe I can add the  drodownchoice and textfield to the panel component
 and fix the layout in the  html file pagename$panelname.html

 table
 tr
 tdwicketcomponentup
 td
 tdwicketcomponentdown
 td
 /tr
 /table
 What do you think about? could that work?

 Thanks Paolo




 paolo di tommaso wrote:
 
  Umh .. I think the best things are simple ..
 
  Why don't just handle the components position using html or css in your
  panel?
 
 
  Bye, Paolo
 
 
 
  On 8/23/07, andrea pantaleoni [EMAIL PROTECTED] wrote:
 
 
  Hi,
  I have a little problem with Panel
  In a table I added a Panel
  Now in this Panel I want to add two different components, let's say, a
  dropdownchoice up and a textfield down.
  If I remember well, in swing it could be possible to add a layout to a
  panel
  and then for example add a component in north or in the south.
  Is there in wicket something similar?
  If I want to add the dropdownchoice component in the north of the panel
  and
  the textfield in the south is that possible
  Thanks for any help
  Andrea
  --
  View this message in context:
  http://www.nabble.com/Layout-Panel-tf4317423.html#a12293248
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Layout-Panel-tf4317423.html#a12293520
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Component Factory and code against interface

2007-08-23 Thread Sam Hough

Say my onSubmit handler changes three components, as I understand it, I have
to hand code feeding those three components to the AjaxRequestTarget. This
seems cumbersome and slightly error prone. I think for our application, if
the components kept track of changes, I could automate which components are
sent back. Guess what I'm asking is if anything that already exists in
Wicket keeps track of component changes? Can't imagine it would be easy
otherwise without really heavy duty AOP etc...

Thanks again Igor.


igor.vaynberg wrote:
 
 not really sure what you mean when you say marking components as dirty...
 
 have you seen ajaxfallback* components? those will use ajax when its
 there,
 and fallback on regular requests when its not. so you dont even need a
 factory necessarily.
 
 -igor
 
 
 On 8/23/07, Sam Hough [EMAIL PROTECTED] wrote:


 Thanks Igor,

 Because we have to support Ajax and non-Ajax version I was wondering
 about
 hiding details of making components Ajax friendly in the factory. so
 setOutputMarkupId(true) etc and hiding Ajax specific handlers where
 possible. Have you seen anybody automatically marking components as dirty
 so
 they can be sent back via Ajax (Echo like)? I think that would handle 90%
 of
 our Ajax like stuff.

 Cheers

 Sam
 --
 View this message in context:
 http://www.nabble.com/Component-Factory-and-code-against-interface-tf4311047.html#a12290179
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 

-- 
View this message in context: 
http://www.nabble.com/Component-Factory-and-code-against-interface-tf4311047.html#a12296693
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DownloadLink hanging

2007-08-23 Thread Thomas Singer

Should I report a bug in JIRA?

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

hm, this looks like an old bug. johan didnt we fix this a while ago?

-igor


On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:

inside shared
resource you can simply call Session.get() to get to wicket session.

Unfortunately, it looks like this is not possible, because I'm getting
following exception:


java.lang.IllegalStateException: you can only locate or create sessions

in the context of a request cycle

  org.apache.wicket.Session.findOrCreate(Session.java:250)
  org.apache.wicket.Session.get(Session.java:279)
  com.syntevo.hpsmart.DownloadResource.getResourceStream(

DownloadResource.java:18)

  org.apache.wicket.protocol.http.WicketFilter.getLastModified(

WicketFilter.java:708)

  org.apache.wicket.protocol.http.WicketFilter.doFilter(

WicketFilter.java:122)

Our resource code looks like this:


final class DownloadResource extends Resource {

  public IResourceStream getResourceStream() {
final OurSession session = (OurSession)Session.get();
if (session == null) {
  return null;
}

final File file = session.getFileToDownload();
if (file == null) {
  return null;
}

return new MyFileResourceStream(file);
  }

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

you can register a shared resource and build a url for it. inside shared
resource you can simply call Session.get() to get to wicket session.

see application.getsharedresources();

alternatively you can extend WicketSessionFilter which will also allow

you

to perform Session.get()


-igor


On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

Disclaimer: I'm not experienced with filters or wicket resources.

Is it possible to create a (shared) wicket resource which can be
filtered,
so it only is accessible when the right flag is set in OurWebSession?

Or would you suggest to write an own javax.servlet.Filter which does

this

flag-check and redirects internally to a hidden location which then is
send
to the client by Tomcat when the right flag is set?

Thanks in advance.

--
Best regards,
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany
www.syntevo.com


Igor Vaynberg wrote:

On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:

Hi Igor,


yep, DownloadLinks will block because requests to the same page are
serialized.

Sorry, I don't understand, why links to downloadable resources should

be

blocking or serialized. Usually downloads are the larger parts of an
application and hence should never lock the application.

because this is how this component is designed to work. if you dont

like

it

you can build your own that doesnt block.


to work around it register a shared resource or create a servlet that

can

stream the file (resoureces in wicket are not serialized), then

create

a

link component that can build a download url.

Well, I guess, we can't use a servlet, because wicket is registered

to

/*, so it will get everything.

wicket is a filter, so even though it is mapped to /* it will let urls

that

are not wicket urls pass through. how do you think it lets you

download

static images...
so if you map your wicket filter on /* and the servlet on /download

and

yo

have no download mount in wicket the filter will let /download/*

requests

go to the servlet.

-igor


Could you please give some more hints

about shared resources? I've tried to search
http://cwiki.apache.org/WICKET/ without luck.

Alternatively, is it possible to complete shut off the serialization
(which seems to cause this and maybe even other blocking problems)?

--
Best regards
Thomas Singer
_
SyntEvo GmbH
Brunnfeld 11
83404 Ainring
Germany


Igor Vaynberg wrote:

yep, DownloadLinks will block because requests to the same page are
serialized.

to work around it register a shared resource or create a servlet

that

can

stream the file (resoureces in wicket are not serialized), then

create

a

link component that can build a download url.

-igor


On 8/20/07, Thomas Singer [EMAIL PROTECTED] wrote:

Hi,

We are using Wicket 1.3 beta 2 running in Tomcat and have a couple

of

DownloadLinks on a page (created with 'new

DownloadPage(parameters)')

for

larger files (a couple of MB). I open different tabs of the same

page

in

Opera and click these download links, so the downloads should

happen

in

parallel. Unfortunately, the web-application seems to hang until

the

previous files were completely downloaded. Even normal pages do not

show

up.

This does not happen for other websites (so our internet connection
couldn't
be the reason) and not for the same project with
old-JSP-/Servlet-technology
at a different server running in the same version of Tomcat.

Is this a known problem? How to work around?

--
Best regards,

Re: wicket vs tapestry ? (Back Button Detection-Support)

2007-08-23 Thread Eelco Hillenius
On 8/23/07, William Hoover [EMAIL PROTECTED] wrote:
 Possible starting point for a client solution for back button 
 detection/support:

 http://www.onjava.com/pub/a/onjava/2005/10/26/ajax-handling-bookmarks-and-back-button.html?page=1

Thanks for suggesting. We have discussed that and other articles a
bunch of times already though.

The problem we're having is not so much that we don't know how ajax
back button support could work in the basics, but how it could work
together with Wicket's server side state.

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question regarding old post (ResultSet and DataTable)

2007-08-23 Thread dtoffe

Done, I've offered to write some example of use for the wiki or example
page.

Thanks !!

Daniel


igor.vaynberg wrote:
 
 perhaps you can email frank and ask him, it is unfortunate he did not post
 his code on a wiki page somewhere.
 
 http://www.nabble.com/displaying-java.sql.Timestamp-tf1333211.html#a3561689
 
 -igor
 
 

-- 
View this message in context: 
http://www.nabble.com/Question-regarding-old-post-%28ResultSet-and-DataTable%29-tf4314874.html#a12297009
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Component Factory and code against interface

2007-08-23 Thread Igor Vaynberg
On 8/23/07, Sam Hough [EMAIL PROTECTED] wrote:


 Say my onSubmit handler changes three components, as I understand it, I
 have
 to hand code feeding those three components to the AjaxRequestTarget. This
 seems cumbersome and slightly error prone. I think for our application, if
 the components kept track of changes, I could automate which components
 are
 sent back. Guess what I'm asking is if anything that already exists in
 Wicket keeps track of component changes? Can't imagine it would be easy
 otherwise without really heavy duty AOP etc...


heh, there is nothing that automatically marks components as dirty() because
wicket doesnt know what you do inside your components. wicket is unmanaged.

but i dont really understand the issue. you have onclick(ajaxrequesttarget
t) { dosomething(); t.addcomponent() }

so in your case you mean inside dosomething() you do something to x
components, but you dont know which x components they are?

-igor


Thanks again Igor.


 igor.vaynberg wrote:
 
  not really sure what you mean when you say marking components as
 dirty...
 
  have you seen ajaxfallback* components? those will use ajax when its
  there,
  and fallback on regular requests when its not. so you dont even need a
  factory necessarily.
 
  -igor
 
 
  On 8/23/07, Sam Hough [EMAIL PROTECTED] wrote:
 
 
  Thanks Igor,
 
  Because we have to support Ajax and non-Ajax version I was wondering
  about
  hiding details of making components Ajax friendly in the factory. so
  setOutputMarkupId(true) etc and hiding Ajax specific handlers where
  possible. Have you seen anybody automatically marking components as
 dirty
  so
  they can be sent back via Ajax (Echo like)? I think that would handle
 90%
  of
  our Ajax like stuff.
 
  Cheers
 
  Sam
  --
  View this message in context:
 
 http://www.nabble.com/Component-Factory-and-code-against-interface-tf4311047.html#a12290179
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Component-Factory-and-code-against-interface-tf4311047.html#a12296693
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: DownloadLink hanging

2007-08-23 Thread Igor Vaynberg
yep

-igor


On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:

 Should I report a bug in JIRA?

 --
 Best regards,
 Thomas Singer
 _
 SyntEvo GmbH
 Brunnfeld 11
 83404 Ainring
 Germany
 www.syntevo.com


 Igor Vaynberg wrote:
  hm, this looks like an old bug. johan didnt we fix this a while ago?
 
  -igor
 
 
  On 8/23/07, Thomas Singer [EMAIL PROTECTED] wrote:
  inside shared
  resource you can simply call Session.get() to get to wicket session.
  Unfortunately, it looks like this is not possible, because I'm getting
  following exception:
 
  java.lang.IllegalStateException: you can only locate or create
 sessions
  in the context of a request cycle
org.apache.wicket.Session.findOrCreate(Session.java:250)
org.apache.wicket.Session.get(Session.java:279)
com.syntevo.hpsmart.DownloadResource.getResourceStream(
  DownloadResource.java:18)
org.apache.wicket.protocol.http.WicketFilter.getLastModified(
  WicketFilter.java:708)
org.apache.wicket.protocol.http.WicketFilter.doFilter(
  WicketFilter.java:122)
 
  Our resource code looks like this:
 
  final class DownloadResource extends Resource {
 
public IResourceStream getResourceStream() {
  final OurSession session = (OurSession)Session.get();
  if (session == null) {
return null;
  }
 
  final File file = session.getFileToDownload();
  if (file == null) {
return null;
  }
 
  return new MyFileResourceStream(file);
}
  --
  Best regards,
  Thomas Singer
  _
  SyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
  www.syntevo.com
 
 
  Igor Vaynberg wrote:
  you can register a shared resource and build a url for it. inside
 shared
  resource you can simply call Session.get() to get to wicket session.
 
  see application.getsharedresources();
 
  alternatively you can extend WicketSessionFilter which will also allow
  you
  to perform Session.get()
 
 
  -igor
 
 
  On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Disclaimer: I'm not experienced with filters or wicket resources.
 
  Is it possible to create a (shared) wicket resource which can be
  filtered,
  so it only is accessible when the right flag is set in OurWebSession?
 
  Or would you suggest to write an own javax.servlet.Filter which does
  this
  flag-check and redirects internally to a hidden location which then
 is
  send
  to the client by Tomcat when the right flag is set?
 
  Thanks in advance.
 
  --
  Best regards,
  Thomas Singer
  _
  SyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
  www.syntevo.com
 
 
  Igor Vaynberg wrote:
  On 8/21/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Hi Igor,
 
  yep, DownloadLinks will block because requests to the same page
 are
  serialized.
  Sorry, I don't understand, why links to downloadable resources
 should
  be
  blocking or serialized. Usually downloads are the larger parts of
 an
  application and hence should never lock the application.
  because this is how this component is designed to work. if you dont
  like
  it
  you can build your own that doesnt block.
 
  to work around it register a shared resource or create a servlet
 that
  can
  stream the file (resoureces in wicket are not serialized), then
  create
  a
  link component that can build a download url.
  Well, I guess, we can't use a servlet, because wicket is registered
  to
  /*, so it will get everything.
  wicket is a filter, so even though it is mapped to /* it will let
 urls
  that
  are not wicket urls pass through. how do you think it lets you
  download
  static images...
  so if you map your wicket filter on /* and the servlet on /download
  and
  yo
  have no download mount in wicket the filter will let /download/*
  requests
  go to the servlet.
 
  -igor
 
 
  Could you please give some more hints
  about shared resources? I've tried to search
  http://cwiki.apache.org/WICKET/ without luck.
 
  Alternatively, is it possible to complete shut off the
 serialization
  (which seems to cause this and maybe even other blocking problems)?
 
  --
  Best regards
  Thomas Singer
  _
  SyntEvo GmbH
  Brunnfeld 11
  83404 Ainring
  Germany
 
 
  Igor Vaynberg wrote:
  yep, DownloadLinks will block because requests to the same page
 are
  serialized.
 
  to work around it register a shared resource or create a servlet
  that
  can
  stream the file (resoureces in wicket are not serialized), then
  create
  a
  link component that can build a download url.
 
  -igor
 
 
  On 8/20/07, Thomas Singer [EMAIL PROTECTED] wrote:
  Hi,
 
  We are using Wicket 1.3 beta 2 running in Tomcat and have a
 couple
  of
  DownloadLinks on a page (created with 'new
  DownloadPage(parameters)')
  for
  larger files (a couple of MB). I open different tabs of the same
  page
  in
  Opera and click these download links, so the downloads should
  happen
  in
  parallel. Unfortunately, the web-application seems to hang until
  the
  previous files were 

Re: Can Panel replace itself ?

2007-08-23 Thread Artur W.



Eelco Hillenius wrote:
 
 do:
 
TestPanel newOne = new TestPanel(TestPanel.this.getId(), another
 param);
TestPanel.this.replaceWith(newOne);
target.addComponent(newOne);
 
 

I didn't know about replaceWith method. It works great! Thanks a lot!!! 
Artur

-- 
View this message in context: 
http://www.nabble.com/Can-Panel-replace-itself---tf4318533.html#a12297058
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Can Panel replace itself ?

2007-08-23 Thread Igor Vaynberg
c.replacewith(a) is the same as c.getparent().replace(a)

-igor


On 8/23/07, Artur W. [EMAIL PROTECTED] wrote:




 Eelco Hillenius wrote:
 
  do:
 
 TestPanel newOne = new TestPanel(TestPanel.this.getId(), another
  param);
 TestPanel.this.replaceWith(newOne);
 target.addComponent(newOne);
 
 

 I didn't know about replaceWith method. It works great! Thanks a lot!!!
 Artur

 --
 View this message in context:
 http://www.nabble.com/Can-Panel-replace-itself---tf4318533.html#a12297058
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: PageStore listener...

2007-08-23 Thread Jan Kriesten

hi igor,

 public mypanel extends panel {
 @SpringBean private Service service;

actually, if i use guice-injection

@Inject private ContentManager cm;

where ContentManager isn't serializable, i get tons of exceptions regarding 'not
serializable.

so, to me it seems that the proxy-stuff not always applies.

i wouldn't have asked if i hadn't had any trouble with this.

regards, --- jan.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: PageStore listener...

2007-08-23 Thread Igor Vaynberg
are you using wicket-guice? or just the guice' raw injection?

-igor


On 8/23/07, Jan Kriesten [EMAIL PROTECTED] wrote:


 hi igor,

  public mypanel extends panel {
  @SpringBean private Service service;

 actually, if i use guice-injection

 @Inject private ContentManager cm;

 where ContentManager isn't serializable, i get tons of exceptions
 regarding 'not
 serializable.

 so, to me it seems that the proxy-stuff not always applies.

 i wouldn't have asked if i hadn't had any trouble with this.

 regards, --- jan.



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Constructor of Component not DRY?

2007-08-23 Thread Eelco Hillenius
 hmmm... that would go against my taste of chaining from the constructor
 with the least parameters to the constructor with the most parameters.
 I'd just tend to chose the constructor with the most complex signature
 as the default constructor, doing the 'real' construction part of the
 object construction and the others chained towards it, using default or
 null values.

I think I would typically do that too, though there are no hard rules
for this, so it doesn't matter much in the end. Chaining like that
doesn't work for constructors who assume that if their form is used,
the passed in arguments are not null.

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RadioGroup and posted Values

2007-08-23 Thread Jan Kriesten

hi,

I'm trying to get the posted value of a RadioGroup (within a converter of a
textfield), but i only get the posted string values, not the model values of the
radio elements:


RadioGroup rg = new RadioGroup( takedown );
add( rg );
rg.add( new Radio( takedownFalse, new Model( false ) ) );
rg.add( new Radio( takedownTrue, new Model( true ) ) );

after post, rg.getValue() should return something like true or false, but i
only get 'radio6' or 'radio8' depending on which of both Radio is selected.

rg.getInput() delivers the same, as does rg.getInputAsArray().
rg.getConvertedInput() gives a null.

how can i access the current value??

regards, --- jan.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [newb] sorting, paging table

2007-08-23 Thread Igor Vaynberg
On 8/23/07, somethingRandom [EMAIL PROTECTED] wrote:


 I am trying out wicket, coming from the action-based world, so please bear
 with me.

 I made a simple report (we have a backend using spring and hibernate in
 place). It was very easy to take the ArrayList that hibernate returns to
 me
 and display that in a DataView using the ListDataProvider.

 So I look into trying to add some sorting and paging and decide that the
 AjaxFallbackDefaultDataTable looks like the ticket. But now it looks like
 I
 also need to write 3 or 4 new classesl,


which are what?

and write sort methods for each
 property of my pojos. It's not really this difficult, is it?

 What's the easiest way to take an arraylist of objects and display them in
 a
 sortable, pageable table?


class mydataprovider extends sortabledataprovider {
abstract List getList(String sortcol, boolean asc) { // implement this
yourself and return the properly sorted list }
imodel model(object o) { // implement yourself }

int size() { return getList(getSort().getProperty(),
getSort().isAsc()).size(); }
iterator iterator(int first, int count){ return
getList(getSort().getProperty(), getSort().isAsc()).sublist(first,
first+count); }
}

just one small class looks like to me

-igor




}


Thanks
 --
 View this message in context:
 http://www.nabble.com/-newb--sorting%2C-paging-table-tf4319230.html#a12299554
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Can Panel replace itself ?

2007-08-23 Thread Igor Vaynberg
does it do that in all browsers?

also call view.setreuseitems(true);

-igor



On 8/23/07, Artur W. [EMAIL PROTECTED] wrote:



 igor.vaynberg wrote:
 
  c.replacewith(a) is the same as c.getparent().replace(a)
 

 I want to extend this example and replace the panel but inside the
 ListView.
 But I've found another problem.

 I did like you wrote but the panel isn't replaced. The new panel is being
 added at the top of the table.
 Why?

 The Page:
 public class TestPage extends MyPage {

 private static final Listlt;Stringgt; params = Arrays.asList(
 new
 String[] { one, two, three, four} );

 public TestPage(PageParameters parameters) {
 super(parameters);

 ListView view = new ListView(list, params) {
 protected void populateItem(ListItem item) {
 String s = (String) item.getModelObject();
 item.add(new TestPanel(panel, s));
 }
 };
 add(view);
 }
 }

 lt;wicket:extendgt;
 lt;tablegt;
 lt;tr wicket:id=listgt;
 lt;span wicket:id=panelgt;[panel]lt;/spangt;
 lt;/trgt;
 lt;/tablegt;
 lt;/wicket:extendgt;

 The Panel:
 public TestPanel(String id, String param) {
 super(id);
 setOutputMarkupId(true);
 AjaxLink link = new AjaxLink(link) {
 public void onClick(AjaxRequestTarget target) {
 TestPanel newOne = new TestPanel(
 TestPanel.this.getId(), another
 param);
 TestPanel.this.replaceWith(newOne);
 target.addComponent(newOne);
 }
 };
 link.add(new Label(label0, click));
 add(link);
 add(new Label(label1, param.toUpperCase()));
 add(new Label(label2, param.toLowerCase()));
 }

 lt;wicket:panelgt;
 lt;tdgt;lt;a href=# wicket:id=linkgt;lt;span
 wicket:id=label0gt;[label0]lt;/spangt;lt;/agt;lt;/tdgt;
 lt;tdgt;lt;span
 wicket:id=label1gt;[label1]lt;/spangt;lt;/tdgt;
 lt;tdgt;lt;span
 wicket:id=label2gt;[label2]lt;/spangt;lt;/tdgt;
 lt;/wicket:panelgt;


 Artur
 --
 View this message in context:
 http://www.nabble.com/Can-Panel-replace-itself---tf4318533.html#a12300076
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: RadioGroup and posted Values

2007-08-23 Thread Igor Vaynberg
hmm, dont know why you would do this inside a converter of another
component
but you can get to it like this:

rg.convert(); rg.getconvertervalue();

-igor


On 8/23/07, Jan Kriesten [EMAIL PROTECTED] wrote:


 hi,

 I'm trying to get the posted value of a RadioGroup (within a converter of
 a
 textfield), but i only get the posted string values, not the model values
 of the
 radio elements:


 RadioGroup rg = new RadioGroup( takedown );
 add( rg );
 rg.add( new Radio( takedownFalse, new Model( false ) ) );
 rg.add( new Radio( takedownTrue, new Model( true ) ) );

 after post, rg.getValue() should return something like true or false,
 but i
 only get 'radio6' or 'radio8' depending on which of both Radio is
 selected.

 rg.getInput() delivers the same, as does rg.getInputAsArray().
 rg.getConvertedInput() gives a null.

 how can i access the current value??

 regards, --- jan.



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Constructor of Component not DRY?

2007-08-23 Thread Igor Vaynberg
just add a

private component init(String, IModel) which can assume null arguments

do the null checks in the constructor and forward to that method

-igor


On 8/23/07, Eelco Hillenius [EMAIL PROTECTED] wrote:

  hmmm... that would go against my taste of chaining from the constructor
  with the least parameters to the constructor with the most parameters.
  I'd just tend to chose the constructor with the most complex signature
  as the default constructor, doing the 'real' construction part of the
  object construction and the others chained towards it, using default or
  null values.

 I think I would typically do that too, though there are no hard rules
 for this, so it doesn't matter much in the end. Chaining like that
 doesn't work for constructors who assume that if their form is used,
 the passed in arguments are not null.

 Eelco

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: [newb] sorting, paging table

2007-08-23 Thread somethingRandom



igor.vaynberg wrote:
 
 On 8/23/07, somethingRandom [EMAIL PROTECTED] wrote:
 What's the easiest way to take an arraylist of objects and display them
 in
 a
 sortable, pageable table?
 
 
 class mydataprovider extends sortabledataprovider {
 abstract List getList(String sortcol, boolean asc) { // implement this
 yourself and return the properly sorted list }
 imodel model(object o) { // implement yourself }
 
 int size() { return getList(getSort().getProperty(),
 getSort().isAsc()).size(); }
 iterator iterator(int first, int count){ return
 getList(getSort().getProperty(), getSort().isAsc()).sublist(first,
 first+count); }
 }
 
 just one small class looks like to me
 
 -igor
 

That is much more concise than any examples I've seen before.

Thank you very much. 
-- 
View this message in context: 
http://www.nabble.com/-newb--sorting%2C-paging-table-tf4319230.html#a12304212
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: creating RSS feeds with Wicket

2007-08-23 Thread Ryan Sonnek
I'm not sure how the wicketstuff licenses work with the apache core, but
I've put up documentation on the wicketstuff WIKI and added a link to that
from the main wicket wiki for now.

On 8/23/07, Igor Vaynberg [EMAIL PROTECTED] wrote:

 why not replace the wiki project with a quickstart tutorial for this new
 project and a quick description. no point keeping stale info around.

 -igor


 On 8/23/07, Ryan Sonnek [EMAIL PROTECTED] wrote:
 
  http://www.jroller.com/wireframe/entry/wicket_and_rss_feeds
 
  Just wanted to post an announcement that there's a new wicket stuff
  project
  (wicketstuff-rome) to allow for creation of RSS (or Atom) feeds from
  within
  Wicket.  I've been using it for the past several weeks and it's allowed
 me
  to integrate RSS feeds into my Wicket app *very* quickly.
 
  This new project is a definite step up from the existing wicket wiki
  article
  for Rss pages, but I'm not sure what to do about that info.  Please let
 me
  know if anyone has suggestions or issues with the project.  Now that
 it's
  on
  wicketstuff, feel free to tweak or add features!
 
  Ryan
 



Re: Question regarding old post (ResultSet and DataTable)

2007-08-23 Thread dtoffe

Hi Ayodeji !

I fully agree with you specially if you have few tables and adhere
totally to ORM. But consider what happens when yo have to fill a DataTable
with the result of three+ tables joined, with subselects, group by and
dinamic where clauses...
Would you consider correct to define one Bean-based DataProvider for
each one of such resultsets ??  They are not domain entities, they are just
rows !!
I always had some problems with this side of ORM, sometimes you don't
retrieve a list of entities, sometimes the result is more like a
spreadsheet, and you don't have an easy way of dealing with that based on
beans.
What happens if you call a Stored Procedure and you just don't know how
many columns are returned ??  This is the problem I would like to solve.
Of course I want to do it the Wicket way, to be able to enjoy all the
benefits already provided by the framework.
I don't want to avoid IDataProvider, I just want to be less tied to the
idea of retrieving beans from the database. This issue troubled me since the
very first time I heard about ORM.
Of course all your concepts regarding the size of the resultset etc. are
completely valid and they must be dealt with.
I'm sorry I haven't had time yet to explore the code you sent me, I'll
see it over the weekend and post it again next week.

Thanks for your help !!

Daniel


Ayodeji Aladejebi wrote:
 
 i think its proper to have a Dataprovider for each table. why i enjoy
 dataprovider in wicket is that it gives me this feeling that SELECT * FROM
 TABLE will not return 1 million records and crash my application, its
 gives
 you a simple way to fetch the data you want to display per time and you
 can
 create a many dataprovider as possible or even implement some internal
 session state logic to tell IDataprovider which table to fetch. its up to
 your implementation.
 
 you will also loose the flexibility you have with yur models if you avoid
 IDataProvider
 
 however actually i think i makes sense for someone to donate a robust
 JDBCDataProvider to wicket stuff
 because attempting to do this for criteria matter, you can only hope you
 are
 not dealing with complex data types
 
 

-- 
View this message in context: 
http://www.nabble.com/Question-regarding-old-post-%28ResultSet-and-DataTable%29-tf4314874.html#a12306193
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]