Re: Anemic domain model and are @SpringBean's compatible with the solution in "Spring 2.0 vs. the Anemic Domain Model"?

2009-05-28 Thread Will Jaynes
I use the same setup as you, but I add the use of the
OpenEntityManagerInViewFilter. I still use only Spring services from within
Wicket (as much as possible), but the domain objects can be as full featured
as needed because a Hibernate session is always open when Wicket is using
the services.

On Thu, May 28, 2009 at 9:49 AM, Kent Larsson wrote:

> You mean @SpringConfigured("something") like in the linked article?
>
> On Thu, May 28, 2009 at 3:41 PM, James Carman
>  wrote:
> > In your entities, you don't use @SpringBean.  You use
> @Configurable/@Autowire.
> >
> > On Thu, May 28, 2009 at 9:38 AM, Kent Larsson 
> wrote:
> >> Hi,
> >>
> >> Our current architecture:
> >> ---
> >>
> >> We're currently using a 3-tier architecture (presentation,
> >> service/business and persistence) consisting of Wicket (+ a little
> >> Spring), Spring and Spring + Hibernate:
> >>
> >> Wicket:
> >>
> >> Does presentation, we're not inside a transaction / Hibernate session
> >> so all used fields must be loaded by Spring. We call Spring singleton
> >> beans and annotate those fields with @SpringBean.
> >>
> >> Spring:
> >>
> >> In the service layer we have Spring singleton beans, services, which
> >> are called from the Wicket layer. We have our transaction / Hibernate
> >> session boundary at this layer. We call DAO's from this layer.
> >>
> >> Spring + Hibernate:
> >>
> >> Our DAO's are Spring singleton beans which performs database
> >> operations using HibernateTemplate.
> >>
> >> And common to all the layers are our entities. We use the @Entity
> >> annotation on them (not XML), from the Wicket layer we just use the
> >> accessor methods making sure that the relevant fields are loaded (as
> >> we would get an exception if they were Lazy and not yet loaded). Our
> >> entities are stupid, they lack logic and are used mostly like a struct
> >> in C/C++.
> >>
> >> I think the general pattern is pretty common for Java EE and Spring
> >> based web applications (feel free to disagree!). Yet it's classified
> >> as an anti-pattern by Martin Fowler as we are using mostly procedural
> >> programming and have an anemic domain model (
> >> http://en.wikipedia.org/wiki/Anemic_Domain_Model ).
> >>
> >> What I would like:
> >> ---
> >>
> >> I would like to use a more OOP approach and have logic in our current
> >> entities, creating a rich domain model. For that to work in all cases
> >> they need to be able to load and save data. I would still use a Spring
> >> singleton bean's for different services. But instead of changing the
> >> entities like structs they would be rich objects capable of chaning
> >> themself's and other objects.
> >>
> >> I found this article very interesting:
> >> http://www.nofluffjuststuff.com/blog_detail.jsp?rssItemId=96860
> >>
> >> But how would something like that work with Wicket? Could I just use
> >> @SpringBean like I'm currently doing but use it on both "entities" and
> >> Spring singleton services?
> >>
> >> For me this has a purely practical benefit, as I could use some
> >> inheritance in the domain object model to create different variations
> >> of logic and not just data. Wicket feels quite agile and nice to work
> >> with, but I still feel that the current architecture is a bit stale
> >> and seldom supports elegant OO solutions (that said, of course things
> >> can still be solved elegantly, I just think it would be easier if I
> >> could do it in a more OO oriented way).
> >>
> >> Comments? What are the pros and cons of this kind of architecture?
> >>
> >> All comments are greatly appreciated!
> >>
> >> Best regards, Kent
> >>
> >> -
> >> 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: DropDownChoice confusion!

2009-03-20 Thread Will Jaynes
Or, another way,

IChoiceRenderer cr = new IChoiceRenderer(){

public Object getDisplayValue(FixedCharges fixedCharges)
{
return fixedCharges.getDescription() + " - " +
fixedCharges.getValue();
}

public String getIdValue(FixedCharges fixedCharges, int index)
{
return fixedCharges.getValue();
}

};

On Fri, Mar 20, 2009 at 10:32 AM, Bigcalm wrote:

>
> Heya,  I'm trying to figure out the "best" way of handling drop down
> choices.
> It seems a bit overcomplicated and I'm not sure we're using them in the
> correct way?!!
>
> The database function to retrieve my data will be:
>
> List listFc = enquiryController.getAvailableFixedCharges("");
>
> 
> So I now have a list of primitive hibernate objects with lots of getters
> and
> setters.
> 
> I want my dropdownchoice to use more than one field from my original
> FixedCharges list for the description, so the text in the description field
> is...
>
> fixedCharges.getDescription() + " - " + fixedCharges.getValue();
>
> The key value I want returned though, is the unique key from that
> table/object - fixedCharges.getFChargeCode();
>
> 
> I've already worked out a couple of ways to do it, but I don't like either
> of them!!
>
> My first way was to iterate through the fixedcharges list and create a
> DropDownItem array before adding it to the form.  This seems an unnecessary
> iteration and I'd quite like to have the full fixedCharge object back when
> the form is submitted (which this method prevents - I have to go and
> reselect it from the database).
> My second way was to try to use a separate custom IChoiceRenderer class,
> but
> I don't really like this method either, it seems very complex and difficult
> to extend to a general case scenario.  I don't really want to have
> bazillions of IChoiceRenderer implementations one for every class I want a
> drop down list on.  Maybe I could have an implementation of the
> IChoiceRenderer as an unnamed inner class (which would be best I think) but
> I can't figure out how you do this.
>
> What's the best way to do it?   It must be a reasonably common problem.
>
> Cheers!
> --
> View this message in context:
> http://www.nabble.com/DropDownChoice-confusion%21-tp22621465p22621465.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
>
>


inmethod datagrid: how to contribute?

2009-03-20 Thread Will Jaynes
We have been using the inmethod datagrid in our latest project. (1.4
SNAPSHOT from wicketstuff-core) We have some bugs (or issues, at least) to
report and might have some contributions. I don't see a Jira project on the
wicketstuff jira nor is there info on the wicketstuff wiki. Is there a way
to contribute or communicate with the maintainers?

Will


Re: Trying Hibernate Validator Integration

2009-03-14 Thread Will Jaynes
I guess I'm not sure what you mean. Can you please show a code snippet?

On Sun, Mar 15, 2009 at 1:04 AM, taha siddiqi  wrote:

> I actually used it as a listener and at component level in my project.
>
> I will try to add this feature to it..
>
> Thanks
> taha
>
> On Sun, Mar 15, 2009 at 10:17 AM, Will Jaynes  wrote:
> > Taha, I've tried playing with  your HibernateValidator. It seems
> necessary
> > to add it to each form field. If I add it simply to the form, the
> validation
> > behavior doesn't happen. Am I missing something?
> > Will
> >
> > On Sat, Mar 14, 2009 at 9:06 AM, taha siddiqi 
> wrote:
> >
> >> I was myself very much interested and finally I found
> >>
> >> wicket-hibernate at
> >>
> >>
> http://www.jroller.com/wireframe/entry/hibernateannotationcomponentconfigurator
> >>
> >> and wicket-jpa at
> >> http://perfbench.googlecode.com/svn/trunk/perfbench/wicket-jpa/
> >>
> >> Then I came up which something that works for me ( already in the post )
> >>
> >> taha
> >>
> >>
> >> On Sat, Mar 14, 2009 at 6:16 PM, Will Jaynes  wrote:
> >> > In the archives, back in 2007, I see a lot of discussion about
> >> Hibernate/JPA
> >> > validator and Wicket, but I can't find if there was any result from
> those
> >> > discussions. Did anything come of it?
> >> >
> >> > Will
> >> >
> >> > On Tue, Mar 10, 2009 at 11:29 AM, taha siddiqi  >> >wrote:
> >> >
> >> >> but then how to get a ResourceBundle from wicket resource ??
> >> >>
> >> >>
> >> >> On Tue, Mar 10, 2009 at 8:43 PM, Peter Thomas 
> >> wrote:
> >> >> > On Tue, Mar 10, 2009 at 9:04 AM, taha siddiqi <
> tawushaf...@gmail.com>
> >> >> wrote:
> >> >> >
> >> >> >> But the problem is when you begin to use the wicket resource
> files,
> >> >> >> hibernate-validator comes with its own messages and need to be
> >> >> >> integrated with wicket ( which i was not able to )
> >> >> >
> >> >> >
> >> >> > There is some info here on how to pass a resource-bundle to the
> >> >> > ClassValidator constructor, I haven't tried it though:
> >> >> >
> >> >> >
> >>
> http://www.jboss.org/index.html?module=bb&op=viewtopic&t=69783&view=next
> >> >> >
> >> >> >
> >> >> >>
> >> >> >>
> >> >> >> taha
> >> >> >>
> >> >> >> On Tue, Mar 10, 2009 at 8:11 PM, Peter Thomas <
> ptrtho...@gmail.com>
> >> >> wrote:
> >> >> >> > On Tue, Mar 10, 2009 at 7:35 AM, taha siddiqi <
> >> tawushaf...@gmail.com>
> >> >> >> wrote:
> >> >> >> >
> >> >> >> >> Hi,
> >> >> >> >>
> >> >> >> >> I was working with Hibernate-validator and thought of sharing
> the
> >> >> code.
> >> >> >> >>
> >> >> >> >
> >> >> >> > Taha: I thought the ClassValidator will handle all the different
> >> cases
> >> >> >> and
> >> >> >> > annotations for you, see line #89
> >> >> >> >
> >> >> >> >
> >> >> >>
> >> >>
> >>
> http://code.google.com/p/perfbench/source/browse/trunk/perfbench/wicket-jpa/src/main/java/wicketjpa/wicket/EditBorder.java#89
> >> >> >> >
> >> >> >> > Is there any advantage of mapping each type (e.g. Min, Max,
> >> >> >> > CreditCardNumber) to Wicket built-in validators ?
> >> >> >> >
> >> >> >> >
> >> >> >> >>
> >> >> >> >> It is a listener as well as a behavior which can be used at
> >> >> >> >> application level as well as with individual
> >> >> >> >> components.
> >> >> >> >>
> >> >> >> >> It is heavily inspired from wicket-jpa and wicket-hibernate
> >> >> >> >> projects... I just tried some changes...
> >> >> >> >>
> >>

Re: Trying Hibernate Validator Integration

2009-03-14 Thread Will Jaynes
Taha, I've tried playing with  your HibernateValidator. It seems necessary
to add it to each form field. If I add it simply to the form, the validation
behavior doesn't happen. Am I missing something?
Will

On Sat, Mar 14, 2009 at 9:06 AM, taha siddiqi  wrote:

> I was myself very much interested and finally I found
>
> wicket-hibernate at
>
> http://www.jroller.com/wireframe/entry/hibernateannotationcomponentconfigurator
>
> and wicket-jpa at
> http://perfbench.googlecode.com/svn/trunk/perfbench/wicket-jpa/
>
> Then I came up which something that works for me ( already in the post )
>
> taha
>
>
> On Sat, Mar 14, 2009 at 6:16 PM, Will Jaynes  wrote:
> > In the archives, back in 2007, I see a lot of discussion about
> Hibernate/JPA
> > validator and Wicket, but I can't find if there was any result from those
> > discussions. Did anything come of it?
> >
> > Will
> >
> > On Tue, Mar 10, 2009 at 11:29 AM, taha siddiqi  >wrote:
> >
> >> but then how to get a ResourceBundle from wicket resource ??
> >>
> >>
> >> On Tue, Mar 10, 2009 at 8:43 PM, Peter Thomas 
> wrote:
> >> > On Tue, Mar 10, 2009 at 9:04 AM, taha siddiqi 
> >> wrote:
> >> >
> >> >> But the problem is when you begin to use the wicket resource files,
> >> >> hibernate-validator comes with its own messages and need to be
> >> >> integrated with wicket ( which i was not able to )
> >> >
> >> >
> >> > There is some info here on how to pass a resource-bundle to the
> >> > ClassValidator constructor, I haven't tried it though:
> >> >
> >> >
> http://www.jboss.org/index.html?module=bb&op=viewtopic&t=69783&view=next
> >> >
> >> >
> >> >>
> >> >>
> >> >> taha
> >> >>
> >> >> On Tue, Mar 10, 2009 at 8:11 PM, Peter Thomas 
> >> wrote:
> >> >> > On Tue, Mar 10, 2009 at 7:35 AM, taha siddiqi <
> tawushaf...@gmail.com>
> >> >> wrote:
> >> >> >
> >> >> >> Hi,
> >> >> >>
> >> >> >> I was working with Hibernate-validator and thought of sharing the
> >> code.
> >> >> >>
> >> >> >
> >> >> > Taha: I thought the ClassValidator will handle all the different
> cases
> >> >> and
> >> >> > annotations for you, see line #89
> >> >> >
> >> >> >
> >> >>
> >>
> http://code.google.com/p/perfbench/source/browse/trunk/perfbench/wicket-jpa/src/main/java/wicketjpa/wicket/EditBorder.java#89
> >> >> >
> >> >> > Is there any advantage of mapping each type (e.g. Min, Max,
> >> >> > CreditCardNumber) to Wicket built-in validators ?
> >> >> >
> >> >> >
> >> >> >>
> >> >> >> It is a listener as well as a behavior which can be used at
> >> >> >> application level as well as with individual
> >> >> >> components.
> >> >> >>
> >> >> >> It is heavily inspired from wicket-jpa and wicket-hibernate
> >> >> >> projects... I just tried some changes...
> >> >> >>
> >> >> >> import java.util.Map;
> >> >> >> import java.util.Arrays;
> >> >> >> import java.util.List;
> >> >> >> import java.util.Date;
> >> >> >> import java.util.concurrent.ConcurrentHashMap;
> >> >> >> import javax.persistence.Entity;
> >> >> >> import javax.persistence.Embeddable;
> >> >> >> import java.lang.reflect.Field;
> >> >> >> import java.lang.reflect.Method;
> >> >> >> import java.lang.annotation.Annotation;
> >> >> >> import java.lang.reflect.AnnotatedElement;
> >> >> >>
> >> >> >> import org.hibernate.validator.NotNull;
> >> >> >> import org.hibernate.validator.Length;
> >> >> >> import org.hibernate.validator.NotEmpty;
> >> >> >> import org.hibernate.validator.Min;
> >> >> >> import org.hibernate.validator.Pattern;
> >> >> >> import org.hibernate.validator.Max;
> >> >> >> import org.hibernate.validator.Range;
> >> >> >> import org.hibernate.v

Re: Trying Hibernate Validator Integration

2009-03-14 Thread Will Jaynes
In the archives, back in 2007, I see a lot of discussion about Hibernate/JPA
validator and Wicket, but I can't find if there was any result from those
discussions. Did anything come of it?

Will

On Tue, Mar 10, 2009 at 11:29 AM, taha siddiqi wrote:

> but then how to get a ResourceBundle from wicket resource ??
>
>
> On Tue, Mar 10, 2009 at 8:43 PM, Peter Thomas  wrote:
> > On Tue, Mar 10, 2009 at 9:04 AM, taha siddiqi 
> wrote:
> >
> >> But the problem is when you begin to use the wicket resource files,
> >> hibernate-validator comes with its own messages and need to be
> >> integrated with wicket ( which i was not able to )
> >
> >
> > There is some info here on how to pass a resource-bundle to the
> > ClassValidator constructor, I haven't tried it though:
> >
> > http://www.jboss.org/index.html?module=bb&op=viewtopic&t=69783&view=next
> >
> >
> >>
> >>
> >> taha
> >>
> >> On Tue, Mar 10, 2009 at 8:11 PM, Peter Thomas 
> wrote:
> >> > On Tue, Mar 10, 2009 at 7:35 AM, taha siddiqi 
> >> wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> I was working with Hibernate-validator and thought of sharing the
> code.
> >> >>
> >> >
> >> > Taha: I thought the ClassValidator will handle all the different cases
> >> and
> >> > annotations for you, see line #89
> >> >
> >> >
> >>
> http://code.google.com/p/perfbench/source/browse/trunk/perfbench/wicket-jpa/src/main/java/wicketjpa/wicket/EditBorder.java#89
> >> >
> >> > Is there any advantage of mapping each type (e.g. Min, Max,
> >> > CreditCardNumber) to Wicket built-in validators ?
> >> >
> >> >
> >> >>
> >> >> It is a listener as well as a behavior which can be used at
> >> >> application level as well as with individual
> >> >> components.
> >> >>
> >> >> It is heavily inspired from wicket-jpa and wicket-hibernate
> >> >> projects... I just tried some changes...
> >> >>
> >> >> import java.util.Map;
> >> >> import java.util.Arrays;
> >> >> import java.util.List;
> >> >> import java.util.Date;
> >> >> import java.util.concurrent.ConcurrentHashMap;
> >> >> import javax.persistence.Entity;
> >> >> import javax.persistence.Embeddable;
> >> >> import java.lang.reflect.Field;
> >> >> import java.lang.reflect.Method;
> >> >> import java.lang.annotation.Annotation;
> >> >> import java.lang.reflect.AnnotatedElement;
> >> >>
> >> >> import org.hibernate.validator.NotNull;
> >> >> import org.hibernate.validator.Length;
> >> >> import org.hibernate.validator.NotEmpty;
> >> >> import org.hibernate.validator.Min;
> >> >> import org.hibernate.validator.Pattern;
> >> >> import org.hibernate.validator.Max;
> >> >> import org.hibernate.validator.Range;
> >> >> import org.hibernate.validator.Past;
> >> >> import org.hibernate.validator.Future;
> >> >> import org.hibernate.validator.Email;
> >> >> import org.hibernate.validator.CreditCardNumber;
> >> >>
> >> >> import org.apache.wicket.validation.validator.StringValidator;
> >> >> import org.apache.wicket.validation.validator.PatternValidator;
> >> >> import org.apache.wicket.validation.validator.NumberValidator;
> >> >> import org.apache.wicket.validation.validator.EmailAddressValidator;
> >> >> import org.apache.wicket.validation.validator.CreditCardValidator;
> >> >> import org.apache.wicket.validation.validator.DateValidator;
> >> >>
> >> >> import org.hibernate.validator.ClassValidator;
> >> >> import org.hibernate.validator.InvalidValue;
> >> >> import org.apache.wicket.behavior.AbstractBehavior;
> >> >> import
> org.apache.wicket.application.IComponentOnBeforeRenderListener;
> >> >> import org.apache.wicket.application.IComponentInstantiationListener;
> >> >> import org.apache.wicket.Component;
> >> >> import org.apache.wicket.markup.ComponentTag;
> >> >> import org.apache.wicket.feedback.FeedbackMessage;
> >> >> import org.apache.wicket.validation.IValidator;
> >> >> import org.apache.wicket.validation.IValidatable;
> >> >> import org.apache.wicket.model.IModel;
> >> >> import org.apache.wicket.model.CompoundPropertyModel;
> >> >> import org.apache.wicket.markup.html.form.FormComponent;
> >> >> import org.apache.wicket.validation.ValidationError;
> >> >> import org.apache.wicket.validation.validator.StringValidator;
> >> >> import org.apache.wicket.AttributeModifier;
> >> >> import org.apache.wicket.model.Model;
> >> >> import org.slf4j.Logger;
> >> >> import org.slf4j.LoggerFactory;
> >> >>
> >> >> /**
> >> >>  * A validator to validate elements having
> >> >>  * hibernate validators annotated.
> >> >>  */
> >> >> public class HibernateValidator extends AbstractBehavior
> >> >>   implements IComponentOnBeforeRenderListener {
> >> >>
> >> >>   private static Logger logger = LoggerFactory.getLogger(
> >> >> HibernateValidator.class );
> >> >>
> >> >>   public final void onBeforeRender( Component c ){
> >> >>  if( !c.hasBeenRendered() ){
> >> >> configure(c);
> >> >>  }
> >> >>   }
> >> >>
> >> >>   @Override
> >> >>   public void beforeRender( Component c ){
> >> >>  super.beforeRender( c );
> >> >>  configure

adding multiple onchange behaviors to DDC

2009-03-11 Thread Will Jaynes
I've searched the list for this, but didn't find an answer, at least not a
recent one.

When I add more than one OnChangeAjaxBehavior to a DropDownChoice, only the
last one gets executed. Is that just the way it is?

Will


Re: getting the component to which a Behavior is added from with the Behavior

2009-02-27 Thread Will Jaynes
 I think I'll go bury myself in shame. Thank you, Witold.

On Fri, Feb 27, 2009 at 8:24 AM, Witold Czaplewski
 wrote:

> I think you mean
> org.​apache.​wicket.​behavior.​AbstractAjaxBehavior#getComponent()
>
> Witold
>
> Am Fri, 27 Feb 2009 08:15:03 -0500
> schrieb Will Jaynes :
>
> > I'm trying to write a class that extends OnChangeAjaxBehavior.  Is there
> a
> > way, in the update method, to get the component to which the behavior has
> > been added? I just don't see how. Should it just be added via the
> > constructor?
> >
> > component.add(new MyOnChangeAjaxBehavior(component));
> >
> > This doesn't seem right to me, but maybe that's the way?
> >
> > Thanks for any info, Will
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


getting the component to which a Behavior is added from with the Behavior

2009-02-27 Thread Will Jaynes
I'm trying to write a class that extends OnChangeAjaxBehavior.  Is there a
way, in the update method, to get the component to which the behavior has
been added? I just don't see how. Should it just be added via the
constructor?

component.add(new MyOnChangeAjaxBehavior(component));

This doesn't seem right to me, but maybe that's the way?

Thanks for any info, Will


Re: inmethod datagrid, ajax interactions between cells

2009-02-26 Thread Will Jaynes
Yes. That would addresses the specific example I sited, but not the general
question I have. Suppose I wanted the other cell to turn yellow, or change
it to a dropdown, or anything that affects the component, not necessarily
the model.

On Thu, Feb 26, 2009 at 2:40 PM, jcgarciam  wrote:

>
> I haven't used inmethod datagrid yet but i guess i wont be different with
> another Wicket model component, so just clear the property of your
> Underlying model, that should be enough.
>
>
>
> Will Jaynes-4 wrote:
> >
> > I'm working with the inmethod datagrid. I would like to set up some ajax
> > interactions between cells within a row. For example, between two
> > EditablePropertyColumns, if the user starts typing in one cell, having
> > ajax
> > blank out the other. There are a lot of methods one can override which
> > provide the rowModel as an argument. But I don't see how to get access to
> > all the components of a row. And I'm not sure what to do even if I did
> get
> > access to the components in a row.
> >
> > Has anyone tried to set up such ajax interaction between cells?
> >
> > Thanks, Will
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/inmethod-datagrid%2C-ajax-interactions-between-cells-tp8762p22231967.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
>
>


inmethod datagrid, ajax interactions between cells

2009-02-26 Thread Will Jaynes
I'm working with the inmethod datagrid. I would like to set up some ajax
interactions between cells within a row. For example, between two
EditablePropertyColumns, if the user starts typing in one cell, having ajax
blank out the other. There are a lot of methods one can override which
provide the rowModel as an argument. But I don't see how to get access to
all the components of a row. And I'm not sure what to do even if I did get
access to the components in a row.

Has anyone tried to set up such ajax interaction between cells?

Thanks, Will


inmethod datagrid with a DropDownChoice cell

2009-02-17 Thread Will Jaynes
I'm working with the inmethod datagrid. The grid is editable, and I have it
working just as the examples show, with a couple of cells that contain text.
As in the examples, clicking on a row changes some cells into TextField
components that can be edited.

Now I would like to create a cell that displays text, but when the row is
clicked the cell turns into a DropDownChoice component. I've tried to mimic
the EditablePropertyColumn and the TextFieldPanel with my own
EditableDropDownPropertyColumn and a DropDownPanel. These render fine and
let me select from the dropdown, but things go wrong when I press the submit
icon. I get an exception: "Attempt to set model object on null model of
component"

If/When I have time I will make a quickstart, but If anyone already has this
kind of thing working I would appreciate very much seeing the code.

Will


Re: inmethod datagrid, validation, and feedback

2009-02-16 Thread Will Jaynes
On Sun, Feb 15, 2009 at 10:40 PM, Timo Rantalaiho wrote:

> On Sun, 15 Feb 2009, Will Jaynes wrote:
> > So, how would one show those error messages? And where would such code
> get
> > hooked in?
>
> I'm not sure about the place but basically you have to add a
> FeedbackPanel and update it in the ajax event that causes
> the error,
>
>  final Component feedback = new FeedbackPanel("feedback")
>  .setOutputMarkupPlaceHolder(true);
>  add(feedback);
>  ...
>  @Override protected void onSubmit(AjaxRequestTarget target) {
>  target.addComponent(feedback);
>  ...
>  }
>
> Best wishes,
> Timo


 AH, yes. Thanks. And the place to do it is in the SubmitCancelColumn :

columns.add(new SubmitCancelColumn("esd", new Model("Edit"))
{
@Override
protected void onError(AjaxRequestTarget target, IModel
rowModel, WebMarkupContainer rowComponent)
{
target.addComponent(feedback);
super.onError(target, rowModel, rowComponent);
}
});


inmethod datagrid, validation, and feedback

2009-02-15 Thread Will Jaynes
The examples for an editable inmethod datagrid show how to add validation
when adding a new column.  The "firstName" and "lastName" components are
required. (component.setReqired(true)) And, indeed, if one edits a first
name and blanks it out and press the "save" icon, the row is not updated.
But no feedback is shown.  I can see in the debug messages, when the
WebSession goes to clean up the feedback messages, that there are messages
that haven't been displayed. So we know that the validation works and
produces error messages, but the Ajax nature of the datagrid row edit
doesn't allow for the display of the error messages.

So, how would one show those error messages? And where would such code get
hooked in?

Will


Re: inmethod grid and add/delete examples

2009-02-12 Thread Will Jaynes
On Wed, Feb 11, 2009 at 9:58 AM, Will Jaynes  wrote:

> I have just started to look at the inmethod datagrid in wicketstuff. The
> one thing that the examples don't show are how to add and delete items. Are
> there such examples somewhere?
>
> Will
>

I'm really missing a lot with regard to the datagrid examples. Perhaps it's
because I'm still relatively new to Wicket and very new to the Ajax stuff in
Wicket. As I've said, I don't see how to add or delete rows to the
datagrid.  But also I don't see in the examples how to actually update the
database with any edited values. Nor do I see, once a row is selected, how
to get that selected row and do something with it.

So, I'm pretty clueless, which makes it hard to help me, but I'd appreciate
any info or pointers.

Will


inmethod grid and add/delete examples

2009-02-11 Thread Will Jaynes
I have just started to look at the inmethod datagrid in wicketstuff. The one
thing that the examples don't show are how to add and delete items. Are
there such examples somewhere?

Will


Re: Wicket and Jetty Persistent Sessions not playing together

2008-12-08 Thread Will Jaynes
mmm. I'm developing with the maven jetty plugin (jetty 6.1.14). I stop
and start jetty quite often without losing the http session, but I
don't see any exception.

Will

On Mon, Dec 8, 2008 at 5:40 AM, Joel Halbert <[EMAIL PROTECTED]> wrote:
> The jetty team have opened up an issue to look at fixing this issue:
>
> http://jira.codehaus.org/browse/JETTY-821
>
>
>
> On Mon, 2008-12-08 at 10:35 +, Joel Halbert wrote:
>> OK, thanks for the reply. I'm at least glad to hear that this appears to
>> be a 'known issue', rather than some local quirk of my setup.
>>
>> I'll liase with the Jetty team to see if there is a workaround and will
>> keep this thread updated.
>>
>> Joel
>>
>>
>> On Fri, 2008-12-05 at 10:28 -0800, Igor Vaynberg wrote:
>> > not sure if we can do much about this. on the one hand jetty is quirky
>> > because it initializes objects that belong to the webapp before
>> > actually initializing the webapp itself. on the other hand wicket is
>> > quirky because it stores things in session that depend on objects
>> > outside the session. try getting in touch with jetty people and see if
>> > they are willing to add a setting to control this, and please keep us
>> > informed.
>> >
>> > -igor
>> >
>> > On Thu, Dec 4, 2008 at 11:59 PM, Joel Halbert <[EMAIL PROTECTED]> wrote:
>> > > Hi,
>> > >
>> > > Has anyone had issues when using wicket with Jetty and persistent
>> > > sessions?
>> > >
>> > > Specifically when the server is restarted sessions are intialised before
>> > > servlets are ready, this causes an exception when wicket deserialises
>> > > the "current page" which was in session since the WicketApplication is
>> > > not yet ready since the Wicket Filter has not yet been loaded by the
>> > > server.
>> > >
>> > > Thanks
>> > > Joel
>> > >
>> > >
>> > >
>> > > -
>> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > > For additional commands, e-mail: [EMAIL PROTECTED]
>> > >
>> > >
>>
>>
>
>
> --
> SU3 Analytics Ltd
> The Print House
> 18 Ashwin Street
> E8 3DL
> London
>
> Tel: +44 (0) 20 3051 8637
> Fax: +44 (0) 20 8196 2215
> Mob: +44 (0) 79 7431 0685
> www.su3analytics.com
>
> SU3 Analytics Ltd is a company registered in England and Wales under
> company number 06639473 at registered address 61b Oxford Gardens, London
> W10 5UJ, United Kingdom.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



getting component parent

2007-08-10 Thread Will Jaynes
Using 1.3. I have a panel which needs to create different internal 
components depending on who it's parent is. However, calling getParent() 
in the constructor gives me null. I can make a constuctor that passes in 
the parent. But I wonder if there is a different way. Is there some 
other point where I could call getParent(), get the parent, and then 
construct the components for the panel?


Will

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



Re: general question on dynamic pages

2007-07-30 Thread Will Jaynes
Thanks for the reply. I appreciate the desirability of thinking more OO 
and less request/response. Even so, the Wicket Page class is still 
modeling an html page. Where is the "onBeforeLoad" functionality of a 
web page? Is "onBeforeRender" the equivalent?


With regard to the Login/Welcome example, I have a problem with the 
Login's page's mutator methods being called in the onClick() in the 
Welcome page. Your scenario requires that Welcome know too much about 
Login.  If Welcome and Login depend on the same model, and Welcome 
changes the model, then when control is passed back to Login it should 
be able to act on that change without the need for Welcome to know about 
it. I don't see yet where Login has the opportunity to act on the model 
change before the page is displayed. Again, is this where 
onBeforeRender() comes in? Or some other method?


Thanks, again, Will

Ryan Holmes wrote:
I think one of the keys to getting comfortable with Wicket is to think 
in terms of plain objects rather than requests, pages, etc. For 
example, if you were working with a Person object rather than a Login 
page and you wanted to provide some way of modifying that Person 
object, you would just add a mutator method to the Person class, 
right? Well, it's the same thing in Wicket. Just add a method to the 
Login page class that performs whatever modifications you want. This 
method might update the models for components on that page, change the 
visibility of components, replace components with other components, 
just to name a few possibilities.


In the example you gave, this method (the Login page's mutator method) 
would be called from the onClick() method in the Welcome page's Link, 
just before calling setResponsePage().


hth,
-Ryan


On Jul 27, 2007, at 11:20 AM, Will Jaynes wrote:

I'm new to Wicket and struggling a bit. I feel I may be stuck in old 
thinking of action frameworks like Struts or Spring MVC.


All of the examples I have looked at so far do all the work of 
creating and adding components for a page (or panel) in the 
constructor of the page. Are there other places where this work can 
be done? In a dynamic page, I can imagine that between the time a 
page class is constructed and when the page is displayed, there might 
be changes that have to be made. Where could this code be placed?


For example, the Pro Wicket book (around page 32) has an example of a 
Login and a Welcome page. The Welcome page constructor takes a 
reference to Login.this, so that a link back to the Login page takes 
you back to the same instance of the Login page. In this scenario, 
when the link is clicked and the response page is set to the existing 
Login page, where is the opportunity to change the Login page, if 
required? In Struts I would have the Struts action. Here, I'm not so 
sure.


Thanks for any info.

Will


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




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




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



general question on dynamic pages

2007-07-27 Thread Will Jaynes
I'm new to Wicket and struggling a bit. I feel I may be stuck in old 
thinking of action frameworks like Struts or Spring MVC.


All of the examples I have looked at so far do all the work of creating 
and adding components for a page (or panel) in the constructor of the 
page. Are there other places where this work can be done? In a dynamic 
page, I can imagine that between the time a page class is constructed 
and when the page is displayed, there might be changes that have to be 
made. Where could this code be placed?


For example, the Pro Wicket book (around page 32) has an example of a 
Login and a Welcome page. The Welcome page constructor takes a reference 
to Login.this, so that a link back to the Login page takes you back to 
the same instance of the Login page. In this scenario, when the link is 
clicked and the response page is set to the existing Login page, where 
is the opportunity to change the Login page, if required? In Struts I 
would have the Struts action. Here, I'm not so sure.


Thanks for any info.

Will


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