Re: [ANNOUNCE] Wicketopia 0.9 Released...

2011-07-10 Thread Nivedan Nadaraj
Hi James
Great effort mate thanks, Haven't had a look as yet am sure it will be
useful. If you need help with documentation do let us know

Cheers


On Mon, Jul 11, 2011 at 8:51 AM, androidcoolguy
androidcool...@hotmail.comwrote:

 Ok after some struggling, I managed to get it work. I noticed that
 Wicketopia
 has a tight coupling with Hibernate, especially -

bean id=persistenceProvider
 class=org.wicketopia.persistence.hibernate.HibernatePersistenceProvider
property name=sessionFactory ref=sessionFactory/
/bean

 And the codes needs sessionFactory to be initialized (not null), in order
 to
 work. That was why I were having NPE.

 Is there any plan to support Google App Engine for Java? I can help out if
 you can give me some guidelines.

 Thanks for such an awesome framework!

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/ANNOUNCE-Wicketopia-0-9-Released-tp3418771p3658471.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: Binding selected values from a ListView into a Mode

2011-06-10 Thread Nivedan Nadaraj
Hi Per,
Thanks for taking the time to respond. Much appreciated I will work on it
sounds simple should be a good solution. Will ping back from based on how i
go.
Cheers


On Thu, Jun 9, 2011 at 3:24 PM, Per Newgro per.new...@gmx.ch wrote:

 Am 09.06.2011 09:01, schrieb Nivedan Nadaraj:

  Hi All,

 I have a problem to deal with binding selected values into a model within
 a
 ListView. I have tried to outline the approach and class definitions out
 here. I hope I have been clear. Would appreciate your thoughts on the
 design
 and approach i have taken so far. I guess am pretty close to it just one
 hurdle.


 public class MainVO{
 private ListUserModuleRole  userRoleList;
 }
 public class UserModuleRole{
 private Role role;
 private Module module;
 private User user;
 }


 *Problem:*
 1. I want to list the modules and the roles available for each module in a
 list view.
 2. Select a Role from  each module  for a user
 3. Save - Will have the user linked to one or more modules with a role for
 each.(only one role per module)

 *Approach*

 I used a ListView and rendered the list of modules and their respective
 roles in a drop down. To render this List view these are the steps I took.

 public class ModuleVO implements Serializable{

 private Module module;
 private ListRole  moduleRoles;
 }


 1. I get a Collection/List of ModuleVO via the service. The collection
 will
 have a ModuleVO per module with the associated roles as a member.
 2. I iterated the list and rendered the Module and render a DropDownChoice
 3. End of which I get the following output in the list
 *
 Output from List view*:

 Module   Role
 
 Module-A   Role-1
  Role-2

 Module-B   Role-3
  Role-4

 What I have not done and not clear is:
 4. At this time I have not bound a Model to the dropdown and just used new
 Model() for the Model argument of dropDownChoice.

 I know that the selected values must eventually be in the MainVO's
 ListUserModuleRole  userRoleList property.

 What is not very clear to me at this point is how to bind it ...so that
 when
 the user saves the selected values are captured. I am sure this is
 possible
 and should be elegant. Your thoughts and time will be of great value.

 Many thanks
 Regards

  Instanciate the MainVO with a UserModuleRole for every Module and the
 known user. The role
 has only to be loaded if it's already assigned. That is the base.
 If your listview is on a panel / form - give it the MainVO instance.
 Set the MainVO.userRoleList to the ListView by using a
 PropertyModelListUserModuleRole.
 In ListView.populateItem you get every single UserModuleRole. Render the
 UserModuleRole to the
 ListViewItem.
 The DDC for the roles gets a PropertyModel pointing to the UserModuleRole
 of the ListViewItem.
 The selectable Roles have to be provided by a LoadableDetachableModel
 calling your service.

 Hth
 Cheers
 Per

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




Re: Binding selected values from a ListView into a Mode

2011-06-10 Thread Nivedan Nadaraj
Hi

Yep I got it going. Prepopulating and the 'the base/fundamental' was a good
start that kinda helped in looking at other parts of the problem. Thanks for
the time

Cheers

On Thu, Jun 9, 2011 at 3:24 PM, Per Newgro per.new...@gmx.ch wrote:

 Am 09.06.2011 09:01, schrieb Nivedan Nadaraj:

  Hi All,

 I have a problem to deal with binding selected values into a model within
 a
 ListView. I have tried to outline the approach and class definitions out
 here. I hope I have been clear. Would appreciate your thoughts on the
 design
 and approach i have taken so far. I guess am pretty close to it just one
 hurdle.


 public class MainVO{
 private ListUserModuleRole  userRoleList;
 }
 public class UserModuleRole{
 private Role role;
 private Module module;
 private User user;
 }


 *Problem:*
 1. I want to list the modules and the roles available for each module in a
 list view.
 2. Select a Role from  each module  for a user
 3. Save - Will have the user linked to one or more modules with a role for
 each.(only one role per module)

 *Approach*

 I used a ListView and rendered the list of modules and their respective
 roles in a drop down. To render this List view these are the steps I took.

 public class ModuleVO implements Serializable{

 private Module module;
 private ListRole  moduleRoles;
 }


 1. I get a Collection/List of ModuleVO via the service. The collection
 will
 have a ModuleVO per module with the associated roles as a member.
 2. I iterated the list and rendered the Module and render a DropDownChoice
 3. End of which I get the following output in the list
 *
 Output from List view*:

 Module   Role
 
 Module-A   Role-1
  Role-2

 Module-B   Role-3
  Role-4

 What I have not done and not clear is:
 4. At this time I have not bound a Model to the dropdown and just used new
 Model() for the Model argument of dropDownChoice.

 I know that the selected values must eventually be in the MainVO's
 ListUserModuleRole  userRoleList property.

 What is not very clear to me at this point is how to bind it ...so that
 when
 the user saves the selected values are captured. I am sure this is
 possible
 and should be elegant. Your thoughts and time will be of great value.

 Many thanks
 Regards

  Instanciate the MainVO with a UserModuleRole for every Module and the
 known user. The role
 has only to be loaded if it's already assigned. That is the base.
 If your listview is on a panel / form - give it the MainVO instance.
 Set the MainVO.userRoleList to the ListView by using a
 PropertyModelListUserModuleRole.
 In ListView.populateItem you get every single UserModuleRole. Render the
 UserModuleRole to the
 ListViewItem.
 The DDC for the roles gets a PropertyModel pointing to the UserModuleRole
 of the ListViewItem.
 The selectable Roles have to be provided by a LoadableDetachableModel
 calling your service.

 Hth
 Cheers
 Per

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




Binding selected values from a ListView into a Mode

2011-06-09 Thread Nivedan Nadaraj
Hi All,

I have a problem to deal with binding selected values into a model within a
ListView. I have tried to outline the approach and class definitions out
here. I hope I have been clear. Would appreciate your thoughts on the design
and approach i have taken so far. I guess am pretty close to it just one
hurdle.


public class MainVO{
private ListUserModuleRole userRoleList;
}
public class UserModuleRole{
private Role role;
private Module module;
private User user;
}


*Problem:*
1. I want to list the modules and the roles available for each module in a
list view.
2. Select a Role from  each module  for a user
3. Save - Will have the user linked to one or more modules with a role for
each.(only one role per module)

*Approach*

I used a ListView and rendered the list of modules and their respective
roles in a drop down. To render this List view these are the steps I took.

public class ModuleVO implements Serializable{

private Module module;
private ListRole moduleRoles;
}


1. I get a Collection/List of ModuleVO via the service. The collection will
have a ModuleVO per module with the associated roles as a member.
2. I iterated the list and rendered the Module and render a DropDownChoice
3. End of which I get the following output in the list
*
Output from List view*:

Module   Role

Module-A   Role-1
 Role-2

Module-B   Role-3
 Role-4

What I have not done and not clear is:
4. At this time I have not bound a Model to the dropdown and just used new
Model() for the Model argument of dropDownChoice.

I know that the selected values must eventually be in the MainVO's
ListUserModuleRole userRoleList property.

What is not very clear to me at this point is how to bind it ...so that when
the user saves the selected values are captured. I am sure this is possible
and should be elegant. Your thoughts and time will be of great value.

Many thanks
Regards


Re: Apache Wicket Cookbook Published!

2011-04-12 Thread Nivedan Nadaraj
Great stuff! Will get a copy!

Cheers
Niv

On Sat, Mar 26, 2011 at 1:52 AM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 Congrats.

 I trust Igor

 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Friday, March 25, 2011 1:44 PM
 To: users@wicket.apache.org; d...@wicket.apache.org;
 annou...@wicket.apache.org
 Subject: Apache Wicket Cookbook Published!

 For the past nine months I have been quietly working on a book about
 Wicket. Unlike other books on the market this one does not attempt to
 teach you Wicket from the ground up. Instead, it is for developers who
 already know the basics and want to learn how to implement some of the
 more advanced use cases. Essentially, it contains recipes that show the
 reader how to implement solutions to some of, what I think are, the most
 commonly asked questions and stumbling blocks. This morning I was
 informed that the book has been published! You can read more about it
 and pick up a copy on PACKT's Site[1]. I hope you enjoy it, more details
 below...

 [1] https://www.packtpub.com/apache-wicket-cookbook/book

 ## Description ##

 Apache Wicket is one of the most famous Java web application frameworks.
 Wicket simplifies web development and makes it fun. Are you bored of
 going through countless pages of theory to find out how to get your web
 development done? With this book in hand, you don't need to go through
 hundreds of pages to figure out how you will actually build a web
 application. You will get practical solutions to your common everyday
 development tasks to pace up your development activities.

 Apache Wicket Cookbook provides you with information that gets your
 problems solved quickly without beating around the bush. This book is
 perfect for you if you are ready to take the next step from tutorials
 and step into the practical world. It will take you beyond the basics of
 using Apache Wicket and show you how to leverage Wicket's advanced
 features to create simpler and more maintainable solutions to what at
 first may seem complex problems.

 You will learn how to integrate with client-side technologies such as
 JavaScript libraries or Flash components, which will help you to build
 your application faster. You will discover how to use Wicket paradigms
 to factor out commonly used code into custom Components, which will
 reduce the maintenance cost of your application, and how to leverage the
 existing Wicket Components to make your own code simpler.

 A straightforward Cookbook with highly focused practical recipes to make
 your web application development easier with the Wicket web framework

 ## What you will learn from this book ##

 * Leverage Wicket to implement a wide variety of both simple and
 advanced use cases in a narrative that gets straight to the point
 * Make forms work in the crazy world of the Web by learning the ways of
 Wicket's form processing
 * Simplify localizing your Wicket applications
 * Take the boring out of your forms by discovering how to improve the
 user experience while simplifying your code at the same time
 * Leverage the built-in Table component to make displaying tabular data
 a snap
 * Think Wicket's Borders are not very useful? Learn to use them in
 unexpected places to simplify things
 * See how to integrate with Flash components and create interactive
 charts at the same time
 * Web 1.0 too boring? Learn how to tame Wicket's AJAX support and bring
 your application into Web 2.0
 * Simplify your security code by learning various security techniques
 * An application cannot be built with Wicket alone; see how to make it
 play nice with other frameworks

 ## Approach ##

 This is a hands-on practical guide to a large variety of topics and use
 cases. This book tries to use real-world examples when possible, but is
 not afraid to come up with a contrived pretext if it makes explaining
 the problem simpler. Unlike a lot of other books, this one does not try
 to maintain a continuous theme from chapter to chapter, such as
 demonstrating solutions on the same fictional application; doing so
 would be almost impossible given the wide variety of recipes presented
 here. Instead, this book concentrates on focused problems users are
 likely to encounter and shows clear solutions in a step-by-step manner.
 This book tries to teach by example and is not afraid to show a lot of
 code because, after all, it is for coders.

 ## Who this book is written for ##

 This book is for current users of the Apache Wicket framework; it is not
 an introduction to Wicket that will bore you with tons of theory.
 You are expected to have built or maintained a simple Wicket application
 in the past and to be looking to learn new and better ways of using
 Wicket. If you are ready to take your Wicket skills to the next level
 this book is for you.

 Cheers, and I hope you enjoy the book!
 -Igor

 -
 To unsubscribe, 

Validating a Number using a Validator

2011-02-23 Thread Nivedan Nadaraj
Hi All,

Basic question but have not got an answer to it. I want to validate a field
to accept only numbers and provide a validation message.
Is there a NumericValidator I checked NumberValidator but don't see how I
can use it..it says its deprecated.

TextFieldLong yearOfExpiry = new TextFieldLong(yearExpired);

I guess the validator should check if it is of the right type(data type)
..i.e Numeric..

Or should I build a CustomValidator? If I have to would there be an example
of how this can be built? Look at the Wicket Code base?
Thanks guys
Niv


Re: Wicket-Spring Hibernate dao

2011-02-22 Thread Nivedan Nadaraj
Hi,

Is your DAO marked with @Repository annotation?

e.g.
*@Repository(myDao)*
public class SomeDAO extends HibernateSessionDao implements IDao {


Plus in your client you need that @SpringBean,((Spring would inject it)

In my case I use a Service to get to the DAO - May not be necessary

@SpringBean( name = serviceName)
private IService service;

The IService Impl is define like this


@Service(serviceName)

So Client calls the Service and the Service delegates to the DAO.

I think its something to do with the markup/annotation and probably missing
the configuration.

Hope this helps
niv


On Wed, Feb 23, 2011 at 6:26 AM, Dan Griffin dangri...@gmail.com wrote:

 I think that it happened because spring wrapped a proxy around your bean,
 and then hibernate couldn`t recognize its class and which table it should
 look for. I`m not sure if you can get around it, but I agree with Igor that
 you should  create your domain objects with new, rather than inject them.

  you should be doing cat=new cat() anyways. i assume the default cat
 is a singleton in your application context, in which case you do not
 want it to be persisted anyways.

 -igor

 On Tue, Feb 22, 2011 at 1:59 PM, ookpalmookp...@gmail.com  wrote:


 Hi

 I have a question about wicket spring.

 My project is setup with Wicket-Spring plus using Hibernate annotation. I
 created a Dao object says CatDao and created a entity for relational
 mapping with hibernate says Cat. Both are created by using Spring
 applicationContext file.

 On my page says AddCat I show the default values of Cat object that I
 set in my applicationContext which is rendered correctly in textFields
 (Wicket-spring works correctly). But when I use the command
 catDao.store(cat); The following error happens:

 Last cause: Unknown entity: WICKET_com.ook.Cat
 $$EnhancerByCGLIB$$d80b8019

 I commented out the @SpringBean annotation of the varriable Cat in my
 AddCat
 page and used the operator new directly to the Cat object like

 Cat cat = new Cat();

 The CatDao still remains the same
 @SpringBean
 CatDao catDao;

 now the command catDao.store(cat); works fine. Data are written to the
 Database. I have no clue how to solve this.

 Please help.
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-Hibernate-dao-tp3320134p3320134.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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





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




Re: Best Wicket security practice

2011-02-09 Thread Nivedan Nadaraj
Apache shiro is one more  - http://shiro.apache.org/



On Wed, Feb 9, 2011 at 3:14 AM, sakthi vel vela@gmail.com wrote:

 Hello All,

 There are few security things in wicket like SWARM, Spring security with
 wicket and so on.
  Could anyone tell the best security practice in wicket and any possible
 links would be great.



Re: DropDownChoice-Choose One Selected Item

2011-02-09 Thread Nivedan Nadaraj
@James - Thank you will try that out and get back.
@Martin - Thanks mate will get back I guess I am using 1.4.9 version and
don't have the option to setDefaultModelObject on the ChoiceRenderer anyhow
appreciate your time and thoughts to write back.

Thanks again
Nive
On Thu, Feb 10, 2011 at 12:01 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Hi!

 You can do  defaultChoiceRenderer.setDefaultModelObject(xxx)

 Or if you don't want to dirty it, you can use

  public static T extends FormComponent? void fakeRawInput(T
 formComponent, T existingComponent) {
try {
  String rawInput = (String) rawInputField.get(existingComponent);
  fakeRawInput(formComponent, rawInput);
} catch (Exception e) {
  Utils.errorLog(WicketUtils.class, Fatal Error: Form field
 access failed., e);
}
  }


 2011/2/10 Niv nivedan.t...@gmail.com:
 
  Hi
  Is there a way I can have the selected option on a DropDownChoice to be
 set
  with  one of the items in the Model instead of ' Choose One'  as the
  selected item by default? I know this has been asked around in a
 different
  sense but I could not find a closer match to this.
  Code Snippet
 
  ListCountry countryList =service.getCountries();
  ChoiceRendererCountry defaultChoiceRenderer = new
  ChoiceRendererCountry(Constants.NAME, Constants.ID);
  countryChoice = new DropDownChoiceCountry(Constants.ADDRESS_COUNTRY,
  countryList, defaultChoiceRenderer);
 
  //Would like the countryChoice to be able to have the First Contry in the
  countrList to be the one rendered instead of 'Choose One'.
 
  Thanks and if it seems redundant do pardon me
  Cheers
 
 
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-Choose-One-Selected-Item-tp3298535p3298535.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




Re: DatePicker to pick a year

2010-12-10 Thread Nivedan Nadaraj
So did that work? Have you tried to check your model annotation?


On Wed, Dec 8, 2010 at 10:24 PM, Anna Simbirtsev asimbirt...@gmail.comwrote:

 It is a pure Date.

 On Tue, Dec 7, 2010 at 9:24 PM, nivs shravann...@gmail.com wrote:
 
  Hi
 
  If your getting the date format error from the Model side and it is
  expecting a timestamp , then you might get that issue.
  Are you using a TimeStamp field or pure date?
 
  If I wanted only to store date in the backend without timestamp details
 my
  model has to be decorated like
 
  @Temporal(TemporalType.DATE) //This is important
  @Column(name = DATE_OF_APPLICATION, length = 7)
  public Date getDateOfApplication() {
 return this.dateOfApplication;
  }
 
  If for instance it was
  @Temporal(TemporalType.TIMESTAMP)
 
  It will fail validation based on the format.
 
  Hope that helps
  Cheers
 
 
 
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/DatePicker-to-pick-a-year-tp3063856p3077604.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
 
 



 --
 Anna Simbirtsev
 (416) 729-7331

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




Re: DatePicker to pick a year

2010-12-10 Thread Nivedan Nadaraj
So I am guessing your model is of TemporalType.Date and If it is the case
and if your not yet resolved it, can you try changing the dateformat to
mm-dd-yy ? or dd-mm-yy ? And see if your getting the validation error. If
your not then DatePicker field is expecting that default format and to
override it I guess Julien's suggestion would be the way to go.
Cheers


On Fri, Dec 10, 2010 at 4:53 PM, Nivedan Nadaraj shravann...@gmail.comwrote:

 So did that work? Have you tried to check your model annotation?



 On Wed, Dec 8, 2010 at 10:24 PM, Anna Simbirtsev asimbirt...@gmail.comwrote:

 It is a pure Date.

 On Tue, Dec 7, 2010 at 9:24 PM, nivs shravann...@gmail.com wrote:
 
  Hi
 
  If your getting the date format error from the Model side and it is
  expecting a timestamp , then you might get that issue.
  Are you using a TimeStamp field or pure date?
 
  If I wanted only to store date in the backend without timestamp details
 my
  model has to be decorated like
 
  @Temporal(TemporalType.DATE) //This is important
  @Column(name = DATE_OF_APPLICATION, length = 7)
  public Date getDateOfApplication() {
 return this.dateOfApplication;
  }
 
  If for instance it was
  @Temporal(TemporalType.TIMESTAMP)
 
  It will fail validation based on the format.
 
  Hope that helps
  Cheers
 
 
 
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/DatePicker-to-pick-a-year-tp3063856p3077604.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
 
 



 --
 Anna Simbirtsev
 (416) 729-7331

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





Re: Wicket-Hibernate Related LazyInitializationException

2010-12-06 Thread Nivedan Nadaraj
Hi Eelco

Appreciate your time and thoughts. I guess I am going to have to look at LDM
approach, since from what yourself,James and Dan have already mentioned
that.
I noticed a pattern when it/the system throws the Exception I have to track
it closely and see if makes sense and then I guess have to refactor to use a
LDM.Still hazy to me.
Many thanks for the time and thoughts, much appreciated one and all.

Regards
Nivedan




On Sat, Dec 4, 2010 at 9:23 AM, Eelco Hillenius
eelco.hillen...@gmail.comwrote:

 Yep, or least something comparable. You need to re-attach those
 objects you're using to the session somehow, and often the easiest way
 to do that is to just load them again if they were previously
 detached. If you worry about the database being hit more than you
 want, you are probably prematurely optimizing, and if you still worry,
 you should fix this by through Hibernate's (or your own) second level
 cache, not by keeping your model objects inflated between requests.

 As a general rule, something we often repeat on this list, if you work
 with Hibernate managed objects in Wicket models, use detachable models
 (LDM is a common one) and make sure that these objects are 'deflated'
 between requests, meaning that e.g. you only keep references to their
 ids, or e.g. the algorithm to get the objects back again when needed.

 Eelco


 On Wed, Dec 1, 2010 at 10:13 PM, James Carman
 ja...@carmanconsulting.com wrote:
  Just make sure your form's model is a LDM too.
 
  On Thu, Dec 2, 2010 at 12:23 AM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
  Hi All
 
  I am guessing this is more of a Hibernate thing/issue but if some one
 has
  encountered this and has a explanation that I can probably use from the
  Wicket front would be great.
 
  https://forum.hibernate.org/viewtopic.php?f=1t=1008473
 
 
  I have a LazyIntializationException when i page through some items. I
 use
  the PageableListView, the List item(s) are entities that are retrieved
 via
  an association Person.phones which is  a Set type.
  The funny thing is, the LIException is intermittent. I am also using
  OpenSessionInViewFilter. Any thoughts?
 
  By the way the this is the load() implemenation, I have set the Model
  Object's phoneList with a list of values fetched via the Service-DAO. I
  have used this with other entities without association and it works  but
 I
  guess is a different scenario(not associations)
 
  Model = new LoadableDetachableModelObject() {
 @Override
 protected Object load() {
 return containerForm.getModelObject().getPhoneList();
 }
 };
  }
 
  If someone has any thoughts would appreiciate hearing from you.
 
 
  Cheers
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




Re: Wicket-Hibernate Related LazyInitializationException

2010-12-05 Thread Nivedan Nadaraj
H Vineet

Thanks for taking the time again to respond. I appreciate every single
moment you have sent.

The reason why I add the Phone Number to a list is that, I only want to save
those numbers when the user hits the Save Button for the Person as a whole.
Lets say a Person X is looked up and loaded into a detail panel/page. As
part of his details I display a list of phone numbers he is linked with.
When the user hits Add new Phone
as part of the person's detail panel, I render a Phone detail panel (via
Ajax) yes, and then when user finishes describing the phone number details
hits the Done button.

OnDone - I simply add it to the List of existing phone numbers which is on
the Value Object that is linked to the CPM's Model. When the user finally
saves the Person along with the person the phone number's are persisted.
Now in relation to James Carman's thoughts, yes I have maintained the Phone
Numbers in a separate list and then copy them across to the Persistent Set
before I do the Save/Update.

The association on the Person entity has a SetPhone phones and by
Persisting the parent (Person) the encompassing Phones collection can be
saved/updated.Hope this is clear with #1 and #2. I cannot save the Phone by
itself because it needs a Person object to be persisted.(during a New
Person/Phone scenario for example)

You are right about using Ajax, so after the Save of the Person, I re-fetch
the Person again from backend and re-rendered the Subject and his Phone
Numbers List.

Certainly it is something how I have done but wanted to give a clearer
picture.

Thanks to every one for their time and attempt to help.
Cheers
niv


On Fri, Dec 3, 2010 at 5:35 PM, vineet semwal vineetsemwal1...@gmail.comwrote:

 afaik problem is you are doing form.getmodelobject(),that form could be
 ajax
 submitted and so you are trying to initialize associate
 collection in different session..

 i don't understand your 1. and 2.
 why are you adding to list when user has not clicked on save ?

 i think adding a new phone number or entry should itself means a new entry
 is persisted and user is shown the new list..


 On Fri, Dec 3, 2010 at 2:29 PM, Nivedan Nadaraj shravann...@gmail.com
 wrote:

  Hi
  Yeah so at present, what I do is when the user
 
  1. Adds a new phone number, I add this to the existing list of
 phoneNumbers
  in the UI but yet to be persisted
  2. User now clicks Save - This saves the Main object ie a Person and
 since
  the new phone number is added to the collection while I save Person the
  enclosed associations (phones) also gets persisted
  3. I now, get the saved Person from backend and re-render the Person
  Information and the list of Phones(including the new one I added)
  4. All fine so far
  5. Now when i navigate /intermittently it breaks.
 
  This is response to your  i think better way would be persisting a
 user's
  new entry  and then showing
  him the actual list which is a reflection of your database..
 
  Cheers for the thoughts
  Niv
 
 
  On Fri, Dec 3, 2010 at 3:48 PM, vineet semwal 
 vineetsemwal1...@gmail.com
  wrote:
 
   afaik,if your collection is lazy ,you will be able to initialize it in
  the
   same session ..
   if you are trying to initialize it in a new/different session you will
  not
   be able to initialize it..
   what i did was making sure that you have a associate collection which
 is
  in
   the same session..
   i think better way would be persisting a user's new entry  and then
  showing
   him the actual list which is a reflection of your database..
  
  
   On Fri, Dec 3, 2010 at 12:50 PM, Nivedan Nadaraj 
 shravann...@gmail.com
   wrote:
  
Vineet
I have not tried that. In this scenario, it will overwrite the
 phone's
   the
user may have added to a list on the UI and is yet to be persisted.
 If
   you
know what I mean.
   
1, Initial fetch of Subject along with his phones ( 5 items)
2. User adds a new phone number to the subject ( 5 + 1 (yet to be
persisted)
3. If user navigates and the load() gets a list of Phones for the
  subject
it
will overwrite the ones user has added.
   
Not sure if that made sense, thanks for your thoughts
Will ping back
Niv
   
   
On Thu, Dec 2, 2010 at 5:43 PM, vineet semwal 
   vineetsemwal1...@gmail.com
wrote:
   
 do you see the exception when you try this?
  @Override
   protected Object load() {
  // return
 containerForm.getModelObject().getPhoneList();
 return service.getRequiredObject(*).getPhoneList(); //or any thing
  like
it
 ..

   }

 On Thu, Dec 2, 2010 at 12:12 PM, Nivedan Nadaraj 
   shravann...@gmail.com
 wrote:

  Hi James
 
  Thanks for the time. I use the CPM for the whole use case.
 Mmm..is
   LDM
  mandatory for such a use case? Am open for thoughts just want the
   best
 way
  to implement it.
  Can you explain a bit further what your thought

Re: Wicket-Hibernate Related LazyInitializationException

2010-12-05 Thread Nivedan Nadaraj
Hi james,

Yes from the DAO after i get the person and his SetPhone I map them into a
ArrayList and is set into a Value Object that is returned to the
client/caller.
On the front end I use this List to render and then update this list based
on user action. When user wants to Save/Update, i map them back into the
hibernate entity Person's SetPhone
and do the Save/Update.

Thanks again for the time.
Niv

On Fri, Dec 3, 2010 at 7:53 PM, James Carman ja...@carmanconsulting.comwrote:

 Why not read the phones into a different list that you edit and
 when you're done, you update the entity.

 On Fri, Dec 3, 2010 at 2:20 AM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
  Vineet
  I have not tried that. In this scenario, it will overwrite the phone's
 the
  user may have added to a list on the UI and is yet to be persisted. If
 you
  know what I mean.
 
  1, Initial fetch of Subject along with his phones ( 5 items)
  2. User adds a new phone number to the subject ( 5 + 1 (yet to be
 persisted)
  3. If user navigates and the load() gets a list of Phones for the subject
 it
  will overwrite the ones user has added.
 
  Not sure if that made sense, thanks for your thoughts
  Will ping back
  Niv
 
 
  On Thu, Dec 2, 2010 at 5:43 PM, vineet semwal 
 vineetsemwal1...@gmail.comwrote:
 
  do you see the exception when you try this?
   @Override
protected Object load() {
   // return containerForm.getModelObject().getPhoneList();
  return service.getRequiredObject(*).getPhoneList(); //or any thing like
 it
  ..
 
}
 
  On Thu, Dec 2, 2010 at 12:12 PM, Nivedan Nadaraj shravann...@gmail.com
  wrote:
 
   Hi James
  
   Thanks for the time. I use the CPM for the whole use case. Mmm..is LDM
   mandatory for such a use case? Am open for thoughts just want the best
  way
   to implement it.
   Can you explain a bit further what your thought was please?
  
   Thank you
   Regards
  
  
  
  
   On Thu, Dec 2, 2010 at 2:13 PM, James Carman 
 ja...@carmanconsulting.com
   wrote:
  
Just make sure your form's model is a LDM too.
   
On Thu, Dec 2, 2010 at 12:23 AM, Nivedan Nadaraj 
  shravann...@gmail.com
wrote:
 Hi All

 I am guessing this is more of a Hibernate thing/issue but if some
 one
   has
 encountered this and has a explanation that I can probably use
 from
  the
 Wicket front would be great.

 https://forum.hibernate.org/viewtopic.php?f=1t=1008473


 I have a LazyIntializationException when i page through some
 items. I
   use
 the PageableListView, the List item(s) are entities that are
  retrieved
via
 an association Person.phones which is  a Set type.
 The funny thing is, the LIException is intermittent. I am also
 using
 OpenSessionInViewFilter. Any thoughts?

 By the way the this is the load() implemenation, I have set the
 Model
 Object's phoneList with a list of values fetched via the
  Service-DAO.
   I
 have used this with other entities without association and it
 works
but
I
 guess is a different scenario(not associations)

 Model = new LoadableDetachableModelObject() {
@Override
protected Object load() {
return
 containerForm.getModelObject().getPhoneList();
}
};
 }

 If someone has any thoughts would appreiciate hearing from you.


 Cheers

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

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




Re: Wicket-Hibernate Related LazyInitializationException

2010-12-05 Thread Nivedan Nadaraj
Hi Eelco

Appreciate your time and thoughts. I guess I am going to look at LDM
approach, since from what yourself,James and Dan have already mentioned
that.
Hmm...well guess you guys have pointed me the required stuff to work on will
get back with more details hopefully with the solution.

Many thanks
Niv



On Sat, Dec 4, 2010 at 9:23 AM, Eelco Hillenius
eelco.hillen...@gmail.comwrote:

 Yep, or least something comparable. You need to re-attach those
 objects you're using to the session somehow, and often the easiest way
 to do that is to just load them again if they were previously
 detached. If you worry about the database being hit more than you
 want, you are probably prematurely optimizing, and if you still worry,
 you should fix this by through Hibernate's (or your own) second level
 cache, not by keeping your model objects inflated between requests.

 As a general rule, something we often repeat on this list, if you work
 with Hibernate managed objects in Wicket models, use detachable models
 (LDM is a common one) and make sure that these objects are 'deflated'
 between requests, meaning that e.g. you only keep references to their
 ids, or e.g. the algorithm to get the objects back again when needed.

 Eelco


 On Wed, Dec 1, 2010 at 10:13 PM, James Carman
 ja...@carmanconsulting.com wrote:
  Just make sure your form's model is a LDM too.
 
  On Thu, Dec 2, 2010 at 12:23 AM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
  Hi All
 
  I am guessing this is more of a Hibernate thing/issue but if some one
 has
  encountered this and has a explanation that I can probably use from the
  Wicket front would be great.
 
  https://forum.hibernate.org/viewtopic.php?f=1t=1008473
 
 
  I have a LazyIntializationException when i page through some items. I
 use
  the PageableListView, the List item(s) are entities that are retrieved
 via
  an association Person.phones which is  a Set type.
  The funny thing is, the LIException is intermittent. I am also using
  OpenSessionInViewFilter. Any thoughts?
 
  By the way the this is the load() implemenation, I have set the Model
  Object's phoneList with a list of values fetched via the Service-DAO. I
  have used this with other entities without association and it works  but
 I
  guess is a different scenario(not associations)
 
  Model = new LoadableDetachableModelObject() {
 @Override
 protected Object load() {
 return containerForm.getModelObject().getPhoneList();
 }
 };
  }
 
  If someone has any thoughts would appreiciate hearing from you.
 
 
  Cheers
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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




Re: Wicket-Hibernate Related LazyInitializationException

2010-12-03 Thread Nivedan Nadaraj
Hi
Yeah so at present, what I do is when the user

1. Adds a new phone number, I add this to the existing list of phoneNumbers
in the UI but yet to be persisted
2. User now clicks Save - This saves the Main object ie a Person and since
the new phone number is added to the collection while I save Person the
enclosed associations (phones) also gets persisted
3. I now, get the saved Person from backend and re-render the Person
Information and the list of Phones(including the new one I added)
4. All fine so far
5. Now when i navigate /intermittently it breaks.

This is response to your  i think better way would be persisting a user's
new entry  and then showing
him the actual list which is a reflection of your database..

Cheers for the thoughts
Niv


On Fri, Dec 3, 2010 at 3:48 PM, vineet semwal vineetsemwal1...@gmail.comwrote:

 afaik,if your collection is lazy ,you will be able to initialize it in the
 same session ..
 if you are trying to initialize it in a new/different session you will not
 be able to initialize it..
 what i did was making sure that you have a associate collection which is in
 the same session..
 i think better way would be persisting a user's new entry  and then showing
 him the actual list which is a reflection of your database..


 On Fri, Dec 3, 2010 at 12:50 PM, Nivedan Nadaraj shravann...@gmail.com
 wrote:

  Vineet
  I have not tried that. In this scenario, it will overwrite the phone's
 the
  user may have added to a list on the UI and is yet to be persisted. If
 you
  know what I mean.
 
  1, Initial fetch of Subject along with his phones ( 5 items)
  2. User adds a new phone number to the subject ( 5 + 1 (yet to be
  persisted)
  3. If user navigates and the load() gets a list of Phones for the subject
  it
  will overwrite the ones user has added.
 
  Not sure if that made sense, thanks for your thoughts
  Will ping back
  Niv
 
 
  On Thu, Dec 2, 2010 at 5:43 PM, vineet semwal 
 vineetsemwal1...@gmail.com
  wrote:
 
   do you see the exception when you try this?
@Override
 protected Object load() {
// return containerForm.getModelObject().getPhoneList();
   return service.getRequiredObject(*).getPhoneList(); //or any thing like
  it
   ..
  
 }
  
   On Thu, Dec 2, 2010 at 12:12 PM, Nivedan Nadaraj 
 shravann...@gmail.com
   wrote:
  
Hi James
   
Thanks for the time. I use the CPM for the whole use case. Mmm..is
 LDM
mandatory for such a use case? Am open for thoughts just want the
 best
   way
to implement it.
Can you explain a bit further what your thought was please?
   
Thank you
Regards
   
   
   
   
On Thu, Dec 2, 2010 at 2:13 PM, James Carman 
  ja...@carmanconsulting.com
wrote:
   
 Just make sure your form's model is a LDM too.

 On Thu, Dec 2, 2010 at 12:23 AM, Nivedan Nadaraj 
   shravann...@gmail.com
 wrote:
  Hi All
 
  I am guessing this is more of a Hibernate thing/issue but if some
  one
has
  encountered this and has a explanation that I can probably use
 from
   the
  Wicket front would be great.
 
  https://forum.hibernate.org/viewtopic.php?f=1t=1008473
 
 
  I have a LazyIntializationException when i page through some
 items.
  I
use
  the PageableListView, the List item(s) are entities that are
   retrieved
 via
  an association Person.phones which is  a Set type.
  The funny thing is, the LIException is intermittent. I am also
  using
  OpenSessionInViewFilter. Any thoughts?
 
  By the way the this is the load() implemenation, I have set the
  Model
  Object's phoneList with a list of values fetched via the
   Service-DAO.
I
  have used this with other entities without association and it
 works
 but
 I
  guess is a different scenario(not associations)
 
  Model = new LoadableDetachableModelObject() {
 @Override
 protected Object load() {
 return
  containerForm.getModelObject().getPhoneList();
 }
 };
  }
 
  If someone has any thoughts would appreiciate hearing from you.
 
 
  Cheers
 


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


   
  
  
  
   --
   regards,
   Vineet Semwal
  
 



 --
 regards,
 Vineet Semwal



Re: Wicket-Hibernate Related LazyInitializationException

2010-12-03 Thread Nivedan Nadaraj
Dan,

Thanks mate. I am yet to digest all that. I am going to get back to you and
see if it all helped.

Thank you for the time
Cheers
niv

On Fri, Dec 3, 2010 at 1:06 AM, Dan Retzlaff dretzl...@gmail.com wrote:

 Yes, copying entities from the entity's association collection into another
 collection will initialize the collection. If you're still getting an LIE,
 there may be another association at play (a child of Phone?).

 Note that I don't fully endorse the session reattachment aspect I posted.
 Not only is weaving those Hibernate classes a little tricky and a lot of
 hacky, it can cause undesirable amounts of entities to be added into the
 session. James' suggestion of putting the collection behind a Wicket model
 is more elegant. To this end, you might develop a utility which, given a
 list of Persons, returns an IModelListPerson while storing only their
 IDs in the session. In the following code, BasicDao.getIdentifier() and
 BasicDao.get() simply map to Hibernate Session methods of the same name for
 entity class T.

 public static T IModelListT createListModelFromObjects(final
 BasicDaoT dao, ListT objectList) {
 final ListSerializable idList = new
 ArrayListSerializable(objectList.size());
 for (T object : objectList) {
 idList.add(dao.getIdentifier(object));
 }
  return new LoadableDetachableModelListT(objectList) {
 @Override
 protected ListT load() {
 return loadList(dao, idList);
 }
 };
 }

 private static T ListT loadList(BasicDaoT dao, List? extends
 Serializable idList) {
 ListT loadList = new ArrayListT(idList.size());
 for (Serializable id : idList) {
 loadList.add(dao.get(id));
 }
 return loadList;
 }


 On Wed, Dec 1, 2010 at 10:26 PM, Nivedan Nadaraj shravann...@gmail.com
 wrote:

  Hi Dan,
 
  Thanks for your time most appreciated.
 
  1. Option 1 as you may agree, not always is a good thing to do so I would
  drop that.
 
  2. Option 2 - I have tried this in the following manner.
 
  As part of the look up for the Subjects via the DAO, I iterate through
 the
  list of Person.Phones collection and assign them into a
 CollectionPhones
  and set it into a value Object with has a List. This is because i cannot
  use
  the Set in the PageableListView. In doing so, I have forced the entities
 in
  the collection/proxy to be intialised isn't it? Looks like even with this
  it
  beats me.
 
  3. Option 3 - I have to read up more on how I can use this code/or
  something
  similar, we use Spring for DI.
 
  Further, each time I want to view a Person detail, I do a second look up
  when the user clicks from a list of Persons. I send issue a lookup into
 the
  DAO to get the Person's details afresh(the exact same method I used to
 list
  all Subjects in the first place), so this again would have refreshed the
  Phones collection on the Person in context.
 
  I will try to track it down I guess it has to do with session anyway. I
  also
  use the CPM to hold the Model for the whole page. Not a LDM.
 
  Thanks again for the time
  Cheers
  Niv
 
 
  On Thu, Dec 2, 2010 at 1:47 PM, Dan Retzlaff dretzl...@gmail.com
 wrote:
 
   Hi Nivedan,
  
   Even though the subsequent requests have a Session open, the entities
  with
   the uninitialized collections don't know about it. I'm sure if you
 track
  it
   down, you can explain the intermittent behavior by prior access to
 the
   collection when the original session is open.
  
   I'd say you can either (1) configure Hibernate to load the collections
 to
   load unlazily, (2) manually access the collections to force them to
   initialize in the specific cases you're encountering LIEs, or (3)
 employ
   some kind of AOP hack to reinject the new session right before the
   collection is accessed. They're all kind of ugly, and I've never heard
 of
   anyone else doing the last, but it's been working well for my team.
  
   For your reference, here is the AspectJ aspect I wrote. (We use Guice
 for
   dependency injection.)
  
   /**
* Reattaches entities whose lazy collections are about to be
 initialized
* p
* Can we keep track of all lazy relationships that get initialized,
 and
* uninitialize them at the end of the request? This would prevent
   referenced
* entities from being serialized and replicated (unless separate
   references
* were created to them).
*
* @author dan
*/
   @Aspect
   public class ReattachAspect {
   private static final Logger LOG =
 Logger.getLogger(ReattachAspect.class);
  
   private ProviderSession sessionProvider;
  
   @Before(call(public final void
   org.hibernate.proxy.AbstractLazyInitializer.initialize()) 
   target(initializer))
   public void reattachLazyInitializer(LazyInitializer initializer) {
   if (initializer.getSession() == null  sessionProvider != null) {
   if (LOG.isDebugEnabled()) {
   LOG.debug(reattaching session to lazy initializer for  +
   initializer.getEntityName());
   }
   Session session = sessionProvider.get();
   initializer.setSession((SessionImplementor

Re: Wicket-Hibernate Related LazyInitializationException

2010-12-02 Thread Nivedan Nadaraj
Vineet
I have not tried that. In this scenario, it will overwrite the phone's the
user may have added to a list on the UI and is yet to be persisted. If you
know what I mean.

1, Initial fetch of Subject along with his phones ( 5 items)
2. User adds a new phone number to the subject ( 5 + 1 (yet to be persisted)
3. If user navigates and the load() gets a list of Phones for the subject it
will overwrite the ones user has added.

Not sure if that made sense, thanks for your thoughts
Will ping back
Niv


On Thu, Dec 2, 2010 at 5:43 PM, vineet semwal vineetsemwal1...@gmail.comwrote:

 do you see the exception when you try this?
  @Override
   protected Object load() {
  // return containerForm.getModelObject().getPhoneList();
 return service.getRequiredObject(*).getPhoneList(); //or any thing like it
 ..

   }

 On Thu, Dec 2, 2010 at 12:12 PM, Nivedan Nadaraj shravann...@gmail.com
 wrote:

  Hi James
 
  Thanks for the time. I use the CPM for the whole use case. Mmm..is LDM
  mandatory for such a use case? Am open for thoughts just want the best
 way
  to implement it.
  Can you explain a bit further what your thought was please?
 
  Thank you
  Regards
 
 
 
 
  On Thu, Dec 2, 2010 at 2:13 PM, James Carman ja...@carmanconsulting.com
  wrote:
 
   Just make sure your form's model is a LDM too.
  
   On Thu, Dec 2, 2010 at 12:23 AM, Nivedan Nadaraj 
 shravann...@gmail.com
   wrote:
Hi All
   
I am guessing this is more of a Hibernate thing/issue but if some one
  has
encountered this and has a explanation that I can probably use from
 the
Wicket front would be great.
   
https://forum.hibernate.org/viewtopic.php?f=1t=1008473
   
   
I have a LazyIntializationException when i page through some items. I
  use
the PageableListView, the List item(s) are entities that are
 retrieved
   via
an association Person.phones which is  a Set type.
The funny thing is, the LIException is intermittent. I am also using
OpenSessionInViewFilter. Any thoughts?
   
By the way the this is the load() implemenation, I have set the Model
Object's phoneList with a list of values fetched via the
 Service-DAO.
  I
have used this with other entities without association and it works
   but
   I
guess is a different scenario(not associations)
   
Model = new LoadableDetachableModelObject() {
   @Override
   protected Object load() {
   return containerForm.getModelObject().getPhoneList();
   }
   };
}
   
If someone has any thoughts would appreiciate hearing from you.
   
   
Cheers
   
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 



 --
 regards,
 Vineet Semwal



Wicket-Hibernate Related LazyInitializationException

2010-12-01 Thread Nivedan Nadaraj
Hi All

I am guessing this is more of a Hibernate thing/issue but if some one has
encountered this and has a explanation that I can probably use from the
Wicket front would be great.

https://forum.hibernate.org/viewtopic.php?f=1t=1008473


I have a LazyIntializationException when i page through some items. I use
the PageableListView, the List item(s) are entities that are retrieved via
an association Person.phones which is  a Set type.
The funny thing is, the LIException is intermittent. I am also using
OpenSessionInViewFilter. Any thoughts?

By the way the this is the load() implemenation, I have set the Model
Object's phoneList with a list of values fetched via the Service-DAO. I
have used this with other entities without association and it works  but I
guess is a different scenario(not associations)

Model = new LoadableDetachableModelObject() {
@Override
protected Object load() {
return containerForm.getModelObject().getPhoneList();
}
};
}

If someone has any thoughts would appreiciate hearing from you.


Cheers


Re: Wicket-Hibernate Related LazyInitializationException

2010-12-01 Thread Nivedan Nadaraj
Hi Dan,

Thanks for your time most appreciated.

1. Option 1 as you may agree, not always is a good thing to do so I would
drop that.

2. Option 2 - I have tried this in the following manner.

As part of the look up for the Subjects via the DAO, I iterate through the
list of Person.Phones collection and assign them into a CollectionPhones
and set it into a value Object with has a List. This is because i cannot use
the Set in the PageableListView. In doing so, I have forced the entities in
the collection/proxy to be intialised isn't it? Looks like even with this it
beats me.

3. Option 3 - I have to read up more on how I can use this code/or something
similar, we use Spring for DI.

Further, each time I want to view a Person detail, I do a second look up
when the user clicks from a list of Persons. I send issue a lookup into the
DAO to get the Person's details afresh(the exact same method I used to list
all Subjects in the first place), so this again would have refreshed the
Phones collection on the Person in context.

I will try to track it down I guess it has to do with session anyway. I also
use the CPM to hold the Model for the whole page. Not a LDM.

Thanks again for the time
Cheers
Niv


On Thu, Dec 2, 2010 at 1:47 PM, Dan Retzlaff dretzl...@gmail.com wrote:

 Hi Nivedan,

 Even though the subsequent requests have a Session open, the entities with
 the uninitialized collections don't know about it. I'm sure if you track it
 down, you can explain the intermittent behavior by prior access to the
 collection when the original session is open.

 I'd say you can either (1) configure Hibernate to load the collections to
 load unlazily, (2) manually access the collections to force them to
 initialize in the specific cases you're encountering LIEs, or (3) employ
 some kind of AOP hack to reinject the new session right before the
 collection is accessed. They're all kind of ugly, and I've never heard of
 anyone else doing the last, but it's been working well for my team.

 For your reference, here is the AspectJ aspect I wrote. (We use Guice for
 dependency injection.)

 /**
  * Reattaches entities whose lazy collections are about to be initialized
  * p
  * Can we keep track of all lazy relationships that get initialized, and
  * uninitialize them at the end of the request? This would prevent
 referenced
  * entities from being serialized and replicated (unless separate
 references
  * were created to them).
  *
  * @author dan
  */
 @Aspect
 public class ReattachAspect {
 private static final Logger LOG = Logger.getLogger(ReattachAspect.class);

 private ProviderSession sessionProvider;

 @Before(call(public final void
 org.hibernate.proxy.AbstractLazyInitializer.initialize()) 
 target(initializer))
 public void reattachLazyInitializer(LazyInitializer initializer) {
 if (initializer.getSession() == null  sessionProvider != null) {
 if (LOG.isDebugEnabled()) {
 LOG.debug(reattaching session to lazy initializer for  +
 initializer.getEntityName());
 }
 Session session = sessionProvider.get();
 initializer.setSession((SessionImplementor) session);
 }
 }

 @Before(call(private void
 org.hibernate.collection.AbstractPersistentCollection
 + .throwLazyInitializationExceptionIfNotConnected()) 
 target(collection))
 public void reattachPersistentCollection(PersistentCollection collection) {
 SessionImplementor session = ((AbstractPersistentCollection)
 collection).getSession();
 if ((session == null || !session.isOpen())  sessionProvider != null) {
 if (LOG.isDebugEnabled()) {
 LOG.debug(reattaching session to collection);
 }

 session = (SessionImplementor) sessionProvider.get();
 CollectionPersister persister =
 session.getFactory().getCollectionPersister(collection.getRole());

 collection.setCurrentSession(session);
 session.getPersistenceContext().addInitializedDetachedCollection(persister,
 collection);
 }
 }

 @Inject
 public void setSessionProvider(ProviderSession sessionProvider) {
 this.sessionProvider = sessionProvider;
 }
 }


 On Wed, Dec 1, 2010 at 9:23 PM, Nivedan Nadaraj shravann...@gmail.com
 wrote:

  Hi All
 
  I am guessing this is more of a Hibernate thing/issue but if some one has
  encountered this and has a explanation that I can probably use from the
  Wicket front would be great.
 
  https://forum.hibernate.org/viewtopic.php?f=1t=1008473
 
 
  I have a LazyIntializationException when i page through some items. I use
  the PageableListView, the List item(s) are entities that are retrieved
 via
  an association Person.phones which is  a Set type.
  The funny thing is, the LIException is intermittent. I am also using
  OpenSessionInViewFilter. Any thoughts?
 
  By the way the this is the load() implemenation, I have set the Model
  Object's phoneList with a list of values fetched via the Service-DAO. I
  have used this with other entities without association and it works  but
 I
  guess is a different scenario(not associations)
 
  Model = new LoadableDetachableModelObject() {
 @Override

Re: Wicket-Hibernate Related LazyInitializationException

2010-12-01 Thread Nivedan Nadaraj
Hi James

Thanks for the time. I use the CPM for the whole use case. Mmm..is LDM
mandatory for such a use case? Am open for thoughts just want the best way
to implement it.
Can you explain a bit further what your thought was please?

Thank you
Regards




On Thu, Dec 2, 2010 at 2:13 PM, James Carman ja...@carmanconsulting.comwrote:

 Just make sure your form's model is a LDM too.

 On Thu, Dec 2, 2010 at 12:23 AM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
  Hi All
 
  I am guessing this is more of a Hibernate thing/issue but if some one has
  encountered this and has a explanation that I can probably use from the
  Wicket front would be great.
 
  https://forum.hibernate.org/viewtopic.php?f=1t=1008473
 
 
  I have a LazyIntializationException when i page through some items. I use
  the PageableListView, the List item(s) are entities that are retrieved
 via
  an association Person.phones which is  a Set type.
  The funny thing is, the LIException is intermittent. I am also using
  OpenSessionInViewFilter. Any thoughts?
 
  By the way the this is the load() implemenation, I have set the Model
  Object's phoneList with a list of values fetched via the Service-DAO. I
  have used this with other entities without association and it works  but
 I
  guess is a different scenario(not associations)
 
  Model = new LoadableDetachableModelObject() {
 @Override
 protected Object load() {
 return containerForm.getModelObject().getPhoneList();
 }
 };
  }
 
  If someone has any thoughts would appreiciate hearing from you.
 
 
  Cheers
 

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




CRUD Operation on a List View or Grid View

2010-11-22 Thread Nivedan Nadaraj
Hi All,

I am starting to build a component that allows to add, edit and delete items
into/from a List/Grid view.
The use case is where we want to add multiple phone/address items as part of
adding a contact.

- User enters  Contact related details
- User gets a list of pre-existing(if any) Phone numbers that he then
selects to edit like in a data grid
- User can also add multiple numbers by clicking Add button.
- User clicks on Save button that saves the contact details and associates
the phone numbers with the contact. (If user has removed an item that is
also updated)

The way I plan to do it is to  use the CRUD pattern.

- A List displays pre-existing phone numbers.
- Add new button displays a detail page, where user can enter the new number
details and click Ok or Done
- OnOk or OnDone the item is added to the pre-existing List and the repeater
is refreshed to display the new item.
- On the same lines user can edit an item from the list.

I feel i am rebuilding something that already is built or can be extended. I
looked at the examples of editable Datagrid but I guess it does not by
default offer a 'Add new' item to the list.

Has someone extended Datagrid to provide this functionality or is there one
available part of Wicket or WicketStuff?
Can someone suggest if the approach am about to take worth the time or
should I look at DataGrid functionality?

Would appreciate any thoughts design approaches on this topic.

Many thanks
Niv


Re: Integrating Separate Different Wicket Applications Into One

2010-10-12 Thread Nivedan Nadaraj
I implemented/integrated a sub-module(s) into one main web application.
The solution is discussed in the link below. Hope this helps.

http://apache-wicket.1842946.n4.nabble.com/Re-Using-Wicket-to-build-Application-Portal-td2248912.html#a2248912

Cheers


On Tue, Oct 12, 2010 at 11:28 AM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Hi

 When you say integrate different applications, do u mean each one is a
 sub-application? Do those applications extend the WicketApplication class?
 If they don't then I have had some experience to integrate sub-modules into
 one main application. Let me know if that is what you mean. Otherwise I
 guess some of the experts here would help out.

 Cheers



 On Tue, Oct 12, 2010 at 2:06 AM, kugaprakash kvisagam...@infoblox.comwrote:


 Hi,
 Can you please let me know?
 thanks
 Kuga
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Integrating-Separate-Different-Wicket-Applications-Into-One-tp1889319p2990281.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: Integrating Separate Different Wicket Applications Into One

2010-10-11 Thread Nivedan Nadaraj
Hi

When you say integrate different applications, do u mean each one is a
sub-application? Do those applications extend the WicketApplication class?
If they don't then I have had some experience to integrate sub-modules into
one main application. Let me know if that is what you mean. Otherwise I
guess some of the experts here would help out.

Cheers


On Tue, Oct 12, 2010 at 2:06 AM, kugaprakash kvisagam...@infoblox.comwrote:


 Hi,
 Can you please let me know?
 thanks
 Kuga
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Integrating-Separate-Different-Wicket-Applications-Into-One-tp1889319p2990281.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: Coding - On Software Design Process

2010-10-06 Thread Nivedan Nadaraj
Hi John,

Thanks will wait for the paperback.
Cheers
Niv

On Mon, Oct 4, 2010 at 11:10 PM, John Owen jo...@globalscape.com wrote:

 Or iPhone/iPad.

 -Original Message-
 From: Jonathan Locke [mailto:jonathan.lo...@gmail.com]
 Sent: Saturday, October 02, 2010 7:17 PM
 To: users@wicket.apache.org
 Subject: Re: Coding - On Software Design Process


 You can always read it on your Mac or PC (there's a free Kindle reader).
 Also, there will be a print book. It's just been delayed a bit by some
 printer issues.
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Coding-On-Software-Design-Process-tp2720854p2952828.html
 Sent from the Users forum mailing list archive at Nabble.com.

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


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




Re Palette

2010-09-29 Thread Nivedan Nadaraj
Hi All,

I have used the Palette successfully in another scenario where it was pretty
straightforward, in that the bean/pojo has a selectedItmes and
availableItems property on the bean. That was nice and clean and would like
to do the same in the scenario below. If someone has any ideas do let  me
know.

Will describe the POJOS and what I want to achive..

The Pojos:


public class RoleVO implements Serializable {

  private String roleName;
  //  .. Getters and setters
}

public class ModuleVO implements Serializable{

  private String moduleName;
  private ListRoleVO selectedRoles;

  //  .. Getters and setters
}


public class ModuleRoleVO implements Serializable{

  private ListModuleVO selectedModules;//Represents the user
associated modules and their roles

  private ListModuleVO availableModules; //The list of choices

}


Lets say the ModuleRoleVO.availableModules list contains the following
items/data:

Module-A and contains Role-A and Role-B

Module-B and contains Role-A2 and Role-A3

and Assuming that ModuleRoleVO.selectedModules list contains only one item

Module-A and it contains Role-A and Role-B


I currently build a Wiquery based Accordion control and each Panel of the
accordion uses the ModuleRoleVO.availableModules to render the
header/section name of the Accordion Panel.

So the Accordion would be rendered like this.

Module-A  -- Section 1 of accordion



Module-B-- Section 2 of accordion


Now within each of the accordion Panel I want to insert the Palette control
that should display the available roles and selected roles for the module *
linked* with the section.

like so

*Module-A*

Available RolesSelected Roles

Role-A
Role-B


*Module-B*

Available RolesSelected Roles

Role-A2
Role-A3

I would like to achieve the above and maintain the selected choices in the
model across submits.


What I have achieved so far and my doubt...

I  got to the point where I render the accordion with the respective module
names and add the palette within it.

I provide the list of available roles for the module as a PropertyModel into
the Palette. I do the same, as in provide the selected roles by comparing
the module name in the list of selectedModules list and if found get the
list of roles and build a PropertyModel and pass it to the palette. However
all this happens manually at initialization of the Palette. Once I submit
the values the selected items of each Paletted is infered by me manually and
then I pass it to be persisted. After it persits, the Palette loses the
selected choices. The reason being its not bound properly with the Model. If
it can infer the values from the bean it would be right. But I am missing
something here or maybe I gott to apporach it differently.

A Snippet of the code that builds the listview for the Accordion and
initialization of the Palette.

ListView sectionListView = new ListView(Constants.ACCORDION_SECTION,
containerForm.getModelObject().getAvailableModules()){
/**
 *
 */
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem listItem) {

ModuleVO availableModuleVO =
((ModuleVO)listItem.getDefaultModelObject());

Label sectionName = new
Label(Constants.ACCORDION_SECTION_NAME_LBL, availableModuleVO.getModule());
listItem.setRenderBodyOnly(true);//Excludes excess tags on
the markup
listItem.add(sectionName);

String displayModule;
ModuleVO selectedModuleVO = new ModuleVO();

//Match the available Module name with the user associated
module list
for(ModuleVO userModule :membershipModules){
 displayModule =
UIHelper.getDisplayModuleName(userModule.getModule());
if(displayModule.equals(availableModuleVO.getModule())){
selectedModuleVO = userModule;
break;
}
}

Palette rolePalette =
initialiseRolePalette(containerForm,selectedModuleVO,availableModuleVO);
listItem.add(rolePalette);
}
};

moduleAccordion.add(sectionListView);
appRoleForm.add(moduleAccordion);//Add the accordion to the form
add(appRoleForm);
}


   private Palette initialiseRolePalette(ContainerForm containerForm,
ModuleVO selectedModuleVO, ModuleVO availableModuleVO){

CompoundPropertyModelModuleRoleVO moduleRoleCPM =
(CompoundPropertyModelModuleRoleVO)containerForm.getModel();
IChoiceRendererString renderer = new
ChoiceRendererString(role, role);
PropertyModelListRoleVO availableRoleChoicesPM = new
PropertyModelListRoleVO(availableModuleVO,role);
PropertyModelListRoleVO selectedRolesPM = new

Asynchronous File Uploads

2010-09-16 Thread Nivedan Nadaraj
Hi All

Has anyone had a requirement to upload huge files in an asynchronous mode? I
want to be able to upload some files which are on avg 4G plus.
I read some posts that wicket does fine with 50 plus megs. Since these are
huge files, we dont want the user to be blocked. Instead was thinking
kicking off a Job that takes these files and then notifies the user.

If wicket application can be configured to upload these files makes it easy
with just the file upload without a-synching, But if there is an elegant
solution can someone share their experiences?

Many thanks
Niv


Re: DropDownChoice does not push value into Model

2010-08-17 Thread Nivedan Nadaraj
Hi James

protected void doLookup(AjaxRequestTarget target, Study studyReference);

I really do not need this studyReference. That was just a test I wanted to
do. It is the study reference that is used to populate the dropdown. I
wanted to see if it gets changed with each submit. I noticed that it does
not change.

I do get the ModelObject -
   StudyContainer studyContainer  =  (StudyContainer)this.getModelObject();

So yeah it works with this change, using PropertyModel. Wanted to get your
feedback if I have used it correctly.
Cheers
Niv



On Tue, Aug 17, 2010 at 7:48 PM, James Carman ja...@carmanconsulting.comwrote:

 In your onSubmit() method, you're referring to the local variable
 studyReference.  Why not try getting the model value while inside
 the method?

 On Tue, Aug 17, 2010 at 6:04 AM, nivs shravann...@gmail.com wrote:
 
  Hi James
 
  Point(s) noted. I have got something going here and it is working but is
  this what you meant? Please see attached code and do bear with my
 questions.
 
  The variable studyReference which is the one that is wrapped within a
  PropertyModel, remains or maintains the same reference even if the object
  model is changed. So that is the key I suppose not to change the study
  reference bound to the DDC any time and we wrap this in a property model.
 
  Still have to get to grips with Models.
 
  Thanks for the help
  Cheers
  Niv
 
  /* Form that contains the dropdown other form fields*/
  public class LookupForm extends Form{
 
 private TextFieldString studyName;
 private TextFieldString chiefName;
 private AjaxButton lookupButton;
 private DropDownChoiceStudyStatus studyStatusDpChoices;
 
 
 
 public LookupForm(String id,ModelStudyContainer model){
 super(id,model);
 }
 public void initForm(){
 
 ModelStudyContainer studyContainerModel =
 (Model)getModel();
 
 //Create a propertyModel to bind the components of this
 form, the root which is StudyContainer
 PropertyModelStudy pm = new
 PropertyModelStudy(studyContainerModel,study);
 
 //Just to know what the initial study reference is
 final Study studyReference  = pm.getObject();
 
 studyName = new TextField(studyName,new
 PropertyModelString(pm,studyName));//Create another new PropertyModel of
 type Study
 chiefName = new TextField(chiefName, new
 PropertyModelString(pm,chiefName));
 
 lookupButton = new AjaxButton(search){
 @Override
 protected void onSubmit(AjaxRequestTarget target,
 Form? form) {
 ModelStudyContainer iModel  =
 (Model)getModel();
 doLookup(target,studyReference);
 }
 };
 
 
 ChoiceRenderer defaultChoiceRenderer = new
 ChoiceRenderer(name, studyStatusKey);
 
 //Another PropertyModel for rendering the DropDowns and
 pass in the Property Model instance of type Study
 PropertyModelStudy pmStudyStatus = new
 PropertyModelStudy(pm,studyStatus);
 
 //Static list
 ListStudyStatus studyStatusList = new
 ArrayListStudyStatus();
 StudyStatus ss = new StudyStatus();
 ss.setName(Active);
 ss.setStudyStatusKey(new Long(1));
 studyStatusList.add(ss);
 ss = new StudyStatus();
 ss.setName(Inactive);
 ss.setStudyStatusKey(new Long(2));
 studyStatusList.add(ss);
 
 studyStatusDpChoices = new
 DropDownChoice(studyStatusDDC,pmStudyStatus,studyStatusList,defaultChoiceRenderer);
 
 add(studyName);
 add(chiefName);
 add(studyStatusDpChoices);
 add(lookupButton);
 }
 
 protected void doLookup(AjaxRequestTarget target, Study study){}
 
  }
 
 
 
  public class Lookup extends Panel{
 
 ModelStudyContainer studyContainerModel;
 public Lookup(String id) {
 super(id);
 }
 public void initialise(){
 
 studyContainerModel = new ModelStudyContainer( new
 StudyContainer());
 
 LookupForm lookupForm = new LookupForm(lookupForm,
 studyContainerModel){
 
 protected void doLookup(AjaxRequestTarget target,
 Study studyReference){
 
 
 StudyContainer studyContainer  =
  (StudyContainer)this.getModelObject();
 
 //Get the currently populates study info
 Study currentStudy =
 studyContainer.getStudy();
 
 
  System.out.println(currentStudy.getChiefName());
 
 StudyStatus status =
 currentStudy.getStudyStatus();
 

Re: Re Wicket Web Beans

2010-08-17 Thread Nivedan Nadaraj
Hi

Thanks for that Nick. I guess I will investigate more on this, actually i
did get to lookup Dynamic Forms and then linked to WWB.
I will do some homework on this topic and bounce any questions. Thanks for
that
Niv

On Tue, Aug 17, 2010 at 11:11 AM, Nick Heudecker nheudec...@gmail.comwrote:

 It sounds like what you're after is a dynamic form.  This has been
 discussed
 several times on the list and used to be detailed in the wiki.  It's pretty
 straightforward to implement.  Hopefully this gives you an implementation
 option.


 On Mon, Aug 16, 2010 at 7:17 PM, Nivedan Nadaraj shravann...@gmail.com
 wrote:

  Hi Daniel
 
  Thank you for getting back so quickly.
 
  I used Hibernate that maps to entities in the table.
 
 
  Fields are defined by an administrator when he creates a new entity like
  Study(Hibernate entity for Study). There is a standard table called Study
  however if the administrator feels this new study he is creating requires
  additional fields he then will do the following
 
  Create Scenario:
 
  1. Click a button to add new field
  2. Provides the Field Name (either types it in or selects from  a list of
  data dictionary fields)
  3. Selects a data type from a drop down ( I have created this table with
  required data types so this can be sourced)
  4. Enters a value for the new field.
  5. Optionally, he must be able to provide the type of control this field
  will be linkedf to ( guess #4 and 5 are inter-related) or can WWB infer
  this? Not sure about this part.
  6. On Save - The New field meta data is stored along with the data in
  another table that links to this meta data table.
 
  View/Edit Scenario:
 
  When a user reads or looks up this entity, it should bring back the
 general
  fields and the custom fields that were defined. Now, the UI should be
  rendered.
  Will I be able to use WWB in this scenario?
 
 
  I guess if I don't use WWB then, i have to stored field UI meta data
 along
  with values in separate tables and infer this when the UI is rendered.
 Will
  be quite a task.
 
  Thanks for your time Dan, I was planning on playing with WWB and see if
 my
  requirements can be met using WWB.
 
  Reg
  Niv
 
 
 
 



Re: Re Wicket Web Beans

2010-08-17 Thread Nivedan Nadaraj
Hi Daniel

It is more of a dynamic form thinking of it I might investigate more on this
in Wicket. But here is a link and is pretty much what we want to achieve
using wicket

https://redcap.vanderbilt.edu/consortium/videoplayer.php?video=form_editor_fields01.flvtitle=The+Online+Form+Editor+-+in+depth+%285+min%29text=referer=REDCAP_PUBLIC

If you have done either using Wicket or WWB please let me know.

Thanks
Niv

On Tue, Aug 17, 2010 at 11:32 AM, Daniel Toffetti dto...@yahoo.com.arwrote:


 Hi Niv,

I'm not sure if I just get your domain model right, the closest I think
 you can get is something like this:


 http://jweekend.com/wicketwebbeans-examples-1.1/WebBeans/?wicket:interface=:0:2:
 ::

Where you can have a list (a table) of fields, each with a name, a
 datatype and a value. But all values in each column will be represented
 with
 one single type of input field.
Perhaps you can attempt to create a custom field for the value
 property, that renders a different input for each datatype, but I'm not
 sure
 if this can be done at all.
One problem is, how to re-render the input if the datatype changes ?
 Don't think WWB allows that easily.

 Cheers,

 Daniel

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Re-Wicket-Web-Beans-tp2326481p2327733.html
 Sent from the Wicket - User 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: Re Wicket Web Beans

2010-08-16 Thread Nivedan Nadaraj
Hi Daniel

Thank you for getting back so quickly.

I used Hibernate that maps to entities in the table.


Fields are defined by an administrator when he creates a new entity like
Study(Hibernate entity for Study). There is a standard table called Study
however if the administrator feels this new study he is creating requires
additional fields he then will do the following

Create Scenario:

1. Click a button to add new field
2. Provides the Field Name (either types it in or selects from  a list of
data dictionary fields)
3. Selects a data type from a drop down ( I have created this table with
required data types so this can be sourced)
4. Enters a value for the new field.
5. Optionally, he must be able to provide the type of control this field
will be linkedf to ( guess #4 and 5 are inter-related) or can WWB infer
this? Not sure about this part.
6. On Save - The New field meta data is stored along with the data in
another table that links to this meta data table.

View/Edit Scenario:

When a user reads or looks up this entity, it should bring back the general
fields and the custom fields that were defined. Now, the UI should be
rendered.
Will I be able to use WWB in this scenario?


I guess if I don't use WWB then, i have to stored field UI meta data along
with values in separate tables and infer this when the UI is rendered. Will
be quite a task.

Thanks for your time Dan, I was planning on playing with WWB and see if my
requirements can be met using WWB.

Reg
Niv




On Tue, Aug 17, 2010 at 1:13 AM, Daniel Toffetti dto...@yahoo.com.arwrote:


Where does your fields come from ?  In WWB, you have to provide beans,
 and configure them with annotations or beanprops files to control the way
 the beans are displayed.
You can provide beans and they will be correctly displayed in a default
 way, with proper editing inputs according to the datatype of each field.
 But
 both the beans and the (optional) configurations need to be coded, you will
 not be able to provide WWB with a stream of isolated fields.
Regarding validations, some are provided by WWB itself (required),
 anything else will be rather hard to add with standard WWB, but you can
 provide customized input field implementations (see customfields example).
 Of course those custom fields will not be used by default, you will have to
 configure the properties to use them.

See live examples here:

 http://jweekend.com/wicketwebbeans-examples-1.1/WebBeans/

And the source code for the examples here:


 http://code.google.com/p/wicket-web-beans/source/browse/#svn/trunk/wicketwebbeans-examples/src/main/java/com/googlecode/wicketwebbeans/examples

 Hth,

 Daniel

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Re-Wicket-Web-Beans-tp2326481p2327195.html
 Sent from the Wicket - User 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: Ajax-Panel Toggling Visibility

2010-08-10 Thread Nivedan Nadaraj
Hi

The List View is being refreshed now. I have made couple of iterations and
have pretty much lost track of how I went about. But, one of the things I
did was
add an anonymous class in my Search panel as ar LoadableDetachableModel and
in the load() I return a list from the CompoundPropertyModel instance that I
created as part of the Search form instance.

I guess this(LoadableDetachableModel)  was a requirement if we want the
search results panel to be repainted with 'new' data from model i.e update
the model the ListView uses?

I have a slightly different behavior now,  which is correct logically
speaking  but I think i should start a different thread.Also if is allowed
to upload a sample project for the experts to comment on the approach taken
and also thought it I can contribute it after some modification as a
tutorial or guide for newbies like me?

Your thoughts as always appreciate

Cheers


On Mon, Aug 9, 2010 at 11:24 AM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Hi
 Thanks for the pointers.

 I have tried doing the following and yet to see the expected result (i.e
 re-render the list view with the new items)

 1 .Using an entirely new Model instance, and seting it using setModel
 2. When the Listview is created I have said setReuseItems(true)
 3. When the model has changed I execute the listview.removeAll() (prior to
 updating the model)// as per documentation  removeAll is to be called if
 model changed
 4. Since we say setModel() wouldn't that call modelChanged()? Anyways I
 have expliclty invoked modelChanged

 Bascially, I have got the ListView inside a panel.The panel is wrapped
 inside the WebmarkupContainer.

 thanks again
 Niv



 On Fri, Aug 6, 2010 at 6:57 PM, Wilhelmsen Tor Iver toriv...@arrive.nowrote:

  this.setModelObject(updatedModelInstance);

 Are you sure you do not mean setModel() instead of setModelObject() here?

 Also, look into whether you use setReuseItems(true) on the listview, then
 you probably want modelChanged() somewhere too.

 - Tor Iver

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





Re: Ajax-Panel Toggling Visibility

2010-08-08 Thread Nivedan Nadaraj
Hi
Thanks for the pointers.

I have tried doing the following and yet to see the expected result (i.e
re-render the list view with the new items)

1 .Using an entirely new Model instance, and seting it using setModel
2. When the Listview is created I have said setReuseItems(true)
3. When the model has changed I execute the listview.removeAll() (prior to
updating the model)// as per documentation  removeAll is to be called if
model changed
4. Since we say setModel() wouldn't that call modelChanged()? Anyways I have
expliclty invoked modelChanged

Bascially, I have got the ListView inside a panel.The panel is wrapped
inside the WebmarkupContainer.

thanks again
Niv


On Fri, Aug 6, 2010 at 6:57 PM, Wilhelmsen Tor Iver toriv...@arrive.nowrote:

  this.setModelObject(updatedModelInstance);

 Are you sure you do not mean setModel() instead of setModelObject() here?

 Also, look into whether you use setReuseItems(true) on the listview, then
 you probably want modelChanged() somewhere too.

 - Tor Iver

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




Re: Ajax-Panel Toggling Visibility

2010-08-06 Thread Nivedan Nadaraj
Hi

Thank's for correcting me on how to update the ListView, nicely explained.


1. I am able to view the results panel now.

2. I have made change in the following way to update the list by updating
the model.

Added a WebMarkupContainer and wrapped the ListView within it.
The visibility is applied now only on the WebMarkupContainer that wraps the
list.


So now, I update the model and call
this.setModelObject(updatedModelInstance);,

But now I can see only the header of the Listiview being rendered and the
actual data/repeated items are blank... is not re-painted. The markup on the
ajax response has the following:


*INFO: *Received ajax response (723 characters)
*INFO: *
?xml version=1.0 encoding=UTF-8?ajax-responsecomponent
id=resultListContainer13 ![CDATA[div id=resultListContainer13

div
table width=0% cellspacing=0/table
table width=100% cellspacing=0 class=dataview
tr
th width=5%nbsp;/th
th width=15%First Name/th

th width=5%nbsp;/th
th width=15%label for=MiddleNameMiddle Name/label/th

th width=5%nbsp;/th
th width=15%label for=LastNameLast Name/label/th

th width=5%nbsp;/th
th width=15%nbsp;
/th
/tr

The content is not rendered, now why would that happen? Does it need to
invoke a method on the result list panel to render the contents? Now am
thinking should i add a wrapper WebMarkupContainer for the PageableListView
as well? So Ajax can re-paint it?

Thanks for the time,

Reg
Niv


On Fri, Aug 6, 2010 at 4:14 PM, Wilhelmsen Tor Iver toriv...@arrive.nowrote:

searchResults = new SearchResults(id,list); //- Not sure if this
  is the
  correct way to refresh a ListView...

 It's not. Creating a new object like this will defeat the logic because it
 has not been added to the hierarchy that the Ajax call expects.

 What you want to do is to modify the *model* of the result, then tell it to
 repaint. For repeaters (like ListView) where the markup is used multiple
 times and the real wicket id is something completely different than what
 you may think, you also want to put a wrapper in the form of a
 WebMarkupContainer around the repeater and then use that for visibility and
 Ajax updates.

 - Tor Iver

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




Re: Ajax-Panel Toggling Visibility

2010-08-06 Thread Nivedan Nadaraj
I initalised the ListView with some data and now when i click the search
ajax button it renders the header and content that the list was first at the
time of construction initialised with.
However, as part of onSearch click i do update the list and set the model.
This new data is not being rendered.

Could it be a model issue?
Could it be to do with something extra to take care of updating the
repeatable list. I also looked at the following link

 https://cwiki.apache.org/WICKET/how-to-repaint-a-listview-via-ajax.html

I have followed pretty much everything necessary for wrapping the list
control and hide and unhide. The only this is I do not use the

AjaxSelfUpdatingTimerBehavior and LoadableDetachableModel. I don't
think this is causing the issue.


Any thoughts to help?

Cheers
Niv



On Fri, Aug 6, 2010 at 5:12 PM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Hi

 Thank's for correcting me on how to update the ListView, nicely explained.


 1. I am able to view the results panel now.

 2. I have made change in the following way to update the list by updating
 the model.

 Added a WebMarkupContainer and wrapped the ListView within it.
 The visibility is applied now only on the WebMarkupContainer that wraps the
 list.


 So now, I update the model and call
 this.setModelObject(updatedModelInstance);,

 But now I can see only the header of the Listiview being rendered and the
 actual data/repeated items are blank... is not re-painted. The markup on the
 ajax response has the following:


 *INFO: *Received ajax response (723 characters)
 *INFO: *
 ?xml version=1.0 encoding=UTF-8?ajax-responsecomponent 
 id=resultListContainer13 ![CDATA[div id=resultListContainer13

 div
 table width=0% cellspacing=0/table
 table width=100% cellspacing=0 class=dataview
 tr
 th width=5%nbsp;/th
 th width=15%First Name/th

 th width=5%nbsp;/th

 th width=15%label for=MiddleNameMiddle Name/label/th

 th width=5%nbsp;/th
 th width=15%label for=LastNameLast Name/label/th

 th width=5%nbsp;/th
 th width=15%nbsp;
 /th
 /tr

 The content is not rendered, now why would that happen? Does it need to
 invoke a method on the result list panel to render the contents? Now am
 thinking should i add a wrapper WebMarkupContainer for the PageableListView
 as well? So Ajax can re-paint it?

 Thanks for the time,

 Reg
 Niv



 On Fri, Aug 6, 2010 at 4:14 PM, Wilhelmsen Tor Iver toriv...@arrive.nowrote:

searchResults = new SearchResults(id,list); //- Not sure if this
  is the
  correct way to refresh a ListView...

 It's not. Creating a new object like this will defeat the logic because it
 has not been added to the hierarchy that the Ajax call expects.

 What you want to do is to modify the *model* of the result, then tell it
 to repaint. For repeaters (like ListView) where the markup is used multiple
 times and the real wicket id is something completely different than what
 you may think, you also want to put a wrapper in the form of a
 WebMarkupContainer around the repeater and then use that for visibility and
 Ajax updates.

 - Tor Iver

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





Re: Model Is Not being Refreshed

2010-08-05 Thread Nivedan Nadaraj
Hi

Thanks for the time guys. I built a toy app to simulate the issue. I found
that, I was using two CMP's. One at the top level ie the search form. THen
at the detail level I had another CMP wit the identical model.

So when I cancel out of details and clicked new, I
said...this.setModelObject(new Instance)
this only affected the Search or the top level model and not the details and
hencethe details rendered with the old data.

Thank you all for the time
Reg
Niv

On Wed, Aug 4, 2010 at 6:01 PM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Hi,

 Re-attached the file as a .txt file. My apologies. I will read up again on
 the link for Models and re-visit it. .

 Thanks for the time
 Niv



 On Wed, Aug 4, 2010 at 5:43 PM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Hi

 I did read the link and from which i went about modifying the Model. I
 have limited usage of generics in the code. Would be great to utilise it the
 way it is supposed to be.
 I am using 1.4.x version of wicket.

 Did u want me to send you the code to your email id if the attachment are
 not good?

 Thanks
 Niv


 On Wed, Aug 4, 2010 at 5:21 PM, avrahamr avrah...@gmail.com wrote:


 I think attachments are not good in the list, so we didn't get your code.

 I'm not following the way you are mixing Model with the Object and I
 recommend reading:
 https://cwiki.apache.org/WICKET/working-with-wicket-models.html

 The StudyModel should be something like this:
 public class StudyModel implements IModel {

 private Study study;
  public Object getObject() {
 return study;
  }

 public void setObject(Object object) {
 this.study =  (Study)study;
  }
   ...

 But if that's the case, I don't see a reason not to use the concrete
 Model
 class: new Model(study)

 Also, I see from your examples you are using Wicket 1.3.x, is that right?

 With Wicket 1.4.x and generics it all becomes much more clear.

 On Wed, Aug 4, 2010 at 11:38 AM, nivs [via Apache Wicket] 
 ml-node+2313107-368287748-293...@n4.nabble.comml-node%2b2313107-368287748-293...@n4.nabble.com
 ml-node%2b2313107-368287748-293...@n4.nabble.comml-node%252b2313107-368287748-293...@n4.nabble.com
 
  wrote:

  After a long battle..i have progressed an inch forward!
 
  The StudyModel that implements IModel seemed to have the problem.
  I did not set the object in setObject...after modifying it in the
 following
 
  way..the Refresh button works.
 
 
  public Object getObject() {
  return this;
  }
 
  public void setObject(Object object) {
  StudyModel model = (StudyModel)object;
  this.studyVO = model.getStudyVO();
 
  }
 
  But I am not there as yet...now when I lookup and then click on an item
  from
  the list, the form again is empty..meaning the model is not being
 updated.
 
  So basically.
  1.Search  Panel - Search items
  2.SearchResults - onClick
  3.Details- displayed correctly..., now I click cancel, tht hides the
  details
  panel
  4. I click on New/Refresh button on Search Panel
  5. A new details page is loaded - the effect of modifying setObject()
 in
  the
  Model
  6.I click on cancel on details panel
  7. And perform steps 1 to 2
  8. An empty details panel is displayed...
 
  If i can get a single thread of clue..will fix this and cement it 
  Obviously I dont have a grip over Models..
 
  Cheers
  niv
 
 
 
 
  On Wed, Aug 4, 2010 at 11:12 AM, Nivedan Nadaraj [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2313107i=0wrote:
 
 
   Hi
  
  
   After I added setOutputMarkupPlaceHolderTag(true) to the details
 panel,
  the
   Ajax function works and I can see the details panel. (Which I could
 not
   earlier)
   However, the problem still remains as in the model has not been
 updated
  and
   still refers to the stale/old one.
  
   @avrahmr
   I used the setModel but I get a wicket runtime exception.
  
   Thanks for your thoughts.
   Niv
  
  
   On Wed, Aug 4, 2010 at 10:25 AM, Nivedan Nadaraj [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2313107i=1wrote:
 
  
   Hi,
  
   I have attached the code as a text file. I have removed lines that
 don't
 
   really make any contribution to the problem at hand after carefully
   examining it.
  
   Appreciate your time if you could see any issues please let me know.
  
   Basically the code has the Form objects I used, and the different
 panels
 
   involved with it.
  
   Many thanks
   Niv
  
  
   On Tue, Aug 3, 2010 at 10:30 PM, Nivedan Nadaraj [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2313107i=2wrote:
 
  
   Avraham and Matt,
  
   Thanks for the points. I will have a look at it tomorrow and post
 the
   code if I still haven't resolved. I don't have the code on me at
 the
  moment.
   Reg
   Niv
  
  
  
  
   On Tue, Aug 3, 2010 at 9:41 PM, mwilber [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2313107i=3
  wrote:
  
  
   Again without seeing more of the code some of this is guessing.
  
   If the component that you are trying

Re: A beginner's tutorial

2010-08-05 Thread Nivedan Nadaraj
As a beginer myself...I feel the language like java plays a lot. Learning
the generics would be one aspect and a must. Next to understand a simple
request response usecase.

Usage of each, if not all controls. How to use them and get it working as
is.

How would i be able to generalise usage of such controls, can we build a
library of such reusable components that this project can use.

By now, I would  have had a good understanding of the inner workings if not
too deep but to the extent one needs to appreciate it and then build custom
components.

Next I feel I would use those components where necesary to build the
project. What patterns can be used? These are questions I still ask...

If it helps..my 1 cent:)
Niv

On Thu, Aug 5, 2010 at 11:06 PM, James Carman ja...@carmanconsulting.comwrote:

 On Thu, Aug 5, 2010 at 10:54 AM, H. Turgut Uyar u...@itu.edu.tr wrote:
  It seems to me that I have to explain a lot of complicated things to
  explain this to the students. They are 3rd year students who have taken
  only one OO course, and that's in C++.
 
  Thank you both for your concern and help

 Definitely!  I would not try explaining all of that stuff to 3rd year
 students.  You can get a good understanding of Wicket without it.
 Now, don't get me wrong, I think it's a cool idea, but I think it
 might be a bit much to throw at a beginner.

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




Re: Model Is Not being Refreshed

2010-08-04 Thread Nivedan Nadaraj
After a long battle..i have progressed an inch forward!

The StudyModel that implements IModel seemed to have the problem.
I did not set the object in setObject...after modifying it in the following
way..the Refresh button works.


public Object getObject() {
return this;
}

public void setObject(Object object) {
StudyModel model = (StudyModel)object;
this.studyVO = model.getStudyVO();

}

But I am not there as yet...now when I lookup and then click on an item from
the list, the form again is empty..meaning the model is not being updated.

So basically.
1.Search  Panel - Search items
2.SearchResults - onClick
3.Details- displayed correctly..., now I click cancel, tht hides the details
panel
4. I click on New/Refresh button on Search Panel
5. A new details page is loaded - the effect of modifying setObject() in the
Model
6.I click on cancel on details panel
7. And perform steps 1 to 2
8. An empty details panel is displayed...

If i can get a single thread of clue..will fix this and cement it 
Obviously I dont have a grip over Models..

Cheers
niv




On Wed, Aug 4, 2010 at 11:12 AM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Hi


 After I added setOutputMarkupPlaceHolderTag(true) to the details panel, the
 Ajax function works and I can see the details panel. (Which I could not
 earlier)
 However, the problem still remains as in the model has not been updated and
 still refers to the stale/old one.

 @avrahmr
 I used the setModel but I get a wicket runtime exception.

 Thanks for your thoughts.
 Niv


 On Wed, Aug 4, 2010 at 10:25 AM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Hi,

 I have attached the code as a text file. I have removed lines that don't
 really make any contribution to the problem at hand after carefully
 examining it.

 Appreciate your time if you could see any issues please let me know.

 Basically the code has the Form objects I used, and the different panels
 involved with it.

 Many thanks
 Niv


 On Tue, Aug 3, 2010 at 10:30 PM, Nivedan Nadaraj 
 shravann...@gmail.comwrote:

 Avraham and Matt,

 Thanks for the points. I will have a look at it tomorrow and post the
 code if I still haven't resolved. I don't have the code on me at the moment.
 Reg
 Niv




 On Tue, Aug 3, 2010 at 9:41 PM, mwilber matt.wil...@gmail.com wrote:


 Again without seeing more of the code some of this is guessing.

 If the component that you are trying to update is not part of the
 original
 HTML it will not be updated in the ajax response. I see that you are
 marking
 the component as visible and enabled. If it isn't visible during the
 initial
 rendering then it won't be placed in the HTML. If you mark the component
 with

 http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag(boolean)http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag%28boolean%29
 setOutputMarkupPlaceholderTag(true)  then the invisible component will
 have
 a placeholder to be updated during the ajax response.
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Model-Is-Not-being-Refreshed-tp2311457p2311876.html
 Sent from the Wicket - User 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: Model Is Not being Refreshed

2010-08-04 Thread Nivedan Nadaraj
Hi

I did read the link and from which i went about modifying the Model. I have
limited usage of generics in the code. Would be great to utilise it the way
it is supposed to be.
I am using 1.4.x version of wicket.

Did u want me to send you the code to your email id if the attachment are
not good?

Thanks
Niv

On Wed, Aug 4, 2010 at 5:21 PM, avrahamr avrah...@gmail.com wrote:


 I think attachments are not good in the list, so we didn't get your code.

 I'm not following the way you are mixing Model with the Object and I
 recommend reading:
 https://cwiki.apache.org/WICKET/working-with-wicket-models.html

 The StudyModel should be something like this:
 public class StudyModel implements IModel {

 private Study study;
  public Object getObject() {
 return study;
  }

 public void setObject(Object object) {
 this.study =  (Study)study;
  }
   ...

 But if that's the case, I don't see a reason not to use the concrete Model
 class: new Model(study)

 Also, I see from your examples you are using Wicket 1.3.x, is that right?

 With Wicket 1.4.x and generics it all becomes much more clear.

 On Wed, Aug 4, 2010 at 11:38 AM, nivs [via Apache Wicket] 
 ml-node+2313107-368287748-293...@n4.nabble.comml-node%2b2313107-368287748-293...@n4.nabble.com
 ml-node%2b2313107-368287748-293...@n4.nabble.comml-node%252b2313107-368287748-293...@n4.nabble.com
 
  wrote:

  After a long battle..i have progressed an inch forward!
 
  The StudyModel that implements IModel seemed to have the problem.
  I did not set the object in setObject...after modifying it in the
 following
 
  way..the Refresh button works.
 
 
  public Object getObject() {
  return this;
  }
 
  public void setObject(Object object) {
  StudyModel model = (StudyModel)object;
  this.studyVO = model.getStudyVO();
 
  }
 
  But I am not there as yet...now when I lookup and then click on an item
  from
  the list, the form again is empty..meaning the model is not being
 updated.
 
  So basically.
  1.Search  Panel - Search items
  2.SearchResults - onClick
  3.Details- displayed correctly..., now I click cancel, tht hides the
  details
  panel
  4. I click on New/Refresh button on Search Panel
  5. A new details page is loaded - the effect of modifying setObject() in
  the
  Model
  6.I click on cancel on details panel
  7. And perform steps 1 to 2
  8. An empty details panel is displayed...
 
  If i can get a single thread of clue..will fix this and cement it 
  Obviously I dont have a grip over Models..
 
  Cheers
  niv
 
 
 
 
  On Wed, Aug 4, 2010 at 11:12 AM, Nivedan Nadaraj [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2313107i=0wrote:
 
 
   Hi
  
  
   After I added setOutputMarkupPlaceHolderTag(true) to the details panel,
  the
   Ajax function works and I can see the details panel. (Which I could not
   earlier)
   However, the problem still remains as in the model has not been updated
  and
   still refers to the stale/old one.
  
   @avrahmr
   I used the setModel but I get a wicket runtime exception.
  
   Thanks for your thoughts.
   Niv
  
  
   On Wed, Aug 4, 2010 at 10:25 AM, Nivedan Nadaraj [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2313107i=1wrote:
 
  
   Hi,
  
   I have attached the code as a text file. I have removed lines that
 don't
 
   really make any contribution to the problem at hand after carefully
   examining it.
  
   Appreciate your time if you could see any issues please let me know.
  
   Basically the code has the Form objects I used, and the different
 panels
 
   involved with it.
  
   Many thanks
   Niv
  
  
   On Tue, Aug 3, 2010 at 10:30 PM, Nivedan Nadaraj [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2313107i=2wrote:
 
  
   Avraham and Matt,
  
   Thanks for the points. I will have a look at it tomorrow and post the
   code if I still haven't resolved. I don't have the code on me at the
  moment.
   Reg
   Niv
  
  
  
  
   On Tue, Aug 3, 2010 at 9:41 PM, mwilber [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2313107i=3
  wrote:
  
  
   Again without seeing more of the code some of this is guessing.
  
   If the component that you are trying to update is not part of the
   original
   HTML it will not be updated in the ajax response. I see that you are
   marking
   the component as visible and enabled. If it isn't visible during the
   initial
   rendering then it won't be placed in the HTML. If you mark the
  component
   with
  
  
 
 http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag(booleanhttp://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag%28boolean
  )
 
 http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag%28boolean%29
 
 
   setOutputMarkupPlaceholderTag(true)  then the invisible component
 will
 
   have
   a placeholder to be updated during the ajax response.
   --
   View

Re: Model Is Not being Refreshed

2010-08-04 Thread Nivedan Nadaraj
Hi,

Re-attached the file as a .txt file. My apologies. I will read up again on
the link for Models and re-visit it. .

Thanks for the time
Niv


On Wed, Aug 4, 2010 at 5:43 PM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Hi

 I did read the link and from which i went about modifying the Model. I have
 limited usage of generics in the code. Would be great to utilise it the way
 it is supposed to be.
 I am using 1.4.x version of wicket.

 Did u want me to send you the code to your email id if the attachment are
 not good?

 Thanks
 Niv


 On Wed, Aug 4, 2010 at 5:21 PM, avrahamr avrah...@gmail.com wrote:


 I think attachments are not good in the list, so we didn't get your code.

 I'm not following the way you are mixing Model with the Object and I
 recommend reading:
 https://cwiki.apache.org/WICKET/working-with-wicket-models.html

 The StudyModel should be something like this:
 public class StudyModel implements IModel {

 private Study study;
  public Object getObject() {
 return study;
  }

 public void setObject(Object object) {
 this.study =  (Study)study;
  }
   ...

 But if that's the case, I don't see a reason not to use the concrete Model
 class: new Model(study)

 Also, I see from your examples you are using Wicket 1.3.x, is that right?

 With Wicket 1.4.x and generics it all becomes much more clear.

 On Wed, Aug 4, 2010 at 11:38 AM, nivs [via Apache Wicket] 
 ml-node+2313107-368287748-293...@n4.nabble.comml-node%2b2313107-368287748-293...@n4.nabble.com
 ml-node%2b2313107-368287748-293...@n4.nabble.comml-node%252b2313107-368287748-293...@n4.nabble.com
 
  wrote:

  After a long battle..i have progressed an inch forward!
 
  The StudyModel that implements IModel seemed to have the problem.
  I did not set the object in setObject...after modifying it in the
 following
 
  way..the Refresh button works.
 
 
  public Object getObject() {
  return this;
  }
 
  public void setObject(Object object) {
  StudyModel model = (StudyModel)object;
  this.studyVO = model.getStudyVO();
 
  }
 
  But I am not there as yet...now when I lookup and then click on an item
  from
  the list, the form again is empty..meaning the model is not being
 updated.
 
  So basically.
  1.Search  Panel - Search items
  2.SearchResults - onClick
  3.Details- displayed correctly..., now I click cancel, tht hides the
  details
  panel
  4. I click on New/Refresh button on Search Panel
  5. A new details page is loaded - the effect of modifying setObject() in
  the
  Model
  6.I click on cancel on details panel
  7. And perform steps 1 to 2
  8. An empty details panel is displayed...
 
  If i can get a single thread of clue..will fix this and cement it 
  Obviously I dont have a grip over Models..
 
  Cheers
  niv
 
 
 
 
  On Wed, Aug 4, 2010 at 11:12 AM, Nivedan Nadaraj [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2313107i=0wrote:
 
 
   Hi
  
  
   After I added setOutputMarkupPlaceHolderTag(true) to the details
 panel,
  the
   Ajax function works and I can see the details panel. (Which I could
 not
   earlier)
   However, the problem still remains as in the model has not been
 updated
  and
   still refers to the stale/old one.
  
   @avrahmr
   I used the setModel but I get a wicket runtime exception.
  
   Thanks for your thoughts.
   Niv
  
  
   On Wed, Aug 4, 2010 at 10:25 AM, Nivedan Nadaraj [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2313107i=1wrote:
 
  
   Hi,
  
   I have attached the code as a text file. I have removed lines that
 don't
 
   really make any contribution to the problem at hand after carefully
   examining it.
  
   Appreciate your time if you could see any issues please let me know.
  
   Basically the code has the Form objects I used, and the different
 panels
 
   involved with it.
  
   Many thanks
   Niv
  
  
   On Tue, Aug 3, 2010 at 10:30 PM, Nivedan Nadaraj [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2313107i=2wrote:
 
  
   Avraham and Matt,
  
   Thanks for the points. I will have a look at it tomorrow and post
 the
   code if I still haven't resolved. I don't have the code on me at the
  moment.
   Reg
   Niv
  
  
  
  
   On Tue, Aug 3, 2010 at 9:41 PM, mwilber [hidden email]
 http://user/SendEmail.jtp?type=nodenode=2313107i=3
  wrote:
  
  
   Again without seeing more of the code some of this is guessing.
  
   If the component that you are trying to update is not part of the
   original
   HTML it will not be updated in the ajax response. I see that you
 are
   marking
   the component as visible and enabled. If it isn't visible during
 the
   initial
   rendering then it won't be placed in the HTML. If you mark the
  component
   with
  
  
 
 http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag(booleanhttp://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag%28boolean
  )
 
 http://wicket.apache.org/apidocs

Model Is Not being Refreshed

2010-08-03 Thread Nivedan Nadaraj
Hi

Can someone point me the right direction.

I have a search panel that does a look up and renders a resultsPanel. I
don't use detachable model here and used PageableListView
On the resultsPanel,onClick, I use the hibernate entity and pass it as a
model to the DetailsPanel. The detailsPanel renders it right no issue here.

Now When I hit the New button(acutally after I click cancel button on
Details, the details panel is set to visible=false).  on the search, I
expect to see a fresh page in details panel, but
the details panel uses the old values I selected and renders it.

This is what I do on onNew submit button.

I reset the model and set it to the form which should call
setDefaultObjectModel.

SearchPanel

 onNew(){
studyModel = new StudyModel();
studyModel.setStudy(new Study());
detailsPanel.getStudyForm().setModelObject(studyModel);
detailsPanel.setVisible(true);
}

After onNew is executed, I don't see the model being updated. A bit lost
here, any ideas?

Thanks again
Reg
Niv


Re: Model Is Not being Refreshed

2010-08-03 Thread Nivedan Nadaraj
Thanks for the response. It still does not work.

I added the ajax button on the SearchForm that has the New,Cancel and I
added this Refresh button just to test.

I added setOutputMarkupId(true) to the detailsPanle and then  in SearchForm
that extends Form added the AjaxButton

protected void onSubmit(AjaxRequestTarget target, Form? form) {
detailsPanel.getStudyForm().setDefaultModelObject(new
StudyModel());

detailsPanel.getStudyForm().getStudyIdTxtFld().setEnabled(false);

detailsPanel.getStudyForm().getStudyNameTxtFld().setEnabled(true);
detailsPanel.setVisible(true);
target.addComponent(detailsPanel);
}

I debugged it, and onSubmit does get invoked upto the last line
target.addComponent(), the detailsPanel is not being made visible. So I
cannot see if it has refreshed it!

Thanks again,
Niv


On Tue, Aug 3, 2010 at 5:23 PM, vov vov...@mail.ru wrote:


 Create AjaxButton for refreshing your data:
 new AjaxButton(refresh)
 {
onSubmit(AjaxRequestTarget target)
{
 onNew();
 targer.addComponent(detailsPanel);
}
 }
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Model-Is-Not-being-Refreshed-tp2311457p2311537.html
 Sent from the Wicket - User 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: Model Is Not being Refreshed

2010-08-03 Thread Nivedan Nadaraj
Avraham and Matt,

Thanks for the points. I will have a look at it tomorrow and post the code
if I still haven't resolved. I don't have the code on me at the moment.
Reg
Niv



On Tue, Aug 3, 2010 at 9:41 PM, mwilber matt.wil...@gmail.com wrote:


 Again without seeing more of the code some of this is guessing.

 If the component that you are trying to update is not part of the
 original
 HTML it will not be updated in the ajax response. I see that you are
 marking
 the component as visible and enabled. If it isn't visible during the
 initial
 rendering then it won't be placed in the HTML. If you mark the component
 with

 http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag(boolean)http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag%28boolean%29
 setOutputMarkupPlaceholderTag(true)  then the invisible component will have
 a placeholder to be updated during the ajax response.
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Model-Is-Not-being-Refreshed-tp2311457p2311876.html
 Sent from the Wicket - User 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: Model Is Not being Refreshed

2010-08-03 Thread Nivedan Nadaraj
Hi,

I have attached the code as a text file. I have removed lines that don't
really make any contribution to the problem at hand after carefully
examining it.

Appreciate your time if you could see any issues please let me know.

Basically the code has the Form objects I used, and the different panels
involved with it.

Many thanks
Niv

On Tue, Aug 3, 2010 at 10:30 PM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Avraham and Matt,

 Thanks for the points. I will have a look at it tomorrow and post the code
 if I still haven't resolved. I don't have the code on me at the moment.
 Reg
 Niv




 On Tue, Aug 3, 2010 at 9:41 PM, mwilber matt.wil...@gmail.com wrote:


 Again without seeing more of the code some of this is guessing.

 If the component that you are trying to update is not part of the
 original
 HTML it will not be updated in the ajax response. I see that you are
 marking
 the component as visible and enabled. If it isn't visible during the
 initial
 rendering then it won't be placed in the HTML. If you mark the component
 with

 http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag(boolean)http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag%28boolean%29
 setOutputMarkupPlaceholderTag(true)  then the invisible component will
 have
 a placeholder to be updated during the ajax response.
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Model-Is-Not-being-Refreshed-tp2311457p2311876.html
 Sent from the Wicket - User mailing list archive at Nabble.com.

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




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

Re: Model Is Not being Refreshed

2010-08-03 Thread Nivedan Nadaraj
Hi


After I added setOutputMarkupPlaceHolderTag(true) to the details panel, the
Ajax function works and I can see the details panel. (Which I could not
earlier)
However, the problem still remains as in the model has not been updated and
still refers to the stale/old one.

@avrahmr
I used the setModel but I get a wicket runtime exception.

Thanks for your thoughts.
Niv

On Wed, Aug 4, 2010 at 10:25 AM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Hi,

 I have attached the code as a text file. I have removed lines that don't
 really make any contribution to the problem at hand after carefully
 examining it.

 Appreciate your time if you could see any issues please let me know.

 Basically the code has the Form objects I used, and the different panels
 involved with it.

 Many thanks
 Niv


 On Tue, Aug 3, 2010 at 10:30 PM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Avraham and Matt,

 Thanks for the points. I will have a look at it tomorrow and post the code
 if I still haven't resolved. I don't have the code on me at the moment.
 Reg
 Niv




 On Tue, Aug 3, 2010 at 9:41 PM, mwilber matt.wil...@gmail.com wrote:


 Again without seeing more of the code some of this is guessing.

 If the component that you are trying to update is not part of the
 original
 HTML it will not be updated in the ajax response. I see that you are
 marking
 the component as visible and enabled. If it isn't visible during the
 initial
 rendering then it won't be placed in the HTML. If you mark the component
 with

 http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag(boolean)http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setOutputMarkupPlaceholderTag%28boolean%29
 setOutputMarkupPlaceholderTag(true)  then the invisible component will
 have
 a placeholder to be updated during the ajax response.
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Model-Is-Not-being-Refreshed-tp2311457p2311876.html
 Sent from the Wicket - User 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: How to Update contents of a child component?

2010-08-02 Thread Nivedan Nadaraj
Thanks guys for the input. Will give a yell when I have resolved it, thanks
for the time.

Reg
Niv

On Fri, Jul 30, 2010 at 7:54 PM, vov vov...@mail.ru wrote:


 Do not forgot about setOutputMarkupPlaceholderTag(true) for your components
 that initially as invisible.
 And use AJAX...:)
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-Update-contents-of-a-child-component-tp2307756p2307883.html
 Sent from the Wicket - User 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: Integrating Wicket with Dojo/Jquery/Dwr/Ext Js

2010-07-29 Thread Nivedan Nadaraj
WiQuery integrates JQuery with Wicket. It is a very responsive community as
well. The other one that integrates Wicket is JWicket  but I have not used
it.
I have used Wiquery but if you wanted I guess you can use Jquery  customise
it for your project. As such Wiquery provides out of the box integration
with Wicket.

Cheers



On Wed, Jul 28, 2010 at 11:22 PM, Arjun Dhar dhar...@yahoo.com wrote:


 This is more a question than an opinion.

 Wicket is a View first framework, and also has the cleanest separation
 between Markups and Code that I have seen so far.

 I think What Scripting technology one uses should anyway never be tightly
 coupled with whats on the server. I keep seeing questions on Mobile device,
 JQuery etc. In design people should just focus on bare minimal to connect
 the two and avoid strong coupling. (just enough to trigger events and pass
 data)

 So in a way questions specific to How wicket supports mobile devices, or
 XYZ Scripting framework in the markup are not really relevant.

 Would that be a fair way of thinking? ..or am over philosophizing this? :)
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Integrating-Wicket-with-Dojo-Jquery-Dwr-Ext-Js-tp2304474p2305142.html
 Sent from the Wicket - User 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: Integrating Wicket with Dojo/Jquery/Dwr/Ext Js

2010-07-29 Thread Nivedan Nadaraj
Here is alink to Wiquery project:
http://code.google.com/p/wiquery/wiki/QuickStart


On Thu, Jul 29, 2010 at 5:37 PM, Nivedan Nadaraj shravann...@gmail.comwrote:

 WiQuery integrates JQuery with Wicket. It is a very responsive community as
 well. The other one that integrates Wicket is JWicket  but I have not used
 it.
 I have used Wiquery but if you wanted I guess you can use Jquery  customise
 it for your project. As such Wiquery provides out of the box integration
 with Wicket.

 Cheers




 On Wed, Jul 28, 2010 at 11:22 PM, Arjun Dhar dhar...@yahoo.com wrote:


 This is more a question than an opinion.

 Wicket is a View first framework, and also has the cleanest separation
 between Markups and Code that I have seen so far.

 I think What Scripting technology one uses should anyway never be tightly
 coupled with whats on the server. I keep seeing questions on Mobile
 device,
 JQuery etc. In design people should just focus on bare minimal to connect
 the two and avoid strong coupling. (just enough to trigger events and pass
 data)

 So in a way questions specific to How wicket supports mobile devices, or
 XYZ Scripting framework in the markup are not really relevant.

 Would that be a fair way of thinking? ..or am over philosophizing this? :)
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Integrating-Wicket-with-Dojo-Jquery-Dwr-Ext-Js-tp2304474p2305142.html
 Sent from the Wicket - User 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: ListMultipleChoice Update Model from Choices

2010-07-27 Thread Nivedan Nadaraj
Just wanted to update, I have checked out the Palette too and looks cool.
However wanted to share this bit. Adding the following

componentInstance.modelChanged();
componentInstance.setModelObject(selectedChoice);

ie, I get the choices selected and add it to the Model. By invoking
modelChanged() I noticed that the changes are pushed into the Model.  Which
is what I was looking for

The other usage of the modelChanged() I noticed was when

1. On the Form  the user types in some information and then hits Save.
2. The form comes back with validation error messages.
3. The user now clicks on Cancel button to discard the form
4. The user clicks the New button and a form is loaded with the old data( I
had the data typed in the previous form repeated even though I cleared the
input form.clearInput.)
5. I add the form.modelChanged() and now it clears completely or takes into
account that its a fresh form.

Is this a valid approach? Any thoughts on it for similar scenario?

Thanks
Niv



On Sat, Jul 24, 2010 at 2:42 AM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Cheers mate thanks for that. Only I thought it was one step closer to
 building my own component and know the details of it. But yeah point taken.

 Cheers
 Nive


 On Fri, Jul 23, 2010 at 5:43 PM, Martin Makundi 
 martin.maku...@koodaripalvelut.com wrote:

 Hi!

 Yeah, if you look at the Palette you can se it is not trivial so it
 will save you a lot of time ;)

 **
 Martin

 2010/7/23 Nivedan Nadaraj shravann...@gmail.com:
  Hey Mate!!,
 
  That is classic. Will check it out, great. Again if you do know how I
 can
  address the issue I had will be good to know even if I dont use it since
 the
  Pallete offers it.
  Thanks !!
  Niv
 
  On Fri, Jul 23, 2010 at 5:31 PM, Martin Makundi 
  martin.maku...@koodaripalvelut.com wrote:
 
  Hi!
 
  Did you notice wicket has a built-in component called palette that can
  do this for you?
 
 
 
 http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.PalettePage
 
  **
  Martin
 
  2010/7/23 Nivedan Nadaraj shravann...@gmail.com:
   Hi All,
  
   I use the ListMultipleChoice(LMC) in a different way. I have one
 control
   (LMC) on the left representing a list of items Available (roles for
  example)
   I have another LMC to represent Selected items(roles)
  
   The ADD and ADD ALL buttons move the selected items' from Available
 LMC
  to
   Selected LMC.
  
   Now when I hit Save, the Selected LMC's Choices are not pushed into
 the
   Model and is empty. However, when I literally selected few items in
 the
   Selected LMC choice list and hit save then
   I have the items in the Model.Which is fine, but as a user he has
 done
  that
   act already so ...guess am missing something here.
  
   What I would like is for the Select LMC Model to be updated (either I
 do
  it
   or automatically) from the choices list. Has anyone used this in the
 way
  I
   am using it? How do we get around this?
  
   Thanks in advance.
   Cheers
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

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





Re: ListMultipleChoice Update Model from Choices

2010-07-27 Thread Nivedan Nadaraj
Hi

Yeah I did have only the setModelObject() but it did not clear it that is
why I added this. Maybe I have not used it correctly.Since you mentioned

'Note: componentInstance.setModelObject will call modelChanged from within
if the model is actually changed'

If the model is actually changed. That is what I am not sure, when does it
get notified that a change has happened.?Setting of an entirely new instance
in the model should do that isn't it. Please see code below.



FYI:

StudyModel is the bean that contains other objects. It is bound to a form
using CPM.

onNew(){

   StudyModel studyModel;
if(form != null  form.getModelObject() != null){
studyModel = form.getModelObject();
studyModel.setStudy(new Study());//a hibernate entity
form.setModelObject(studyModel);
form.modelChanged();//-- added this one to clear the data.
form.clearInput();
}


Thanks again
Niv

On Tue, Jul 27, 2010 at 3:05 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Hi!

  componentInstance.modelChanged();
  componentInstance.setModelObject(selectedChoice);

 Note: componentInstance.setModelObject will call modelChanged from
 within if the model is actually changed

  1. On the Form  the user types in some information and then hits Save.
  2. The form comes back with validation error messages.
  3. The user now clicks on Cancel button to discard the form
  4. The user clicks the New button and a form is loaded with the old data(
 I
  had the data typed in the previous form repeated even though I cleared
 the
  input form.clearInput.)
  5. I add the form.modelChanged() and now it clears completely or takes
 into
  account that its a fresh form.

 I could comment more if I saw the code.

 **
 Martin

 
 
 
 
  On Sat, Jul 24, 2010 at 2:42 AM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
 
  Cheers mate thanks for that. Only I thought it was one step closer to
  building my own component and know the details of it. But yeah point
 taken.
 
  Cheers
  Nive
 

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




Re: Expiring pages in form submit and onAfterRender...

2010-07-27 Thread Nivedan Nadaraj
I have added a configuration in the application to redirect the user to a
particular page. I guess page expires due to a timeout?

In the base application's init()

IApplicationSettings settings = getApplicationSettings();
settings.setPageExpiredErrorPage(LoginPage.class);

If that helps in anways.

Cheers
Niv

On Tue, Jul 27, 2010 at 3:18 PM, Erik van Oosten e.vanoos...@grons.nlwrote:

 Did you already look at StatelessForm?

 Regards,
Erik.



 Op 26-07-10 23:14, Erik Brakkee wrote:

 Hi,


 I am experimenting a bit with page expiry. One solution that works is to
 remove the page from the pagemap in the submit of a form. However,
 removing
 the page from the pagemap in the onAfterRender() of a page does not seem
 to
 work. In fact, I see the same page id and version being rendered every
 time.  Is this the way it should be? Is there another generic callback in
 a
 wicket page in which I could remove the page from the pagemap to expire
 it?
 What makes the form's onSubmit() special?

 Alternatively, I am considering to use a strategy whereby I set an expired
 flag on form submit and then in the onBeforeRender() use setResponsePage()
 to delegate to a specific page providing also a specific message. That
 would
 allow total control on form submit. Would that strategy work?

 Cheers
   Erik




 --
 Sent from my SMTP compliant software
 Erik van Oosten
 http://day-to-day-stuff.blogspot.com/




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




Re: ListMultipleChoice Update Model from Choices

2010-07-27 Thread Nivedan Nadaraj
Hi

Yep, I got it now. Thanks. I now create a new instance of the Model itself.
This satisfies the comparison.

 if (!getModelComparator().compare(this, object)){
 ...
 }

Earlier I was only resetting the contained object within the Model.
Thank You !

Niv

On Tue, Jul 27, 2010 at 3:27 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Hi!

  'Note: componentInstance.setModelObject will call modelChanged from
 within
  if the model is actually changed'
 
  If the model is actually changed. That is what I am not sure, when does
 it
  get notified that a change has happened.?Setting of an entirely new
 instance
  in the model should do that isn't it. Please see code below.

 Not necessarily. Look at setmodelobject implementation:

 public final Component setDefaultModelObject(final Object object)
...
if (!getModelComparator().compare(this, object))
{
modelChanging();
model.setObject(object);
modelChanged();
}

 **
 Martin

  On Tue, Jul 27, 2010 at 3:05 PM, Martin Makundi 
  martin.maku...@koodaripalvelut.com wrote:
 
  Hi!
 
   componentInstance.modelChanged();
   componentInstance.setModelObject(selectedChoice);
 
  Note: componentInstance.setModelObject will call modelChanged from
  within if the model is actually changed
 
   1. On the Form  the user types in some information and then hits Save.
   2. The form comes back with validation error messages.
   3. The user now clicks on Cancel button to discard the form
   4. The user clicks the New button and a form is loaded with the old
 data(
  I
   had the data typed in the previous form repeated even though I cleared
  the
   input form.clearInput.)
   5. I add the form.modelChanged() and now it clears completely or takes
  into
   account that its a fresh form.
 
  I could comment more if I saw the code.
 
  **
  Martin
 
  
  
  
  
   On Sat, Jul 24, 2010 at 2:42 AM, Nivedan Nadaraj 
 shravann...@gmail.com
  wrote:
  
   Cheers mate thanks for that. Only I thought it was one step closer to
   building my own component and know the details of it. But yeah point
  taken.
  
   Cheers
   Nive
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

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




Re: Expiring pages in form submit and onAfterRender...

2010-07-27 Thread Nivedan Nadaraj
Hi

Saw a related link to force page expiry probably might throw some light

http://apache-wicket.1842946.n4.nabble.com/Force-page-expiration-td1844190.html#a1844190

cheers

On Tue, Jul 27, 2010 at 3:23 PM, Nivedan Nadaraj shravann...@gmail.comwrote:

 I have added a configuration in the application to redirect the user to a
 particular page. I guess page expires due to a timeout?

 In the base application's init()

 IApplicationSettings settings = getApplicationSettings();
 settings.setPageExpiredErrorPage(LoginPage.class);

 If that helps in anways.

 Cheers
 Niv


 On Tue, Jul 27, 2010 at 3:18 PM, Erik van Oosten e.vanoos...@grons.nlwrote:

 Did you already look at StatelessForm?

 Regards,
Erik.



 Op 26-07-10 23:14, Erik Brakkee wrote:

 Hi,


 I am experimenting a bit with page expiry. One solution that works is to
 remove the page from the pagemap in the submit of a form. However,
 removing
 the page from the pagemap in the onAfterRender() of a page does not seem
 to
 work. In fact, I see the same page id and version being rendered every
 time.  Is this the way it should be? Is there another generic callback in
 a
 wicket page in which I could remove the page from the pagemap to expire
 it?
 What makes the form's onSubmit() special?

 Alternatively, I am considering to use a strategy whereby I set an
 expired
 flag on form submit and then in the onBeforeRender() use
 setResponsePage()
 to delegate to a specific page providing also a specific message. That
 would
 allow total control on form submit. Would that strategy work?

 Cheers
   Erik




 --
 Sent from my SMTP compliant software
 Erik van Oosten
 http://day-to-day-stuff.blogspot.com/




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





Re: Wicket Candy?

2010-07-27 Thread Nivedan Nadaraj
Looks real cool but no I have not used.
Nive

On Mon, Jul 26, 2010 at 7:03 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Hi!

 Has someone implemented Candy on Wicket as an extension to tabbed panels?

 http://vimeo.com/13560319

 **
 Martin

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




Re: Best way to hide a component

2010-07-23 Thread Nivedan Nadaraj
I have done the setVisible too for hiding components. Sometimes if there
were a group of them, placing them in a container(WebMarkupContainer)
and setting the visibility to t/f on the container works too.

Cheers
Niv


On Fri, Jul 23, 2010 at 2:36 PM, Andrea Selva selva.an...@gmail.com wrote:

 Hi,
 Instead of switching between components, i think that using the setVisible
 method of component class could be a better solution. This is the principle
 i read in the in Wicket in Action book when the want to hide a container of
 other thing.
 I hope this could help you
  Andrea

 On Thu, Jul 22, 2010 at 11:22 PM, mgoodson matt...@spidertracks.com
 wrote:

 
  Hi, this could be a stupid question but I am just wondering what the best
  way
  is to hide a component.
  Say I have a button on a form and when it renders sometimes I want it to
  show and some times not.
  I could either use 2 fragments, one with the button in it and one that's
  empty and switch between the two. Or the other option that I can think of
  is
  to turn the visibility on and off.
  Anyone got any reasons for or against with option?
  Thanks
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Best-way-to-hide-a-component-tp2299412p2299412.html
  Sent from the Wicket - User 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
 
 



ListMultipleChoice Update Model from Choices

2010-07-23 Thread Nivedan Nadaraj
Hi All,

I use the ListMultipleChoice(LMC) in a different way. I have one control
(LMC) on the left representing a list of items Available (roles for example)
I have another LMC to represent Selected items(roles)

The ADD and ADD ALL buttons move the selected items' from Available LMC to
Selected LMC.

Now when I hit Save, the Selected LMC's Choices are not pushed into the
Model and is empty. However, when I literally selected few items in the
Selected LMC choice list and hit save then
I have the items in the Model.Which is fine, but as a user he has done that
act already so ...guess am missing something here.

What I would like is for the Select LMC Model to be updated (either I do it
or automatically) from the choices list. Has anyone used this in the way I
am using it? How do we get around this?

Thanks in advance.
Cheers


Re: ListMultipleChoice Update Model from Choices

2010-07-23 Thread Nivedan Nadaraj
Hey Mate!!,

That is classic. Will check it out, great. Again if you do know how I can
address the issue I had will be good to know even if I dont use it since the
Pallete offers it.
Thanks !!
Niv

On Fri, Jul 23, 2010 at 5:31 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Hi!

 Did you notice wicket has a built-in component called palette that can
 do this for you?


 http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.PalettePage

 **
 Martin

 2010/7/23 Nivedan Nadaraj shravann...@gmail.com:
  Hi All,
 
  I use the ListMultipleChoice(LMC) in a different way. I have one control
  (LMC) on the left representing a list of items Available (roles for
 example)
  I have another LMC to represent Selected items(roles)
 
  The ADD and ADD ALL buttons move the selected items' from Available LMC
 to
  Selected LMC.
 
  Now when I hit Save, the Selected LMC's Choices are not pushed into the
  Model and is empty. However, when I literally selected few items in the
  Selected LMC choice list and hit save then
  I have the items in the Model.Which is fine, but as a user he has done
 that
  act already so ...guess am missing something here.
 
  What I would like is for the Select LMC Model to be updated (either I do
 it
  or automatically) from the choices list. Has anyone used this in the way
 I
  am using it? How do we get around this?
 
  Thanks in advance.
  Cheers
 

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




Re: ListMultipleChoice Update Model from Choices

2010-07-23 Thread Nivedan Nadaraj
Cheers mate thanks for that. Only I thought it was one step closer to
building my own component and know the details of it. But yeah point taken.

Cheers
Nive

On Fri, Jul 23, 2010 at 5:43 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Hi!

 Yeah, if you look at the Palette you can se it is not trivial so it
 will save you a lot of time ;)

 **
 Martin

 2010/7/23 Nivedan Nadaraj shravann...@gmail.com:
  Hey Mate!!,
 
  That is classic. Will check it out, great. Again if you do know how I can
  address the issue I had will be good to know even if I dont use it since
 the
  Pallete offers it.
  Thanks !!
  Niv
 
  On Fri, Jul 23, 2010 at 5:31 PM, Martin Makundi 
  martin.maku...@koodaripalvelut.com wrote:
 
  Hi!
 
  Did you notice wicket has a built-in component called palette that can
  do this for you?
 
 
 
 http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.PalettePage
 
  **
  Martin
 
  2010/7/23 Nivedan Nadaraj shravann...@gmail.com:
   Hi All,
  
   I use the ListMultipleChoice(LMC) in a different way. I have one
 control
   (LMC) on the left representing a list of items Available (roles for
  example)
   I have another LMC to represent Selected items(roles)
  
   The ADD and ADD ALL buttons move the selected items' from Available
 LMC
  to
   Selected LMC.
  
   Now when I hit Save, the Selected LMC's Choices are not pushed into
 the
   Model and is empty. However, when I literally selected few items in
 the
   Selected LMC choice list and hit save then
   I have the items in the Model.Which is fine, but as a user he has done
  that
   act already so ...guess am missing something here.
  
   What I would like is for the Select LMC Model to be updated (either I
 do
  it
   or automatically) from the choices list. Has anyone used this in the
 way
  I
   am using it? How do we get around this?
  
   Thanks in advance.
   Cheers
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

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




Re: AjaxButton OnSubmit Validation Overridden

2010-07-22 Thread Nivedan Nadaraj
Hi All,

I did look up the Nabble archive for key-words like 'AjaxButton onSubmit',
AjaxButton and OnError. I did not get anything that addressed this.So do
bear with me with this is re-post.

I have a field(few fields) for which is setRequired(true).

Below this field(s) I have an WebMarkupContainer that contains a
ListMultipleChoice control with Add and Add buttons. These buttons are of
type AjaxButton.

When I select some items form the ListMultipleChoice control and hit Add or
Add ALL, it triggers the form validation for the 'required fields' and in
this case I have not 'yet' populated them. So instead of onSubmit, it goes
to onError.

How can I get around this? Best practices?

Thanks for the time
Regards
Niv


Re: AjaxButton OnSubmit Validation Overridden

2010-07-22 Thread Nivedan Nadaraj
 Thanks for that, that worked. I have used this feature before for the
Cancel operation. Just did not occur to me.
Cheers


On Thu, Jul 22, 2010 at 3:41 PM, MattyDE ufer.mar...@gmail.com wrote:


 you could Try to set

/**
 * Sets the defaultFormProcessing property. When false (default is
 true),
 all validation and
 * form updating is bypassed and the onSubmit method of that button
 is
 called directly, and the
 * onSubmit method of the parent form is not called. A common use
 for this
 is to create a cancel
 * button.
 *
 * @param defaultFormProcessing
 *defaultFormProcessing
 * @return This
 */
public final Button setDefaultFormProcessing(boolean
 defaultFormProcessing)

 to false on the AjaxButton (Button.class)
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Re-AjaxButton-OnSubmit-Validation-Overridden-tp2298251p2298256.html
 Sent from the Wicket - User 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: AjaxButton OnSubmit Validation Overridden

2010-07-22 Thread Nivedan Nadaraj
Although..the Model is not updated on the ListMultipleChoice control. So
when I use the Remove Selected button I get the values from
listControl.getModelObject() this returns a null list.So a NP exception is
thrown.

I turned the defaultFormProcessing back on to the standard one for this'
particular button'. When I provide the required fields with data then it
works as in no NP exception and the model does return the values selected.

Any pointers? Cheers
Niv

On Thu, Jul 22, 2010 at 4:19 PM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Thanks for that, that worked. I have used this feature before for the
 Cancel operation. Just did not occur to me.
 Cheers



 On Thu, Jul 22, 2010 at 3:41 PM, MattyDE ufer.mar...@gmail.com wrote:


 you could Try to set

/**
 * Sets the defaultFormProcessing property. When false (default is
 true),
 all validation and
 * form updating is bypassed and the onSubmit method of that button
 is
 called directly, and the
 * onSubmit method of the parent form is not called. A common use
 for this
 is to create a cancel
 * button.
 *
 * @param defaultFormProcessing
 *defaultFormProcessing
 * @return This
 */
public final Button setDefaultFormProcessing(boolean
 defaultFormProcessing)

 to false on the AjaxButton (Button.class)
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Re-AjaxButton-OnSubmit-Validation-Overridden-tp2298251p2298256.html
 Sent from the Wicket - User 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: AjaxButton OnSubmit Validation Overridden

2010-07-22 Thread Nivedan Nadaraj
Hi
Thanks for that, I guess building the piece of code as a separate
component(panle) helps. This should deal with Multi Select with add/remove
buttons with submit (Default behavior) .
Having the multi-select logic more generic would help in re-use.I think.

Cheers

On Thu, Jul 22, 2010 at 4:58 PM, vov vov...@mail.ru wrote:


 Hi,

 Read
 http://www.wicketframework.org/apidocs/wicket/markup/html/form/Form.html
 about nested forms.
 Also your can put your ListMultipleChoice and buttons to separate Panel
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Re-AjaxButton-OnSubmit-Validation-Overridden-tp2298251p2298343.html
 Sent from the Wicket - User 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: TextArea StringValidator and DateValidator

2010-07-22 Thread Nivedan Nadaraj
Thanks will try that. Cheers
Thanks for ut time
Cheers
Niv
On Thu, Jul 22, 2010 at 10:07 PM, vov vov...@mail.ru wrote:


 Create XML file that named same with your class and put ot it

 entry key=studyDescriptionTxtArea.StringValidator.rangeYOUR TEXT HERE
 is
 not between ${minimum} and ${maximum} characters long/entry

 instead studyDescriptionTxtArea must be wicket:id of your TextField
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Re-TextArea-StringValidator-and-DateValidator-tp2298113p2298722.html
 Sent from the Wicket - User 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




How to be a Top Wicket Developer

2010-07-22 Thread Nivedan Nadaraj
Hi Guys

This is off topic but how does one become a top developer for wicket? What
do you think brings forth that talent and creativity?
Cheers
Niv


Re: How to be a Top Wicket Developer

2010-07-22 Thread Nivedan Nadaraj
   1. Brian..great thoughts. I am just a beginer in this framework but
   amazed at the knowledge and I must quote Callinghan sorry if I mispelt, he
   was the main guy for Stuts framework a decade ago.He said he had the servlet
   spec in the inside of his eyeballs. I always wondered!!!

Point taken building apps with a self drive is the only option I have.But I
have worked in .Net and Java..its a big challenge here in terms of
RAD...driving this particular app I want to do justice , follow proper
design guidelines from the leaders and deliver a product if not great a
standard one.

Thanks for that and your time in writing this email. Sorry guys for shooting
such an email But kudos to the great develoepers and app developers who know
the pulse of the framework.

Cheers
Niv

On Thu, Jul 22, 2010 at 11:59 PM, Brian Topping topp...@codehaus.orgwrote:

 I think it primarily comes from having a client that will push you to do
 things with it that you didn't think you could do before.

 Otherwise, you have to push yourself, and that takes a longer because
 people naturally avoid things that they aren't familiar with.

 Note there are different types of Wicket developers.  If you want to work
 on the framework itself, it's a superset of the skills to be a great app
 developer using Wicket.  I personally have no shame in being a great Wicket
 developer who is very happy with what's there already.  But if you want to
 be a contributor to the framework, you're obviously going to have to have a
 vision for what you need and be able to package it in a way that others will
 find pleasing, and do so with a coding style that doesn't annoy the rest of
 the team members.  From my experience with other OSS projects, that's
 something that's better handled slowly and over time.  If someone was
 wondering what it takes to be a top framework developer, they probably don't
 have it yet, so I would focus first on creating great apps first, and back
 to getting some work where you can practice and be pushed to do things you
 haven't done before.

 $0.02, YMMV, etc.

 On Jul 22, 2010, at 11:33 AM, Nivedan Nadaraj wrote:

  Hi Guys
 
  This is off topic but how does one become a top developer for wicket?
 What
  do you think brings forth that talent and creativity?
  Cheers
  Niv


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




Re: How to be a Top Wicket Developer

2010-07-22 Thread Nivedan Nadaraj
Cheers mate..but i lost u in the end of that line...

On Thu, Jul 22, 2010 at 11:46 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Fix a few core bugs and pimp 1.5 ;]

 **
 Martin

 2010/7/22 Nivedan Nadaraj shravann...@gmail.com:
  Hi Guys
 
  This is off topic but how does one become a top developer for wicket?
 What
  do you think brings forth that talent and creativity?
  Cheers
  Niv
 

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




Re: How to be a Top Wicket Developer

2010-07-22 Thread Nivedan Nadaraj
I apologise for starting a thread like this, there was a response that was I
felt offending...looks like there some dont appreciate the thrill of true
knoweldge. I request moderator to remove anything that offends.
My apologies..
Cheers


On Fri, Jul 23, 2010 at 12:12 AM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Cheers mate..but i lost u in the end of that line...


 On Thu, Jul 22, 2010 at 11:46 PM, Martin Makundi 
 martin.maku...@koodaripalvelut.com wrote:

 Fix a few core bugs and pimp 1.5 ;]

 **
 Martin

 2010/7/22 Nivedan Nadaraj shravann...@gmail.com:
  Hi Guys
 
  This is off topic but how does one become a top developer for wicket?
 What
  do you think brings forth that talent and creativity?
  Cheers
  Niv
 

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





Re: TextArea StringValidator and DateValidator

2010-07-21 Thread Nivedan Nadaraj
Hi All


This is related to validating two types of Form components with Wicket 1.4.9


1.Validating a TextArea using the StringValidator to check for a min and max
length.
   studyDescriptionTxtArea.add(StringValidator.lengthBetween(1, 255));

When I tested with a text content that triggers this validation, the error
message reported displays the content of the Text Area  that was entered
followed by
the error message..e.g Output:
All the text from studyDescriptionTxtArea + is not between 1 and 255
characters long.The user woudn't  want it to repeat the content on the
feedback panel.

Where have i gone wrong and what is involved in resolving it?

2. Validating a Date Field to report if the date entered is in the future.

   dateOfApplicationDp.setLabel( new
StringResourceModel(error.study.doa.max.range,this, null));
   dateOfApplicationDp.add(DateValidator.maximum(new Date()));//I could
format this date to a dd/mm/yyy but just for the test

   The resource key has the field name: i.e Date Of Application

   However I get the following message:

   07/24/2010' is larger than the maximum of Thu Jul 22 12:03:00 WST 2010.

   It is correct but would like to control this prefixed with the Field Name
also how can I add the custom error message and not just the label? i.e Date
Of Application cannot be in the future and override what Wicket Validator
returns?

Thanks for the time

Regards
Niv


Re: Wicket's Form Model (using hibernate entity or value objects) Design

2010-07-16 Thread Nivedan Nadaraj
Hi
Thanks for the pointer. I did read through models and
LoadableDetachableModel. Not sure if this model addresses the problem at
hand. Isn't LDM related to performance and resoles
Serialization issues? In the same note I came across Chaining of models. or
Nesting of Models...can you/someone give me more information on it.

Probably I should have mentioned that I wrap my hibernate entity in a
CompoundPropertyModel like this

MyForm extends Form{

   MyForm( new CompoundPropertyModel(studyEntity));
   //I also want to be able to add another model that will capture input
from the form.e.g LdapStudy

}


Any pointers will be great thanks again for the time

Nive
On Thu, Jul 15, 2010 at 5:10 PM, vov vov...@mail.ru wrote:


 see org.apache.wicket.model.LoadableDetachableModel
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Re-Wicket-s-Form-Model-using-hibernate-entity-or-value-objects-Design-tp2289854p2289870.html
 Sent from the Wicket - User 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's Form Model (using hibernate entity or value objects) Design

2010-07-16 Thread Nivedan Nadaraj
Thanks. How do i let the form know that it has one or more models? In the
above I invoke the
super(id, new CompoundPropertyModelStudy(study)); So this wraps the model
as study. How will be able to add the second model in the same manner?
If it sounds too basic do bear with me I will experiment as well.

Thanks again
Niv


On Fri, Jul 16, 2010 at 7:04 PM, James Carman ja...@carmanconsulting.comwrote:

 Your form can edit two different objects.   It will edit whatever you bind
 your fields to

 On Jul 16, 2010 4:23 AM, Nivedan Nadaraj shravann...@gmail.com wrote:
  Hi
  Thanks for the pointer. I did read through models and
  LoadableDetachableModel. Not sure if this model addresses the problem at
  hand. Isn't LDM related to performance and resoles
  Serialization issues? In the same note I came across Chaining of models.
 or
  Nesting of Models...can you/someone give me more information on it.
 
  Probably I should have mentioned that I wrap my hibernate entity in a
  CompoundPropertyModel like this
 
  MyForm extends Form{
 
  MyForm( new CompoundPropertyModel(studyEntity));
  //I also want to be able to add another model that will capture input
  from the form.e.g LdapStudy
 
  }
 
 
  Any pointers will be great thanks again for the time
 
  Nive
  On Thu, Jul 15, 2010 at 5:10 PM, vov vov...@mail.ru wrote:
 
 
  see org.apache.wicket.model.LoadableDetachableModel
  --
  View this message in context:
 

 http://apache-wicket.1842946.n4.nabble.com/Re-Wicket-s-Form-Model-using-hibernate-entity-or-value-objects-Design-tp2289854p2289870.html
  Sent from the Wicket - User 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's Form Model (using hibernate entity or value objects) Design

2010-07-16 Thread Nivedan Nadaraj
Hi Jeremy,
Nice I follow you now. I can have a container java class and have any number
of member variables which in turn can be a hibernate entity and a regular
java bean. The container java class will be the model. And on detach; i
would have to have the container java class extend IModel and implement the
detach() am i right?

Thank you will give that a shot. Thanks for the time and thoughts.

Regards
Nivedan

On Fri, Jul 16, 2010 at 7:44 PM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 Either create a model object that contains your study and foo objects, or
 hold an IModelfoo as a private variable. Remember it's just regular java,
 so you can use member variables. Just don't forget to detach any model you
 hold as a variable manually.

 Jeremy Thomerson
 -- sent from my smartphone - please excuse formatting and spelling errors

 On Jul 16, 2010 6:30 AM, Nivedan Nadaraj shravann...@gmail.com wrote:

 Thanks. How do i let the form know that it has one or more models? In the
 above I invoke the
 super(id, new CompoundPropertyModelStudy(study)); So this wraps the model
 as study. How will be able to add the second model in the same manner?
 If it sounds too basic do bear with me I will experiment as well.

 Thanks again
 Niv


 On Fri, Jul 16, 2010 at 7:04 PM, James Carman ja...@carmanconsulting.com
 wrote:


  Your form can edit two different objects. It will edit whatever you bind
  your fields to
 
  O...



Re: Wicket's Form Model (using hibernate entity or value objects) Design

2010-07-16 Thread Nivedan Nadaraj
HI Pedro
Thanks for taking the time. I really appreaciate this community and love it.

What Jeremy mentioned provided the solution where in the we let wicket use
the hierarchy to use the model class that contains other beans and
introspect the property expression and set/get values. That way the panel is
not holding on to the beans.

I see your point to and i will try that as well. You have also provided a
solution on the same basis ie have private members in a panel. Thanks again.
I will get back to you on this.

Thanks a lot
Niv

On Fri, Jul 16, 2010 at 9:52 PM, Pedro Santos pedros...@gmail.com wrote:

 Hi Nivedan, Jeremy write  IModelfoo as a private variable and James
 Your form can edit two different objects.   It will edit whatever you bind
 your fields to

 If you have an form with some fields for some bean, and other fields for
 other beans, you can do something like:

 class panel {
  private modelForAnPropertyInSomeBean;
  private modelForAnPropertyInSomeOtherBean;
  some code block{
add(new textfield( id, modelForAnPropertyInSomeBean);
add(new textfield( id, modelForAnPropertyInSomeOtherBean);
  }
 }

 Is this what you want?

 On Fri, Jul 16, 2010 at 10:43 AM, Nivedan Nadaraj shravann...@gmail.com
 wrote:

  Hi Jeremy,
  Nice I follow you now. I can have a container java class and have any
  number
  of member variables which in turn can be a hibernate entity and a regular
  java bean. The container java class will be the model. And on detach; i
  would have to have the container java class extend IModel and implement
 the
  detach() am i right?
 
  Thank you will give that a shot. Thanks for the time and thoughts.
 
  Regards
  Nivedan
 
  On Fri, Jul 16, 2010 at 7:44 PM, Jeremy Thomerson 
  jer...@wickettraining.com
   wrote:
 
   Either create a model object that contains your study and foo objects,
 or
   hold an IModelfoo as a private variable. Remember it's just regular
  java,
   so you can use member variables. Just don't forget to detach any model
  you
   hold as a variable manually.
  
   Jeremy Thomerson
   -- sent from my smartphone - please excuse formatting and spelling
 errors
  
   On Jul 16, 2010 6:30 AM, Nivedan Nadaraj shravann...@gmail.com
  wrote:
  
   Thanks. How do i let the form know that it has one or more models? In
 the
   above I invoke the
   super(id, new CompoundPropertyModelStudy(study)); So this wraps the
  model
   as study. How will be able to add the second model in the same manner?
   If it sounds too basic do bear with me I will experiment as well.
  
   Thanks again
   Niv
  
  
   On Fri, Jul 16, 2010 at 7:04 PM, James Carman 
  ja...@carmanconsulting.com
   wrote:
  
  
Your form can edit two different objects. It will edit whatever you
  bind
your fields to
   
O...
  
 



 --
 Pedro Henrique Oliveira dos Santos



Re: Wicket's Form Model (using hibernate entity or value objects) Design

2010-07-16 Thread Nivedan Nadaraj
James
Thanks mate. I have couple of options i guess that is what pedro meant as
well. I guess Jeremy's solution is what i was looking for. in that the form
instance will have a CPM that refers a container bean that has members.

The solution u provided also is the identical but the members are in a
panel. Cool.
Thanks for the time,
Niv

On Fri, Jul 16, 2010 at 11:04 PM, James Carman
ja...@carmanconsulting.comwrote:

 You could put your components for editing the two different objects
 onto two different panels, which each have a CPM inside your form.

 On Fri, Jul 16, 2010 at 7:29 AM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
  Thanks. How do i let the form know that it has one or more models? In the
  above I invoke the
  super(id, new CompoundPropertyModelStudy(study)); So this wraps the
 model
  as study. How will be able to add the second model in the same manner?
  If it sounds too basic do bear with me I will experiment as well.
 
  Thanks again
  Niv
 
 
  On Fri, Jul 16, 2010 at 7:04 PM, James Carman 
 ja...@carmanconsulting.comwrote:
 
  Your form can edit two different objects.   It will edit whatever you
 bind
  your fields to
 
  On Jul 16, 2010 4:23 AM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
   Hi
   Thanks for the pointer. I did read through models and
   LoadableDetachableModel. Not sure if this model addresses the problem
 at
   hand. Isn't LDM related to performance and resoles
   Serialization issues? In the same note I came across Chaining of
 models.
  or
   Nesting of Models...can you/someone give me more information on it.
  
   Probably I should have mentioned that I wrap my hibernate entity in a
   CompoundPropertyModel like this
  
   MyForm extends Form{
  
   MyForm( new CompoundPropertyModel(studyEntity));
   //I also want to be able to add another model that will capture input
   from the form.e.g LdapStudy
  
   }
  
  
   Any pointers will be great thanks again for the time
  
   Nive
   On Thu, Jul 15, 2010 at 5:10 PM, vov vov...@mail.ru wrote:
  
  
   see org.apache.wicket.model.LoadableDetachableModel
   --
   View this message in context:
  
 
 
 http://apache-wicket.1842946.n4.nabble.com/Re-Wicket-s-Form-Model-using-hibernate-entity-or-value-objects-Design-tp2289854p2289870.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 
 

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




Re: Wicket's Form Model (using hibernate entity or value objects) Design

2010-07-15 Thread Nivedan Nadaraj
Hi All
I use Wicket with Hibernate. I have used the hibernate entity as a Form's
Model.Now however I noticed that I need to also add/update an LDAP
instance's entries.This means as part of my submit
Ineed to wicket to capture the non-entity properties also.

1. I either have to use a Value Object as a Form's model and then map it to
the entity that needs to be perisisted.
2. Map the VO values into LDAP.

This means i would have additional Mappers/Assemblers adding in more code to
be maintained and adds duplicate objects of the model itself.

Is there any other pattern someone has used in such a scenario?

I know this problem has a mix of Wicket and Hibernate but its just a design
issue.Any pointers?

Thanks for the time
Cheers
Nive


Setting the RadioChoice with selected value -

2010-07-12 Thread Nivedan Nadaraj
Hi All

The problem:

This seems pretty basic but I have some issues when I want the UI to be set
with the value from the Model. Any pointers  would be great.

My Model has a property of type Boolean.On the UI I represent this as Yes
and No using RadioChoice. When I perist this enitity,
the Yes is converted into a boolean and then persisted in the database.

However when the page refreshes,  the radio buttons loosed their
pre-selected/selected values.I guess its around the Model that I have gone
wrong.

ListString list = new ArrayListString();
list.add(Yes);
list.add(No);

PropertyModel propertyModel = new
PropertyModel(study,autoGenerateSubjectKey); //study is the Entity and has
a property autoGenerateSubjectKey
return new RadioChoiceString(radioChoiceId,propertyModel,list);

Thank you
Regards
Niv


Re: Setting the RadioChoice with selected value -

2010-07-12 Thread Nivedan Nadaraj
That helped a lot thank you.It works now.

Earlier, (prior to your response) I went about changing the type of Radio
and List  to Boolean but used the default ChoiceRenderer and  I was not sure
what the ID and displayValue will be for a field like the one I was using.

Thanks for the time.
Cheers
Niv

On Mon, Jul 12, 2010 at 4:42 PM, sander v F sandervanfaas...@gmail.comwrote:

 in this case 'autoGenerateSubjectKey' should contain Yes or No to be
 selected.

 You could change the property type of 'autoGenerateSubjectKey' from Boolean
 to String, but i think it is better to change the type of the choices to
 Boolean:


 ListBoolean list = new ArrayListBoolean();
 list.add(Boolean.TRUE);
 list.add(Boolean.FALSE);

 IChoiceRendererBoolean choiceRederer = new IChoiceRendererBoolean()
 {
 /** serialVersionUID */
 private static final long serialVersionUID = 1L;

 /**
  * @see

 org.apache.wicket.markup.html.form.IChoiceRenderer#getDisplayValue(java.lang.Object)
  */
 public Object getDisplayValue(final Boolean b)
 {
 String displayValue = No;
 if (b != null  b.booleanValue())
 {
 displayValue = Yes;
 }
 return displayValue;
 }

 /**
  * @see

 org.apache.wicket.markup.html.form.IChoiceRenderer#getIdValue(java.lang.Object,
 int)
  */
 public String getIdValue(final Boolean object, final int index)
 {
 return object.toString();
 }
 };

 PropertyModelBoolean propertyModel =
 new PropertyModelBoolean(study,autoGenerateSubjectKey);
 return new
 RadioChoiceBoolean(radioChoiceId,propertyModel,list,choiceRenderer);




 2010/7/12 Nivedan Nadaraj shravann...@gmail.com

  Hi All
 
  The problem:
 
  This seems pretty basic but I have some issues when I want the UI to be
 set
  with the value from the Model. Any pointers  would be great.
 
  My Model has a property of type Boolean.On the UI I represent this as Yes
  and No using RadioChoice. When I perist this enitity,
  the Yes is converted into a boolean and then persisted in the database.
 
  However when the page refreshes,  the radio buttons loosed their
  pre-selected/selected values.I guess its around the Model that I have
 gone
  wrong.
 
  ListString list = new ArrayListString();
  list.add(Yes);
  list.add(No);
 
  PropertyModel propertyModel = new
  PropertyModel(study,autoGenerateSubjectKey); //study is the Entity and
  has
  a property autoGenerateSubjectKey
  return new RadioChoiceString(radioChoiceId,propertyModel,list);
 
  Thank you
  Regards
  Niv
 



Re Refreshing a DropDownChoice - CRUD Pattern

2010-07-09 Thread Nivedan Nadaraj
Hi All,

I have an issue with refreshing a DropDownChoice control. I would like the
dropdown to have the Choose One option aevery time I want to a particular
action like Create new account etc.

I think it is how I designed my CRUD pattern, that I have this issue. Would
like to get your ideas/suggestions on a standard pattern for CRUD. The one I
am using now is as follows. Please comment on it so I can correct it.

The hierarchy of the controls are as follows.

*ContainerPanel*: Acts as a container to house the *SearchPanel*

When the *ContainerPanel* is constructed, I create an instance of *
SearchPanel*.

As part of the *SearchPanel* construction
 a) I create instances of  *DetailPanel* and set the visibility to false.
 b) I create an instance of *SearchResultListPanel*
 c) The *DetailPanel* and *SearchResultListPanel* instances are added into *
SearchPanel*'s SearchForm(extends Form)  instance .

When I click on *New* button on *SearchPanel* and as part of the  onSubmit()
event I make the *DetailsPanel* visible.On the Details panel for the first
time the DropDownChoice
is renderd correctly with *Choose One* as the default option. -

After I create an entity via the *DetailsPanel*, I click on *New* again on
the *SearchPanel*,i.e to create a another entity. This time the dropdown
choice control does not have the
Choose One option.  I understand that the list is not in a refreshed state.
How can I get around this problem other than re-populating it.

I had a similar issue on the SearchPanel when I clicked Reset button, but
resolved it using *clearInput*() followed by *updateFormComponentModels()*;,
now this is within the particular Form constructor so I was able to access
the updateFormComponentModels(). Whereas now, the DropdownChoice is part of
the DetailsPanel form instance and updateFormComponentModel is protected.(
its not visible from SearchPanel)

Appreicate your time,

Thank you
Regards
Niv


Re: Using Wicket to build Application Portal

2010-06-17 Thread Nivedan Nadaraj
Hi Igor,

I have started work on the pattern you suggested. This is what I have done
so far but  there seems to be some missing pieces when I integrate the tabs
or try to fire them from container app, would be great to get some lead
here.

The Structure of the projects as follows.
*
Project: test-common
Description: Will provide common interfaces that sub applications can use.
One of them would be the CreateAppTab interface.
*Interface to create a new tab, goes like this.
*
public ITab createAppTab();*

Using maven POM I have marked it to be built  into a *.jar* file.The built
jar is available in the local maven repository so other applications can
refer to it.


*Project: test-container
Description: Will be the base application that will contain
sub-applications.*

This has the WebApplication and also a Sub-classed Web Application. As Part
of its POM, I have added *test-common* as a dependency.
I build this project as a .*WAR *file. As part of its *WEB-INF/lib*, I find
the* test-common.jar*
At this point it satisfies the requirements of a Container Application that
contains the module(jar) as part of it.( Please correct me if I have
deviated)

*Project:test-application-1*
*Description: Will be one of the applications. Provides Tab(s) that will be
associated with this app.* *Project will be built as a .jar*

I do not have a Web Application as part of this project. I include a
dependency to* test-common.jar* in test-application-1's POM. (Since I
thought adding dependency to test-container.war did not seem sensible,
correct me if I am wrong.)  One of the panel class in this application
implements the test-common's createAppTab interface and add's the returned
ITab instance into a List. The ListITab is added into an instance of
TabbedPanel. The instance of TabbedPanel is added into the Panel. I have a
corresponding basic markup for this Panel class.

*Re-Visit test-container*
I modified the test-container's POM to include test-application-1 as a
dependency(jar) and built it into a .WAR. The war now contains two
jars *test-common.jar
and **test-application-1.jar
Is this build strategy acceptable? In one build, able to include the
dependent application's jar's into one single WAR.

Doubts:*

1. I need to know how these individual applications/plugins will be fired to
render the tabs (create an instance of the tabs) from the test-container.
when the application is started on lands on the Home Page for instance?


[On a side note what I did try on those lines was I created an instance  of
the sub-application's class that implemented the Tab Interface and added it
to the home page instance.
As in..
App1Tab tab1 = new App1Tab(someTab); //This would fire the constructor and
create the tab instances
add(tab1);

This was not a success, as it comes up with a Wicket runtime exception

ITab.getPanel() returned a panel with invalid id [studyPanel]. You
must always return a panel with id equal to the provided panelId
parameter.
TabbedPanel [8:stab:moduleTabsList] ITab index [0]
]


Thanks for the time, will be great to hear from you on this.

Regards
Niv






On Thu, Jun 10, 2010 at 11:46 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 On Wed, Jun 9, 2010 at 8:20 PM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
  Hi Igor,
 
  Thank you for the quick response and what a ray of hope it brings! It
  certainly, from  your experience seems to be a very good design approach.
 I
  am excited to implement it.
 
  The question(s)/confirmation at this point in time is :
 
  1.Will Application 2..(n)  ever extend the sub-class Web Application
  provided by the Container Application? [I guess not, since Application-2
  needs to be built as a jar and packaged with Container-Application's WAR.
  Which means sub application's (jars) will all be part of a Single Wicket
  Application instance] (Am I right?)

 correct, since 2..n are plugins rather then applications they do not
 need their own application class.

  2. The Tab Provider Interface you mentioned that would be part of the
 common
  jar in Container-Application; would that be a class like
  org.apache.wicket.extensions.markup.html.tabs.AbstractTab ? This is what
 I
  have used at the moment.

 sure, that will work. usually i have something like this

 public interface MainTabProvider { ITab newMainTab(); }

 followed by

 public interface ApplicationPlugin extends TabProvider, .. bunch of
 other interfaces

 -igor
 
  Appreciate your time. Glad to be using the right framework and not have
 to
  switch to another framework.
 
  Many thanks
  Regards
 
 
 
 
 
  On Wed, Jun 9, 2010 at 10:44 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  ive done this many times already, wicket is perfect for things like
 these.
 
  application 1 should be a simple wicket container app. this is a full
  application with its own subclass of WicketApplication and is what is
  going to be packaged as a war file. it should also have a module (jar)
  with the interfaces for the common

Re: Using Wicket to build Application Portal

2010-06-17 Thread Nivedan Nadaraj
Hi Igor,

I have moved a bit forward since the last email but would like your thoughts
on it. I am now able to render the top level tab from
t*est-application-1*and test-application-2. This is after I resolved
the Wicket Runtime
Exception.

Now going forward, this is how I fire the classes that provide the
application tabs from the container application

On the HomePage of the Container Application (for example)

I instantiate the sub-application's tabs.

 StudyTab appStudy = new StudyTab(App1Tab);
 add(appStudy);

 SubjectTab appParticipants = new SubjectTab(App2Tab);
 add(appParticipants);

The homepage.html contains a reference to the components App1Tab and App2Tab

div wicket:id=App1Tab/div
div wicket:id=App2Tab/div

So I can see that each sub-application is contributing to the top level
(container) menu's. Thus abstracting the details to each sub application. I
am yet to render the sub-menus for each application but I guess that is easy
since its within the context of each sub application.

1. I would like to get some confirmation if I am on the right path and is
this how I should fire the sub-application's entry level tabs?
2. Is there a better way ?
3. Would like to post another question related to application context as
part of sub-applications? How would application 1..n have reference to the
application context? I guess will try to work it from my side in the
meantime.

Please let me know on #1 and #2 and if I have not deviated.

Many thanks
Regards
Niv



On Thu, Jun 17, 2010 at 4:21 PM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Hi Igor,

 I have started work on the pattern you suggested. This is what I have done
 so far but  there seems to be some missing pieces when I integrate the tabs
 or try to fire them from container app, would be great to get some lead
 here.

 The Structure of the projects as follows.
 *
 Project: test-common
 Description: Will provide common interfaces that sub applications can use.
 One of them would be the CreateAppTab interface.
 *Interface to create a new tab, goes like this.
 *
 public ITab createAppTab();*

 Using maven POM I have marked it to be built  into a *.jar* file.The built
 jar is available in the local maven repository so other applications can
 refer to it.


 *Project: test-container
 Description: Will be the base application that will contain
 sub-applications.*

 This has the WebApplication and also a Sub-classed Web Application. As Part
 of its POM, I have added *test-common* as a dependency.
 I build this project as a .*WAR *file. As part of its *WEB-INF/lib*, I
 find the* test-common.jar*
 At this point it satisfies the requirements of a Container Application that
 contains the module(jar) as part of it.( Please correct me if I have
 deviated)

 *Project:test-application-1*
 *Description: Will be one of the applications. Provides Tab(s) that will
 be associated with this app.* *Project will be built as a .jar*

 I do not have a Web Application as part of this project. I include a
 dependency to* test-common.jar* in test-application-1's POM. (Since I
 thought adding dependency to test-container.war did not seem sensible,
 correct me if I am wrong.)  One of the panel class in this application
 implements the test-common's createAppTab interface and add's the returned
 ITab instance into a List. The ListITab is added into an instance of
 TabbedPanel. The instance of TabbedPanel is added into the Panel. I have a
 corresponding basic markup for this Panel class.

 *Re-Visit test-container*
 I modified the test-container's POM to include test-application-1 as a
 dependency(jar) and built it into a .WAR. The war now contains two jars 
 *test-common.jar
 and **test-application-1.jar
 Is this build strategy acceptable? In one build, able to include the
 dependent application's jar's into one single WAR.

 Doubts:*

 1. I need to know how these individual applications/plugins will be fired
 to render the tabs (create an instance of the tabs) from the test-container.
 when the application is started on lands on the Home Page for instance?


 [On a side note what I did try on those lines was I created an instance  of
 the sub-application's class that implemented the Tab Interface and added it
 to the home page instance.
 As in..
 App1Tab tab1 = new App1Tab(someTab); //This would fire the constructor
 and create the tab instances
 add(tab1);

 This was not a success, as it comes up with a Wicket runtime exception

 ITab.getPanel() returned a panel with invalid id [studyPanel]. You must 
 always return a panel with id equal to the provided panelId parameter.

 TabbedPanel [8:stab:moduleTabsList] ITab index [0]
 ]


 Thanks for the time, will be great to hear from you on this.

 Regards
 Niv







 On Thu, Jun 10, 2010 at 11:46 AM, Igor Vaynberg 
 igor.vaynb...@gmail.comwrote:

 On Wed, Jun 9, 2010 at 8:20 PM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
  Hi Igor,
 
  Thank you for the quick response and what a ray of hope it brings! It
  certainly

Re: Using Wicket to build Application Portal

2010-06-17 Thread Nivedan Nadaraj
Hi Igor

Thank you for that.  Discovery of sub-applications using the
'provider-lookup' mechanism sounds pretty cool.
I will investigate that concept and work on it,

The # 3. :I I guess If I work on it things will get clearer and if something
is not would bounce it off you.

Many thanks for the valuable guidance.

Regards
Niv

On Fri, Jun 18, 2010 at 4:32 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 On Thu, Jun 17, 2010 at 3:14 AM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
  Hi Igor,
 
  I have moved a bit forward since the last email but would like your
 thoughts
  on it. I am now able to render the top level tab from
  t*est-application-1*and test-application-2. This is after I resolved
  the Wicket Runtime
  Exception.
 
  Now going forward, this is how I fire the classes that provide the
  application tabs from the container application
 
  On the HomePage of the Container Application (for example)
 
  I instantiate the sub-application's tabs.
 
   StudyTab appStudy = new StudyTab(App1Tab);
   add(appStudy);
 
   SubjectTab appParticipants = new SubjectTab(App2Tab);
   add(appParticipants);
 
  The homepage.html contains a reference to the components App1Tab and
 App2Tab
 
  div wicket:id=App1Tab/div
  div wicket:id=App2Tab/div
 
  So I can see that each sub-application is contributing to the top level
  (container) menu's. Thus abstracting the details to each sub application.
 I
  am yet to render the sub-menus for each application but I guess that is
 easy
  since its within the context of each sub application.
 
  1. I would like to get some confirmation if I am on the right path and is
  this how I should fire the sub-application's entry level tabs?

 you are on the right track.

  2. Is there a better way ?

 you are doing the discovery of sub-applications manually - eg
 hardcoding it into the container project, it would be nicer if they
 were automatically discovered at runtime. you can use whatever
 discovery mechanism you want, for example you can use java's service
 provider http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Service
 Provider

  3. Would like to post another question related to application context as
  part of sub-applications? How would application 1..n have reference to
 the
  application context? I guess will try to work it from my side in the
  meantime.

 what is the application context? the instance of application? it can
 be pulled out from any wicket thread using Application.get()

 -igor
 
  Please let me know on #1 and #2 and if I have not deviated.
 
  Many thanks
  Regards
  Niv
 
 
 
  On Thu, Jun 17, 2010 at 4:21 PM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
 
  Hi Igor,
 
  I have started work on the pattern you suggested. This is what I have
 done
  so far but  there seems to be some missing pieces when I integrate the
 tabs
  or try to fire them from container app, would be great to get some lead
  here.
 
  The Structure of the projects as follows.
  *
  Project: test-common
  Description: Will provide common interfaces that sub applications can
 use.
  One of them would be the CreateAppTab interface.
  *Interface to create a new tab, goes like this.
  *
  public ITab createAppTab();*
 
  Using maven POM I have marked it to be built  into a *.jar* file.The
 built
  jar is available in the local maven repository so other applications can
  refer to it.
 
 
  *Project: test-container
  Description: Will be the base application that will contain
  sub-applications.*
 
  This has the WebApplication and also a Sub-classed Web Application. As
 Part
  of its POM, I have added *test-common* as a dependency.
  I build this project as a .*WAR *file. As part of its *WEB-INF/lib*, I
  find the* test-common.jar*
  At this point it satisfies the requirements of a Container Application
 that
  contains the module(jar) as part of it.( Please correct me if I have
  deviated)
 
  *Project:test-application-1*
  *Description: Will be one of the applications. Provides Tab(s) that will
  be associated with this app.* *Project will be built as a .jar*
 
  I do not have a Web Application as part of this project. I include a
  dependency to* test-common.jar* in test-application-1's POM. (Since I
  thought adding dependency to test-container.war did not seem sensible,
  correct me if I am wrong.)  One of the panel class in this application
  implements the test-common's createAppTab interface and add's the
 returned
  ITab instance into a List. The ListITab is added into an instance of
  TabbedPanel. The instance of TabbedPanel is added into the Panel. I have
 a
  corresponding basic markup for this Panel class.
 
  *Re-Visit test-container*
  I modified the test-container's POM to include test-application-1 as a
  dependency(jar) and built it into a .WAR. The war now contains two jars
 *test-common.jar
  and **test-application-1.jar
  Is this build strategy acceptable? In one build, able to include the
  dependent application's jar's into one single WAR.
 
  Doubts

Re: Using Wicket to build Application Portal

2010-06-17 Thread Nivedan Nadaraj
Hi Igor,

I went through the provider-lookup mechanism and as I study  the current
project structure it seems to relate to the concept of Extension Mechansim.(
http://java.sun.com/docs/books/tutorial/ext/basics/install.html)  Am I
correct?

1. the *t*est-common.jar that provides the interface to build the tabs acts
as the Service.*

2. *the test-application-1.jar providing the actual implementation of the
Service will be the Service Provider.*

3.* Since test-application-1.jar is within the application classpath of
test-container application*, if* I added a file modified/added an entry into
* *META-INF/services/org.commons.MainTabProvider

4. And add a line  into this file pointing to the provider
org.testapp1.provider.MainTabProvider
   # Provider Implementation for MainTabProvider interface

5. With # 3 and #4 implemented, can the test-container application can now
reference the provider implementation to get to the tabs? So it does not
directly hardcode the classes to get the tab items but gets it via the
provider.

Questions:

1. What *extension* or type of file would
META-INF/services/org.commons.MainTabProvider
be?
2. When I built sub-application using Maven I do not see the
*services*folder as part of META-INF by default. How can I get that as
part of the
maven build?
3. Once available as part of the services directory under META-INF, how will
the container application gain access to the *implementation*? Can I just
say MainTabProvider.*createAppTab()?
It has to somehow return the instance of the provider so wondering if
there must be a lookup ?

Will be great to hear from you on this,

In the meantime will do my research and hope to get there

Thanks
Niv

*
*
*
On Fri, Jun 18, 2010 at 10:16 AM, Nivedan Nadaraj shravann...@gmail.comwrote:

 Hi Igor

 Thank you for that.  Discovery of sub-applications using the
 'provider-lookup' mechanism sounds pretty cool.
 I will investigate that concept and work on it,

 The # 3. :I I guess If I work on it things will get clearer and if
 something is not would bounce it off you.

 Many thanks for the valuable guidance.

 Regards
 Niv


 On Fri, Jun 18, 2010 at 4:32 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 On Thu, Jun 17, 2010 at 3:14 AM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
  Hi Igor,
 
  I have moved a bit forward since the last email but would like your
 thoughts
  on it. I am now able to render the top level tab from
  t*est-application-1*and test-application-2. This is after I resolved
  the Wicket Runtime
  Exception.
 
  Now going forward, this is how I fire the classes that provide the
  application tabs from the container application
 
  On the HomePage of the Container Application (for example)
 
  I instantiate the sub-application's tabs.
 
   StudyTab appStudy = new StudyTab(App1Tab);
   add(appStudy);
 
   SubjectTab appParticipants = new SubjectTab(App2Tab);
   add(appParticipants);
 
  The homepage.html contains a reference to the components App1Tab and
 App2Tab
 
  div wicket:id=App1Tab/div
  div wicket:id=App2Tab/div
 
  So I can see that each sub-application is contributing to the top level
  (container) menu's. Thus abstracting the details to each sub
 application. I
  am yet to render the sub-menus for each application but I guess that is
 easy
  since its within the context of each sub application.
 
  1. I would like to get some confirmation if I am on the right path and
 is
  this how I should fire the sub-application's entry level tabs?

 you are on the right track.

  2. Is there a better way ?

 you are doing the discovery of sub-applications manually - eg
 hardcoding it into the container project, it would be nicer if they
 were automatically discovered at runtime. you can use whatever
 discovery mechanism you want, for example you can use java's service
 provider http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Service
 Provider

  3. Would like to post another question related to application context as
  part of sub-applications? How would application 1..n have reference to
 the
  application context? I guess will try to work it from my side in the
  meantime.

 what is the application context? the instance of application? it can
 be pulled out from any wicket thread using Application.get()

 -igor
 
  Please let me know on #1 and #2 and if I have not deviated.
 
  Many thanks
  Regards
  Niv
 
 
 
  On Thu, Jun 17, 2010 at 4:21 PM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
 
  Hi Igor,
 
  I have started work on the pattern you suggested. This is what I have
 done
  so far but  there seems to be some missing pieces when I integrate the
 tabs
  or try to fire them from container app, would be great to get some lead
  here.
 
  The Structure of the projects as follows.
  *
  Project: test-common
  Description: Will provide common interfaces that sub applications can
 use.
  One of them would be the CreateAppTab interface.
  *Interface to create a new tab, goes like this.
  *
  public ITab createAppTab

Re: Using Wicket to build Application Portal

2010-06-09 Thread Nivedan Nadaraj
Hi All,

I will try to articulate my requirement. Can I call it a Wicket based
Portal?

I have an application lets call it Application-1  that provides common
functionality such as Authentication/Authorization. It also will provide the
Business layer/Service methods.
As part of this web application, it builds the the TOP level tab menus. Each
of the tab menu will represent a related business application. There is one
single entry point to the whole application suite.

Now, I want to build one of the related business application(Application-2)
using Wicket, Hibernate etc and inherit the common functionality provided by
Application-1. However, I want to provide/or add to the Tab menu provided by
Application-1 and integrate with it. As part of Application-1, I want to be
able to provide Tab1. And as part of Appication-2, I want to be able to
provide Tab2.

So when I eventually build the whole application suite, I must be able to
enable/disable a particular application tab or access to an application
through some business rules (License) etc. Also it should give me the
flexibility to
maintain each module/application independently and allow me to deploy a
particular module for a client.

It is pretty critical that  I have a good solution that gives a reasonable
amount of flexibility. I am sure you must have come across such
requirements, more like a portal. Only, I have to build it using Wicket.
Just so you are aware this is the set up for the project.

Web Tier: Wicket with Wiquery
Security: Apache Shiro
Service Tier: Spring
Model/Persistence: Hibernate/Spring LDAP
Servlet Engine: Tomcat

Would be great to hear some pattern I can follow and references if any that
can serve as a start-up. Any thoughts/experience from your end would be
great and valuable.

Some doubts that lurks in my mind.

1. Does Application-2 need to have a Wicket Application .i.e need to extend
a Wicket Application? Makes sense if I want to deploy it as a stand-alone
one.But If i want to integrate and use the set up as part of Application-1,
should I build the project without a Wicket Applications?

2. How does Application- 2 render the Tabs and integrate with Application-1
that does not know/aware of its child projects?

3. As an alternative, I can build application-2 as part of application-1.
The downside is, when a client wants only few modules, I would need to build
and package the whole suite.This is my last resort but sure your thoughts
will make a difference.

Appreciate your thoughts and time,

Many thanks
Nivedan


Re: Using Wicket to build Application Portal

2010-06-09 Thread Nivedan Nadaraj
Hi Igor,

Thank you for the quick response and what a ray of hope it brings! It
certainly, from  your experience seems to be a very good design approach. I
am excited to implement it.

The question(s)/confirmation at this point in time is :

1.Will Application 2..(n)  ever extend the sub-class Web Application
provided by the Container Application? [I guess not, since Application-2
needs to be built as a jar and packaged with Container-Application's WAR.
Which means sub application's (jars) will all be part of a Single Wicket
Application instance] (Am I right?)

2. The Tab Provider Interface you mentioned that would be part of the common
jar in Container-Application; would that be a class like
org.apache.wicket.extensions.markup.html.tabs.AbstractTab ? This is what I
have used at the moment.

Appreciate your time. Glad to be using the right framework and not have to
switch to another framework.

Many thanks
Regards





On Wed, Jun 9, 2010 at 10:44 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 ive done this many times already, wicket is perfect for things like these.

 application 1 should be a simple wicket container app. this is a full
 application with its own subclass of WicketApplication and is what is
 going to be packaged as a war file. it should also have a module (jar)
 with the interfaces for the common services it provides and a way to
 retrieve those interfaces.

 application 2 should be a jar file which contains all the necessary
 wicket artifacts such as pages. one of the things in it should be
 something that implements a tabprovider interface defined in
 application 1's common jar. the tabprovider would return a tab that
 contains a panel from application 2, this panel would act as the entry
 point into the application.

 the only other question is now packaging and deployment. the easiest
 way is to take the jar from application 2 and package it into
 application 1 as part of the war file. a trickier way to do it is to
 have a classloader that can look in some external folder and load from
 all the jars there, this external folder would contain the jars for
 application 2...n.

 -igor

 On Wed, Jun 9, 2010 at 7:11 AM, Nivedan Nadaraj shravann...@gmail.com
 wrote:
  Hi All,
 
  I will try to articulate my requirement. Can I call it a Wicket based
  Portal?
 
  I have an application lets call it Application-1  that provides common
  functionality such as Authentication/Authorization. It also will provide
 the
  Business layer/Service methods.
  As part of this web application, it builds the the TOP level tab menus.
 Each
  of the tab menu will represent a related business application. There is
 one
  single entry point to the whole application suite.
 
  Now, I want to build one of the related business
 application(Application-2)
  using Wicket, Hibernate etc and inherit the common functionality provided
 by
  Application-1. However, I want to provide/or add to the Tab menu provided
 by
  Application-1 and integrate with it. As part of Application-1, I want to
 be
  able to provide Tab1. And as part of Appication-2, I want to be able to
  provide Tab2.
 
  So when I eventually build the whole application suite, I must be able to
  enable/disable a particular application tab or access to an application
  through some business rules (License) etc. Also it should give me the
  flexibility to
  maintain each module/application independently and allow me to deploy a
  particular module for a client.
 
  It is pretty critical that  I have a good solution that gives a
 reasonable
  amount of flexibility. I am sure you must have come across such
  requirements, more like a portal. Only, I have to build it using Wicket.
  Just so you are aware this is the set up for the project.
 
  Web Tier: Wicket with Wiquery
  Security: Apache Shiro
  Service Tier: Spring
  Model/Persistence: Hibernate/Spring LDAP
  Servlet Engine: Tomcat
 
  Would be great to hear some pattern I can follow and references if any
 that
  can serve as a start-up. Any thoughts/experience from your end would be
  great and valuable.
 
  Some doubts that lurks in my mind.
 
  1. Does Application-2 need to have a Wicket Application .i.e need to
 extend
  a Wicket Application? Makes sense if I want to deploy it as a stand-alone
  one.But If i want to integrate and use the set up as part of
 Application-1,
  should I build the project without a Wicket Applications?
 
  2. How does Application- 2 render the Tabs and integrate with
 Application-1
  that does not know/aware of its child projects?
 
  3. As an alternative, I can build application-2 as part of application-1.
  The downside is, when a client wants only few modules, I would need to
 build
  and package the whole suite.This is my last resort but sure your thoughts
  will make a difference.
 
  Appreciate your thoughts and time,
 
  Many thanks
  Nivedan
 

 -
 To unsubscribe, e-mail: users-unsubscr