Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread Eelco Hillenius
> I don't understand.  Are you saying that I should use setEnabled(false) or
> are you saying that I should use:
>
>   final AttributeModifier rof = new AttributeModifier("readonly", false, new
> Model("readonly"));

new AttributeModifier("readonly", true, new Model("readonly") {
  public boolean isEnabled(Component c) {
return shouldTheAttributeBeAdded();
  }
}

and don't add the attribute in your markup.

Eelco

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



Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread janders

I don't understand.  Are you saying that I should use setEnabled(false) or
are you saying that I should use:

  final AttributeModifier rof = new AttributeModifier("readonly", false, new
Model("readonly"));

Either way this doesn't seem to work.

- JA



Eelco Hillenius wrote:
> 
>> I know how to add the attribute, I just don't know how to later remove it
>> once added.
> 
> Like I said, override isEnabled in your attribute modifier. When that
> returns false, the attribute won't be added. For normal requests,
> where a page is rendered everytime again, it simply doesn't show up.
> For ajax request, you'll have to add to the ajaxrequest for
> re-rendering and the attribute should disappear as well.
> 
> Eelco
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12400938
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread Eelco Hillenius
> I know how to add the attribute, I just don't know how to later remove it
> once added.

Like I said, override isEnabled in your attribute modifier. When that
returns false, the attribute won't be added. For normal requests,
where a page is rendered everytime again, it simply doesn't show up.
For ajax request, you'll have to add to the ajaxrequest for
re-rendering and the attribute should disappear as well.

Eelco

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



Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread janders

I know how to add the attribute, I just don't know how to later remove it
once added.
- JA


Eelco Hillenius wrote:
> 
>> So it sounds like I would use something like:
>>
>> final AttributeModifier ro = new AttributeModifier("readonly", true, new
>> Model("readonly"));
>> if (email.getType() != EmailAddress.Type.OTHER)
>> emailLabel.add(ro);
>>
>> If so, then the question becomes, how would I remove that attribute or
>> reset
>> emailLabel to editable?
> 
> Always add the attribute modifier, override isEnabled and let that
> return true if you want to add the attribute, and false if you don't.
> 
> Eelco
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12400705
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread Eelco Hillenius
On 8/29/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> create a dynamic model instead of new Model("readonly")

Problem with that though, is that it would always add the readonly
attribute. If I remember correctly, the actual value doesn't matter
much.

Eelco

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



Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread Eelco Hillenius
> So it sounds like I would use something like:
>
> final AttributeModifier ro = new AttributeModifier("readonly", true, new
> Model("readonly"));
> if (email.getType() != EmailAddress.Type.OTHER)
> emailLabel.add(ro);
>
> If so, then the question becomes, how would I remove that attribute or reset
> emailLabel to editable?

Always add the attribute modifier, override isEnabled and let that
return true if you want to add the attribute, and false if you don't.

Eelco

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



Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread Igor Vaynberg
create a dynamic model instead of new Model("readonly")

-igor


On 8/29/07, janders <[EMAIL PROTECTED]> wrote:
>
>
> So it sounds like I would use something like:
>
> final AttributeModifier ro = new AttributeModifier("readonly", true, new
> Model("readonly"));
> if (email.getType() != EmailAddress.Type.OTHER)
> emailLabel.add(ro);
>
> If so, then the question becomes, how would I remove that attribute or
> reset
> emailLabel to editable?
>
>
>
>
> igor.vaynberg wrote:
> >
> > the entire point of disabling the component is that you do not want it
> to
> > process submitted input and update its model. you are looking for
> readonly
> > behavior rather then disabled i think. why not just set the readonly
> > attribute on that field.
> >
> > -igor
> >
> >
> > On 8/29/07, janders <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >> I posted this on the Databinder forum but no one seems to know of a
> >> work-around so I thought I'd post it here.
> >>
> >> Essentially I have a FocusableTextField that gets set by a
> >> DropDownChoice.
> >> If the choice is not "other" then I setEnabled to false and I place the
> >> string value of the DropDownChoice into the FocusableTextField. However
> >> the
> >> model is not persisted when setEnabled is false.
> >>
> >> Here is the code:
> >>
> >> // list of existing emailAddresses
> >> final List emailTypeList =
> >> Arrays.asList(EmailAddress.Type.values());
> >> final ListView emailAddresses = new
> >> PropertyListView("emailAddresses") {
> >> @Override
> >> protected void populateItem(final ListItem item) {
> >> final EmailAddress email = (EmailAddress)
> >> item.getModelObject();
> >> final FocusableTextField emailLabel = new
> >> FocusableTextField("label", page);
> >> if (email.getType() != EmailAddress.Type.OTHER)
> >> emailLabel.setEnabled(false);
> >> item.add(emailLabel);
> >> item.add(new DropDownChoice("type", emailTypeList)
> {
> >> @Override
> >> protected boolean
> >> wantOnSelectionChangedNotifications() {
> >> return true;
> >> }
> >> @Override
> >> protected void onSelectionChanged(final Object
> >> newSelection) {
> >> if (newSelection == EmailAddress.Type.OTHER
> )
> >> {
> >> emailLabel.setEnabled(true);
> >> emailLabel.requestFocus();
> >> } else {
> >>
> >> emailLabel.setModelValue(newSelection.toString());
> >> emailLabel.setEnabled(false);
> >> }
> >> }
> >> });
> >>   
> >>
> >> In this email example the dropdown choices are "home", "work", and
> >> "other".
> >> If user selects home or work I want the value of the FocusableTextField
> >> to
> >> be home or work and I do not want the user to be able to edit the
> field.
> >> That's why I set the field's isEnabled to false. On the other hand, if
> >> the
> >> user selects other, then I set isEnabled to true so that the user can
> >> edit
> >> the field. This works properly (persists the value) because isEnabled
> is
> >> true.
> >>
> >> Is there a workaround for this problem or can someone recommend a
> >> different
> >> approach?
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12399840
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12400575
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: VisitChildren bottom-up

2007-08-29 Thread Igor Vaynberg
perhaps you can add an rfe into jira so we dont forget.

-igor


On 8/29/07, RedFury <[EMAIL PROTECTED]> wrote:
>
>
> Thanks for the quick reply Igor.  For now I'm just going to take your
> FormComponent visitor example and adapt that to my case since it looks
> tidy
> and straightforward.  It would be nice if this functionality could somehow
> find its way into markupcontainer though.
>
> Cheers,
> Dean
>
>
> igor.vaynberg wrote:
> >
> > hrm. i have implemented a postorder traversal for formcomponents (see
> > FormComponent.visitFormComponentsPostOrder) so you can either take that
> > code
> > and use it in your app, or we can bring it up to markupcontainer and
> > generalize it.
> >
> > the problem is that we already have visitComponents, and having a
> > visitComponentsPostOrder next to it seems a little inconsistent. what do
> > other devs think?
> >
> > -igor
> >
> >
> > On 8/29/07, RedFury <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >> Hi all,
> >>
> >> I've writing a very heavily javascripted app in wicket and finding
> wicket
> >> handles the complexity wonderfully.  I've used VisitChildren(IVisitor)
> >> successfully in numerous places but have a problem with a case where
> I'd
> >> like to use it 'backwards'.  I'm writing some base components which
> will
> >> be
> >> used by our application programmers and our base Panel has an onClose()
> >> method which will contribute javascript to a closing panel  (rendered
> on
> >> AjaxRequestTarget.prependJavascript())  What I would like to do is have
> a
> >> closing panel's children automatically call onClose().
> >>
> >> So I started with:
> >>
> >> protected final void close()
> >> {
> >>   visitChildren(JumbuckPanel.class, new IVisitor()
> >>   {
> >> public Object component(Component c)
> >> {
> >>   ((JumbuckPanel)c).onClose();
> >>   return IVisitor.CONTINUE_TRAVERSAL;
> >> }
> >>   });
> >> }
> >>
> >> Then I realized that this had a problem - being onClose() I needed the
> >> children to be traversed from the bottom-up, whereas visitChildren
> always
> >> seem to go top-down.  That is, from looking at VisitChildren() in
> >> MarkupContainer, it goes..
> >>
> >> -visit this node
> >> -if this is a container, visitchildren recursively.
> >>
> >> wherease I need:
> >>
> >> -if this is a container, visitchildren recursively
> >> -visit this node.
> >>
> >> So originally I tried to write reverseVisitChildren() in my sublcass of
> >> MarkupContainer but then realized all of the access functions
> >> (children_size
> >> and children_next) are private in markupContainer and my recursive call
> >> to
> >> reverseVisitChildren would only work on my custom panel, not generic
> >> MarkupContainers, if that makes.
> >>
> >> Is anyone able to suggest a simple solution to this problem, as right
> now
> >> the best solution I can think of is to add that functionality to
> >> MarkupContainer as I think it might prove useful for other people at
> some
> >> stage also.
> >>
> >> Thanks,
> >> Dean
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12399896
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12400529
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: VisitChildren bottom-up

2007-08-29 Thread RedFury

Just a quick think on how to fix with minimal impact on MarkupContainer, I
wonder if it would be possible to do something like the following:

public interface IPostVisitor extends IVisitor
{
   public Object postComponent(component C);
}

then in MarkupContainer.visitChildren() after the recursive visitChildren()
call do something like:

if (visitor instanceof IPostVisitor)
{
   if (clazz == null || clazz.isInstance(child))
   {
  // Call visitor
  value = ((IPostVisitor)visitor).postComponent(child);
...

Or something like that, just thinking out loud a bit...
Dean




igor.vaynberg wrote:
> 
> hrm. i have implemented a postorder traversal for formcomponents (see
> FormComponent.visitFormComponentsPostOrder) so you can either take that
> code
> and use it in your app, or we can bring it up to markupcontainer and
> generalize it.
> 
> the problem is that we already have visitComponents, and having a
> visitComponentsPostOrder next to it seems a little inconsistent. what do
> other devs think?
> 
> -igor
> 
> 
> On 8/29/07, RedFury <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi all,
>>
>> I've writing a very heavily javascripted app in wicket and finding wicket
>> handles the complexity wonderfully.  I've used VisitChildren(IVisitor)
>> successfully in numerous places but have a problem with a case where I'd
>> like to use it 'backwards'.  I'm writing some base components which will
>> be
>> used by our application programmers and our base Panel has an onClose()
>> method which will contribute javascript to a closing panel  (rendered on
>> AjaxRequestTarget.prependJavascript())  What I would like to do is have a
>> closing panel's children automatically call onClose().
>>
>> So I started with:
>>
>> protected final void close()
>> {
>>   visitChildren(JumbuckPanel.class, new IVisitor()
>>   {
>> public Object component(Component c)
>> {
>>   ((JumbuckPanel)c).onClose();
>>   return IVisitor.CONTINUE_TRAVERSAL;
>> }
>>   });
>> }
>>
>> Then I realized that this had a problem - being onClose() I needed the
>> children to be traversed from the bottom-up, whereas visitChildren always
>> seem to go top-down.  That is, from looking at VisitChildren() in
>> MarkupContainer, it goes..
>>
>> -visit this node
>> -if this is a container, visitchildren recursively.
>>
>> wherease I need:
>>
>> -if this is a container, visitchildren recursively
>> -visit this node.
>>
>> So originally I tried to write reverseVisitChildren() in my sublcass of
>> MarkupContainer but then realized all of the access functions
>> (children_size
>> and children_next) are private in markupContainer and my recursive call
>> to
>> reverseVisitChildren would only work on my custom panel, not generic
>> MarkupContainers, if that makes.
>>
>> Is anyone able to suggest a simple solution to this problem, as right now
>> the best solution I can think of is to add that functionality to
>> MarkupContainer as I think it might prove useful for other people at some
>> stage also.
>>
>> Thanks,
>> Dean
>>
>> --
>> View this message in context:
>> http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12399896
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12400576
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: VisitChildren bottom-up

2007-08-29 Thread Eelco Hillenius
On 8/29/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> hrm. i have implemented a postorder traversal for formcomponents (see
> FormComponent.visitFormComponentsPostOrder) so you can either take that code
> and use it in your app, or we can bring it up to markupcontainer and
> generalize it.
>
> the problem is that we already have visitComponents, and having a
> visitComponentsPostOrder next to it seems a little inconsistent. what do
> other devs think?

I would be +1 for generalizing it. The naming wouldn't bother me.

Eelco

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



Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread janders

So it sounds like I would use something like:

final AttributeModifier ro = new AttributeModifier("readonly", true, new
Model("readonly")); 
if (email.getType() != EmailAddress.Type.OTHER)
emailLabel.add(ro);

If so, then the question becomes, how would I remove that attribute or reset
emailLabel to editable?




igor.vaynberg wrote:
> 
> the entire point of disabling the component is that you do not want it to
> process submitted input and update its model. you are looking for readonly
> behavior rather then disabled i think. why not just set the readonly
> attribute on that field.
> 
> -igor
> 
> 
> On 8/29/07, janders <[EMAIL PROTECTED]> wrote:
>>
>>
>> I posted this on the Databinder forum but no one seems to know of a
>> work-around so I thought I'd post it here.
>>
>> Essentially I have a FocusableTextField that gets set by a
>> DropDownChoice.
>> If the choice is not "other" then I setEnabled to false and I place the
>> string value of the DropDownChoice into the FocusableTextField. However
>> the
>> model is not persisted when setEnabled is false.
>>
>> Here is the code:
>>
>> // list of existing emailAddresses
>> final List emailTypeList =
>> Arrays.asList(EmailAddress.Type.values());
>> final ListView emailAddresses = new
>> PropertyListView("emailAddresses") {
>> @Override
>> protected void populateItem(final ListItem item) {
>> final EmailAddress email = (EmailAddress)
>> item.getModelObject();
>> final FocusableTextField emailLabel = new
>> FocusableTextField("label", page);
>> if (email.getType() != EmailAddress.Type.OTHER)
>> emailLabel.setEnabled(false);
>> item.add(emailLabel);
>> item.add(new DropDownChoice("type", emailTypeList) {
>> @Override
>> protected boolean
>> wantOnSelectionChangedNotifications() {
>> return true;
>> }
>> @Override
>> protected void onSelectionChanged(final Object
>> newSelection) {
>> if (newSelection == EmailAddress.Type.OTHER)
>> {
>> emailLabel.setEnabled(true);
>> emailLabel.requestFocus();
>> } else {
>>
>> emailLabel.setModelValue(newSelection.toString());
>> emailLabel.setEnabled(false);
>> }
>> }
>> });
>>   
>>
>> In this email example the dropdown choices are "home", "work", and
>> "other".
>> If user selects home or work I want the value of the FocusableTextField
>> to
>> be home or work and I do not want the user to be able to edit the field.
>> That's why I set the field's isEnabled to false. On the other hand, if
>> the
>> user selects other, then I set isEnabled to true so that the user can
>> edit
>> the field. This works properly (persists the value) because isEnabled is
>> true.
>>
>> Is there a workaround for this problem or can someone recommend a
>> different
>> approach?
>>
>> --
>> View this message in context:
>> http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12399840
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12400575
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: VisitChildren bottom-up

2007-08-29 Thread RedFury

Thanks for the quick reply Igor.  For now I'm just going to take your
FormComponent visitor example and adapt that to my case since it looks tidy
and straightforward.  It would be nice if this functionality could somehow
find its way into markupcontainer though.

Cheers,
Dean


igor.vaynberg wrote:
> 
> hrm. i have implemented a postorder traversal for formcomponents (see
> FormComponent.visitFormComponentsPostOrder) so you can either take that
> code
> and use it in your app, or we can bring it up to markupcontainer and
> generalize it.
> 
> the problem is that we already have visitComponents, and having a
> visitComponentsPostOrder next to it seems a little inconsistent. what do
> other devs think?
> 
> -igor
> 
> 
> On 8/29/07, RedFury <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi all,
>>
>> I've writing a very heavily javascripted app in wicket and finding wicket
>> handles the complexity wonderfully.  I've used VisitChildren(IVisitor)
>> successfully in numerous places but have a problem with a case where I'd
>> like to use it 'backwards'.  I'm writing some base components which will
>> be
>> used by our application programmers and our base Panel has an onClose()
>> method which will contribute javascript to a closing panel  (rendered on
>> AjaxRequestTarget.prependJavascript())  What I would like to do is have a
>> closing panel's children automatically call onClose().
>>
>> So I started with:
>>
>> protected final void close()
>> {
>>   visitChildren(JumbuckPanel.class, new IVisitor()
>>   {
>> public Object component(Component c)
>> {
>>   ((JumbuckPanel)c).onClose();
>>   return IVisitor.CONTINUE_TRAVERSAL;
>> }
>>   });
>> }
>>
>> Then I realized that this had a problem - being onClose() I needed the
>> children to be traversed from the bottom-up, whereas visitChildren always
>> seem to go top-down.  That is, from looking at VisitChildren() in
>> MarkupContainer, it goes..
>>
>> -visit this node
>> -if this is a container, visitchildren recursively.
>>
>> wherease I need:
>>
>> -if this is a container, visitchildren recursively
>> -visit this node.
>>
>> So originally I tried to write reverseVisitChildren() in my sublcass of
>> MarkupContainer but then realized all of the access functions
>> (children_size
>> and children_next) are private in markupContainer and my recursive call
>> to
>> reverseVisitChildren would only work on my custom panel, not generic
>> MarkupContainers, if that makes.
>>
>> Is anyone able to suggest a simple solution to this problem, as right now
>> the best solution I can think of is to add that functionality to
>> MarkupContainer as I think it might prove useful for other people at some
>> stage also.
>>
>> Thanks,
>> Dean
>>
>> --
>> View this message in context:
>> http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12399896
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12400529
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: RadioChoice and ListView

2007-08-29 Thread Carlos Pita
This looks wrong too:

   List participationList = exModel.getEx
().getParticipationList();

   ListView subjectListView = new ListView("list",
participationList) {

if your experiment model is intended to be a detachable one, ie. if you are
loading it from a database or something, then you shouldn't instantiate the
listview with a list but with a model that loads that list (or delegates to
another model that eventually loads the entity to which the collection
belongs...). If you pass the plain collection you are defeating the entire
purpose of having the loadabledetachablemodel in the first place. For
example, use new ListView("list",
new PropertyModel(exModel, "participationList"));

Regards,
Carlos


On 8/29/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>
> break in your onsubmit and look at the list that the listview is pointing
> to. make sure the data is there, the fact that it isnt being persisted
> might
> be a problem outside of wicket's scope.
>
> -igor
>
>
> On 8/29/07, Alex Pine <[EMAIL PROTECTED]> wrote:
> >
> > I'm sorry to spam the list like this, but I really need help on this.
> > Igor's
> > solution doesn't seem to change anything. No information is transferred
> to
> > the database upon hitting "on submit". If no one knows the solution,
> does
> > anyone have any ideas on how I could debug this? Is there some way I can
> > reference the selections of the radiogroups from the the onSubmit method
> > so
> > I can see what their values are?
> > Thanks for any help you can give,
> > Alex
> >
> > On 8/29/07, Alex Pine <[EMAIL PROTECTED]> wrote:
> > >
> > > Thank you for the quick reply, but this fix doesn't seem to work. The
> > > selections are never persisted on form submit. Any ideas?
> > >
> > > On 8/29/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > >
> > > > problem is here
> > > >
> > > > RadioGroup rg = new RadioGroup("choice");
> > > >
> > > > you are not setting the model for the radiogroup choice so your
> > choices
> > > > go
> > > > no where
> > > >
> > > > RadioGroup rg = new RadioGroup("choice", new PropertyModel(
> > > > item.getModel(),
> > > > "status"));
> > > >
> > > > or leave it as it is and use PropertyListView instead
> > > >
> > > > -igor
> > > >
> > > >
> > > > On 8/29/07, Alex Pine <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > Hi all,
> > > > > I'm trying to use a Radio Choice component inside a Listview so
> that
> > > > each
> > > > > list
> > > > > item has one RadioGroup with three choices. When the form submit
> > > > button is
> > > > > pressed,
> > > > > each selected choice should set a field in the model object of
> each
> > > > list
> > > > > item.
> > > > > The code below should explain the problem more fully:
> > > > >
> > > > >
> > > > > /*
> > > > > The ultimate goal is to set the "status" field in each
> Participation
> > > > > object
> > > > > in the participationList of the object below.
> > > > > */
> > > > > public class Experiment {
> > > > >
> > > > >   private String name;
> > > > >
> > > > >   private List participationList;
> > > > >
> > > > >   /* Other fields, constructors, getters, setters, etc */
> > > > >
> > > > > }
> > > > >
> > > > >
> > > > > public class Participation {
> > > > >
> > > > > public static final int PARTICIPATED = 1;
> > > > > public static final int NO_SHOW = -1;
> > > > > public static final int SHOWED = 0;
> > > > >
> > > > > private User user;
> > > > >
> > > > > private int status;
> > > > >
> > > > > public Participation() {
> > > > > status = SHOWED; // Default value
> > > > > }
> > > > >
> > > > > /* getters, setters, etc */
> > > > > }
> > > > >
> > > > >
> > > > > /* This is the web page that is supposed to do the setting*/
> > > > > public class ParticipationPage extends BasePage {
> > > > >
> > > > > private static final long serialVersionUID = 1L;
> > > > >
> > > > > @SpringBean
> > > > > private ExperimentDAO exDAO;
> > > > >
> > > > > private DetachableExperimentModel exModel;
> > > > >
> > > > > public ParticipationPage(Experiment ex) {
> > > > > exModel = new DetachableExperimentModel(ex, exDAO);
> > > > > add(new ParticipationForm("form"));
> > > > > exModel.detach();
> > > > > }
> > > > >
> > > > > class ParticipationForm extends Form {
> > > > >
> > > > > public ParticipationForm(String id) {
> > > > > super(id);
> > > > > List participationList = exModel.getEx
> > > > > ().getParticipationList();
> > > > >
> > > > > ListView subjectListView = new ListView("list",
> > > > > participationList) {
> > > > >
> > > > > private static final long serialVersionUID = 1L;
> > > > >
> > > > > /*
> > > > >  I imagine the correct code should be something
> like
> > > > > this...?
> > > > >  */
> > > > > public void populateItem(final ListItem item) {
> > > > > Participa

Re: TreeTable...how to refect a label change on TreeNode

2007-08-29 Thread Doug Leeper

After further evaluating what I need done...I don't believe I need AJAX.

The Tree Node needs to be updated to reflect a data change, i.e. name. 
However, the name change occurs in a page...not in the same page as the
tree.

Am I correct in this...no AJAX is needed since I am changing Pages?

If this is correct (no AJAX)...how to tell the nodes in the TreeTable to
update/reload their information?


-- 
View this message in context: 
http://www.nabble.com/TreeTable...how-to-refect-a-label-change-on-TreeNode-tf4300479.html#a12400148
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Example of pseudo-ajax file uploading using iframes

2007-08-29 Thread Carlos Pita
Hi all,

here is a hopefully functional example showing how to use an iframe to
upload a file and afterwards call a behavior on a component belonging to the
top frame, so that an ajax action could be carried on in consequence (maybe
to get rid of the iframe, or to show an informative message, or whatever).
This is along the same venue as other examples that are around the web, like
http://www.air4web.com/files/upload/. I don't have the time to write a
proper wiki page just right now, so I simply attach the example here. Hope
it helps.

Regards,
Carlos


upload.tgz
Description: GNU Zip compressed data
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: VisitChildren bottom-up

2007-08-29 Thread Igor Vaynberg
hrm. i have implemented a postorder traversal for formcomponents (see
FormComponent.visitFormComponentsPostOrder) so you can either take that code
and use it in your app, or we can bring it up to markupcontainer and
generalize it.

the problem is that we already have visitComponents, and having a
visitComponentsPostOrder next to it seems a little inconsistent. what do
other devs think?

-igor


On 8/29/07, RedFury <[EMAIL PROTECTED]> wrote:
>
>
> Hi all,
>
> I've writing a very heavily javascripted app in wicket and finding wicket
> handles the complexity wonderfully.  I've used VisitChildren(IVisitor)
> successfully in numerous places but have a problem with a case where I'd
> like to use it 'backwards'.  I'm writing some base components which will
> be
> used by our application programmers and our base Panel has an onClose()
> method which will contribute javascript to a closing panel  (rendered on
> AjaxRequestTarget.prependJavascript())  What I would like to do is have a
> closing panel's children automatically call onClose().
>
> So I started with:
>
> protected final void close()
> {
>   visitChildren(JumbuckPanel.class, new IVisitor()
>   {
> public Object component(Component c)
> {
>   ((JumbuckPanel)c).onClose();
>   return IVisitor.CONTINUE_TRAVERSAL;
> }
>   });
> }
>
> Then I realized that this had a problem - being onClose() I needed the
> children to be traversed from the bottom-up, whereas visitChildren always
> seem to go top-down.  That is, from looking at VisitChildren() in
> MarkupContainer, it goes..
>
> -visit this node
> -if this is a container, visitchildren recursively.
>
> wherease I need:
>
> -if this is a container, visitchildren recursively
> -visit this node.
>
> So originally I tried to write reverseVisitChildren() in my sublcass of
> MarkupContainer but then realized all of the access functions
> (children_size
> and children_next) are private in markupContainer and my recursive call to
> reverseVisitChildren would only work on my custom panel, not generic
> MarkupContainers, if that makes.
>
> Is anyone able to suggest a simple solution to this problem, as right now
> the best solution I can think of is to add that functionality to
> MarkupContainer as I think it might prove useful for other people at some
> stage also.
>
> Thanks,
> Dean
>
> --
> View this message in context:
> http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12399896
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread Igor Vaynberg
the entire point of disabling the component is that you do not want it to
process submitted input and update its model. you are looking for readonly
behavior rather then disabled i think. why not just set the readonly
attribute on that field.

-igor


On 8/29/07, janders <[EMAIL PROTECTED]> wrote:
>
>
> I posted this on the Databinder forum but no one seems to know of a
> work-around so I thought I'd post it here.
>
> Essentially I have a FocusableTextField that gets set by a DropDownChoice.
> If the choice is not "other" then I setEnabled to false and I place the
> string value of the DropDownChoice into the FocusableTextField. However
> the
> model is not persisted when setEnabled is false.
>
> Here is the code:
>
> // list of existing emailAddresses
> final List emailTypeList =
> Arrays.asList(EmailAddress.Type.values());
> final ListView emailAddresses = new
> PropertyListView("emailAddresses") {
> @Override
> protected void populateItem(final ListItem item) {
> final EmailAddress email = (EmailAddress)
> item.getModelObject();
> final FocusableTextField emailLabel = new
> FocusableTextField("label", page);
> if (email.getType() != EmailAddress.Type.OTHER)
> emailLabel.setEnabled(false);
> item.add(emailLabel);
> item.add(new DropDownChoice("type", emailTypeList) {
> @Override
> protected boolean
> wantOnSelectionChangedNotifications() {
> return true;
> }
> @Override
> protected void onSelectionChanged(final Object
> newSelection) {
> if (newSelection == EmailAddress.Type.OTHER) {
> emailLabel.setEnabled(true);
> emailLabel.requestFocus();
> } else {
>
> emailLabel.setModelValue(newSelection.toString());
> emailLabel.setEnabled(false);
> }
> }
> });
>   
>
> In this email example the dropdown choices are "home", "work", and
> "other".
> If user selects home or work I want the value of the FocusableTextField to
> be home or work and I do not want the user to be able to edit the field.
> That's why I set the field's isEnabled to false. On the other hand, if the
> user selects other, then I set isEnabled to true so that the user can edit
> the field. This works properly (persists the value) because isEnabled is
> true.
>
> Is there a workaround for this problem or can someone recommend a
> different
> approach?
>
> --
> View this message in context:
> http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12399840
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Updating Panels with AjaxLazyLoadingPanel

2007-08-29 Thread Igor Vaynberg
you can also use IndicatingAjaxLink that has a little indicator built in

-igor


On 8/29/07, Evan Chooly <[EMAIL PROTECTED]> wrote:
>
> Why not just use the AjaxLazyLoadingPanel?  I'm currently using it and my
> lazy loaded component is updated via AJAX.  So, page comes up, ALLP loads
> the report panel which can take a few seconds.  Then I have an AJAX
> submitted form that updates the filters for the report and refreshes that
> table using (from memory IndicatingAjaxSubmitButton) so while the report
> panel itself doesn't get the spinner on the update, the button gets that
> indicator showing that things are working.
>
> On 8/29/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED]>
> wrote:
> >
> > Hi list, I have a simple site with a menu on the left and a content in
> the
> > center that needs some wicket magic. ;-)
> >
> > Instead of reloading the page from menu link to menu link, I would like
> to
> > have AjaxLinks and a kind of AjaxLazyLoadingPanel that could change by
> > each
> > click without reloading all pages.
> >
> > Thankfully one big part is done. All pages basically creates a new panel
> > instance that holds its contents, so I already have every panel
> developed.
> > I
> > just need to load them into the main page by ajax means and if it is
> > possible, have the little wheel from the AjaxLazyLoadingPanel.
> >
> >
> > f(t)
> >
>


Re: Wicket capability for LARGE forms

2007-08-29 Thread Igor Vaynberg
yeah, with ajax instead of simply disabling them you can remove them
completely, or replace them with something else entirely.

however, if all you really want to do is to make them disabled on clientside
that should work also. might not be as straight forward but should work.

-igor


On 8/29/07, Antony Stubbs <[EMAIL PROTECTED]> wrote:
>
>
> Ah yes, DataTable, I see, like a data grid...
> And what about changing the fields to enabled / disabled? Staying within
> Wicket I suppose the nicest way would be ajax onChange behaviour on the
> initial drop down box?
>
>
> Eelco Hillenius wrote:
> >
> > On 8/29/07, Antony Stubbs <[EMAIL PROTECTED]> wrote:
> >>
> >> I have a couple of pages with _very large forms_, that are also
> modified
> >> dynamically to set which fields are editable using javascript,
> dependant
> >> on
> >> the value of a drop down list. Please see the example image attached.
> And
> >> that's only the first page
> >> the application is in - *gasp* - struts.
> >> I love what I've seen so far with Wicket, but I'm unsure what it's like
> >> to
> >> use compared to say, Stripes, Struts 2, Click, Tapestry etc when it
> comes
> >> to
> >> very large forms.
> >> being that setting up each field in wicket is kinda verbose...
> >
> > Yeah, you definitively should not just add all these examples by hand :)
> >
> > What you do is e.g. use a DataTable component. The data provider would
> > return the rows, and you define the columns on that data table. Rest
> > should be straightforward. Don't forget to set the itemReuseStrategy
> > if you're working inside a form (e.g. to use ReuseIfModelsEqual).
> >
> > Eelco
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Wicket-capability-for-LARGE-forms-tf4351285.html#a12399482
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


VisitChildren bottom-up

2007-08-29 Thread RedFury

Hi all,

I've writing a very heavily javascripted app in wicket and finding wicket
handles the complexity wonderfully.  I've used VisitChildren(IVisitor)
successfully in numerous places but have a problem with a case where I'd
like to use it 'backwards'.  I'm writing some base components which will be
used by our application programmers and our base Panel has an onClose()
method which will contribute javascript to a closing panel  (rendered on
AjaxRequestTarget.prependJavascript())  What I would like to do is have a
closing panel's children automatically call onClose().

So I started with:

protected final void close()
{
  visitChildren(JumbuckPanel.class, new IVisitor()
  {
public Object component(Component c)
{
  ((JumbuckPanel)c).onClose();
  return IVisitor.CONTINUE_TRAVERSAL;
}
  });
}

Then I realized that this had a problem - being onClose() I needed the
children to be traversed from the bottom-up, whereas visitChildren always
seem to go top-down.  That is, from looking at VisitChildren() in
MarkupContainer, it goes..

-visit this node
-if this is a container, visitchildren recursively.

wherease I need:

-if this is a container, visitchildren recursively
-visit this node.

So originally I tried to write reverseVisitChildren() in my sublcass of
MarkupContainer but then realized all of the access functions (children_size
and children_next) are private in markupContainer and my recursive call to
reverseVisitChildren would only work on my custom panel, not generic
MarkupContainers, if that makes.

Is anyone able to suggest a simple solution to this problem, as right now
the best solution I can think of is to add that functionality to
MarkupContainer as I think it might prove useful for other people at some
stage also.

Thanks,
Dean

-- 
View this message in context: 
http://www.nabble.com/VisitChildren-bottom-up-tf4351747.html#a12399896
Sent from the Wicket - User mailing list archive at Nabble.com.


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



setEnabled(false) on FocusableTextField breaks persistence

2007-08-29 Thread janders

I posted this on the Databinder forum but no one seems to know of a
work-around so I thought I'd post it here.

Essentially I have a FocusableTextField that gets set by a DropDownChoice.
If the choice is not "other" then I setEnabled to false and I place the
string value of the DropDownChoice into the FocusableTextField. However the
model is not persisted when setEnabled is false.

Here is the code: 

// list of existing emailAddresses
final List emailTypeList =
Arrays.asList(EmailAddress.Type.values());
final ListView emailAddresses = new
PropertyListView("emailAddresses") {
@Override
protected void populateItem(final ListItem item) {
final EmailAddress email = (EmailAddress)
item.getModelObject();
final FocusableTextField emailLabel = new
FocusableTextField("label", page);
if (email.getType() != EmailAddress.Type.OTHER)
emailLabel.setEnabled(false);
item.add(emailLabel);
item.add(new DropDownChoice("type", emailTypeList) {
@Override
protected boolean
wantOnSelectionChangedNotifications() {
return true;
}
@Override
protected void onSelectionChanged(final Object
newSelection) {
if (newSelection == EmailAddress.Type.OTHER) {
emailLabel.setEnabled(true);
emailLabel.requestFocus();
} else {
   
emailLabel.setModelValue(newSelection.toString());
emailLabel.setEnabled(false);
}
}
});
   

In this email example the dropdown choices are "home", "work", and "other".
If user selects home or work I want the value of the FocusableTextField to
be home or work and I do not want the user to be able to edit the field.
That's why I set the field's isEnabled to false. On the other hand, if the
user selects other, then I set isEnabled to true so that the user can edit
the field. This works properly (persists the value) because isEnabled is
true.

Is there a workaround for this problem or can someone recommend a different
approach?

-- 
View this message in context: 
http://www.nabble.com/setEnabled%28false%29-on-FocusableTextField-breaks-persistence-tf4351731.html#a12399840
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Updating Panels with AjaxLazyLoadingPanel

2007-08-29 Thread Evan Chooly
Why not just use the AjaxLazyLoadingPanel?  I'm currently using it and my
lazy loaded component is updated via AJAX.  So, page comes up, ALLP loads
the report panel which can take a few seconds.  Then I have an AJAX
submitted form that updates the filters for the report and refreshes that
table using (from memory IndicatingAjaxSubmitButton) so while the report
panel itself doesn't get the spinner on the update, the button gets that
indicator showing that things are working.

On 8/29/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED]>
wrote:
>
> Hi list, I have a simple site with a menu on the left and a content in the
> center that needs some wicket magic. ;-)
>
> Instead of reloading the page from menu link to menu link, I would like to
> have AjaxLinks and a kind of AjaxLazyLoadingPanel that could change by
> each
> click without reloading all pages.
>
> Thankfully one big part is done. All pages basically creates a new panel
> instance that holds its contents, so I already have every panel developed.
> I
> just need to load them into the main page by ajax means and if it is
> possible, have the little wheel from the AjaxLazyLoadingPanel.
>
>
> f(t)
>


Re: Wicket capability for LARGE forms

2007-08-29 Thread Antony Stubbs

Ah yes, DataTable, I see, like a data grid...
And what about changing the fields to enabled / disabled? Staying within
Wicket I suppose the nicest way would be ajax onChange behaviour on the
initial drop down box?


Eelco Hillenius wrote:
> 
> On 8/29/07, Antony Stubbs <[EMAIL PROTECTED]> wrote:
>>
>> I have a couple of pages with _very large forms_, that are also modified
>> dynamically to set which fields are editable using javascript, dependant
>> on
>> the value of a drop down list. Please see the example image attached. And
>> that's only the first page
>> the application is in - *gasp* - struts.
>> I love what I've seen so far with Wicket, but I'm unsure what it's like
>> to
>> use compared to say, Stripes, Struts 2, Click, Tapestry etc when it comes
>> to
>> very large forms.
>> being that setting up each field in wicket is kinda verbose...
> 
> Yeah, you definitively should not just add all these examples by hand :)
> 
> What you do is e.g. use a DataTable component. The data provider would
> return the rows, and you define the columns on that data table. Rest
> should be straightforward. Don't forget to set the itemReuseStrategy
> if you're working inside a form (e.g. to use ReuseIfModelsEqual).
> 
> Eelco
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-capability-for-LARGE-forms-tf4351285.html#a12399482
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: best practice for a header component with links defined by the page

2007-08-29 Thread Igor Vaynberg
I just dont understand how you expect us to continue helping you if you go
and talk trash about something we invest a lot of time in. Based on the
slashdot comments you left I dont really understand why you are using wicket
at all.

-igor


On 8/29/07, Kirk Israel <[EMAIL PROTECTED]> wrote:
>
> Igor, sorry if I've irritated you. I know some of my frustration comes
> from A. an ugly reluctance to embrace change and B. Wicket is doing
> great things but it's somewhat early days, and the documentation
> (tutorial books and recipe collections) is still scanty.
>
> Eelco, thanks, your summary was accurate. I thought about a repeater,
> it seemed like overkill, and I thought maybe there  was a  "third
> way". (I still have to look into how the encompassing page would feed
> the links into the component, maybe not that difficult)
>
> So am I correct in thinking that, in general, most HTML pages in
> WIcket will have all possible subcomponents listed, and the visibility
> will control things that shouldn't be there...
>
> On 8/29/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > or just write something in perl and call it a day.
> >
> > -igor
> >
> >
> > On 8/29/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > >
> > > So let me try to rephrase your problem: you have a header component
> > > that shows a variable number of components (links). Use a repeater
> > > (e.g. list view or repeating view) for the variable number of
> > > components, and you probably want to wrap the header component in a
> > > panel so that it is easy to move it around, place it on other pages,
> > > etc. Think a bit about whether those links should be internal or to
> > > bookmarkable pages, and that should do the trick, right?
> > >
> > > Eelco
> > >
> > > On 8/29/07, Kirk Israel <[EMAIL PROTECTED]> wrote:
> > > > Hey there--
> > > > So I came up with a solution to this, but I suspect it's not very
> > > > Wicket-y, so I'd like some suggestions on best practices:
> > > >
> > > > We want a header component that can go on different pages, with 1 2
> or
> > > > 3 links to other pages.
> > > > (Well, I guess ideally any #, but with my approach it was easier to
> > > > match it to the maximum shown in the spec). Visually, the end result
> > > > would be
> > > >
> > > > Back to:  _LINK1_, _LINK2_ or _LINK3_
> > > >
> > > > As far as i can tell, the links and their labels should be created
> by
> > > > the page containing the component. The trouble is, since the HTML
> and
> > > > wicket:id for displaying each link is in the HTML for the component,
> > > > the page has to "know" what ID to assign its link  (and it doesn't
> > > > seem like you can change the id of a component object after its
> > > > created, which would have meant the page could just hand a list of
> > > > un-ID'd labeled links in, and the component could have re-IDed them
> to
> > > > match the HTML)
> > > >
> > > > So the component has a static callback getIdPrefixForLink() and
> > > > getIdPrefixForLinkLabel(), and the page uses that, and then uses
> that
> > > > string + 0, 1, or 2 for the links its making and handing to the
> > > > constructor of the Header component.
> > > >
> > > > So if the Component only gets 1 Labeled Link, it then creates
> > > > placeholder objects for the other 2, to make sure the hierarchy as
> > > > outlined in the HTML is still ok, and then just hides them.
> > > >
> > > > And there's a tad more logic for the commas and the "or".
> > > >
> > > > So, this all seems really hacky to me. What's a better way? In other
> > > > words: Is having to make place holders for everything that ever
> MIGHT
> > > > appear on a page or component, and then making them invisible when
> you
> > > > don't need them, the Wicket way, or is there something more direct?
> > > > And/or is there a standard way of letting parent pages or component
> > > > make subsubcomponents to be added to a subcomponent (e.g the Page
> > > > making PageLinks to be added to the Header component -- incidentally
> I
> > > > can't just pass in a reference to the class, because of what we had
> to
> > > > do to make "lazy loading" links that don't fully instantiate the
> page
> > > > they go to until that link is clicked.)
> > > >
> > > >
> -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: best practice for a header component with links defined by the page

2007-08-29 Thread Eelco Hillenius
> So am I correct in thinking that, in general, most HTML pages in
> WIcket will have all possible subcomponents listed, and the visibility
> will control things that shouldn't be there...

That's one way to do it. But a better way typically is to build up
your pages dynamically, using panels for content that can change. Or a
combination of the two.

Eelco

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



Re: best practice for a header component with links defined by the page

2007-08-29 Thread Kirk Israel
Igor, sorry if I've irritated you. I know some of my frustration comes
from A. an ugly reluctance to embrace change and B. Wicket is doing
great things but it's somewhat early days, and the documentation
(tutorial books and recipe collections) is still scanty.

Eelco, thanks, your summary was accurate. I thought about a repeater,
it seemed like overkill, and I thought maybe there  was a  "third
way". (I still have to look into how the encompassing page would feed
the links into the component, maybe not that difficult)

So am I correct in thinking that, in general, most HTML pages in
WIcket will have all possible subcomponents listed, and the visibility
will control things that shouldn't be there...

On 8/29/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> or just write something in perl and call it a day.
>
> -igor
>
>
> On 8/29/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> >
> > So let me try to rephrase your problem: you have a header component
> > that shows a variable number of components (links). Use a repeater
> > (e.g. list view or repeating view) for the variable number of
> > components, and you probably want to wrap the header component in a
> > panel so that it is easy to move it around, place it on other pages,
> > etc. Think a bit about whether those links should be internal or to
> > bookmarkable pages, and that should do the trick, right?
> >
> > Eelco
> >
> > On 8/29/07, Kirk Israel <[EMAIL PROTECTED]> wrote:
> > > Hey there--
> > > So I came up with a solution to this, but I suspect it's not very
> > > Wicket-y, so I'd like some suggestions on best practices:
> > >
> > > We want a header component that can go on different pages, with 1 2 or
> > > 3 links to other pages.
> > > (Well, I guess ideally any #, but with my approach it was easier to
> > > match it to the maximum shown in the spec). Visually, the end result
> > > would be
> > >
> > > Back to:  _LINK1_, _LINK2_ or _LINK3_
> > >
> > > As far as i can tell, the links and their labels should be created by
> > > the page containing the component. The trouble is, since the HTML and
> > > wicket:id for displaying each link is in the HTML for the component,
> > > the page has to "know" what ID to assign its link  (and it doesn't
> > > seem like you can change the id of a component object after its
> > > created, which would have meant the page could just hand a list of
> > > un-ID'd labeled links in, and the component could have re-IDed them to
> > > match the HTML)
> > >
> > > So the component has a static callback getIdPrefixForLink() and
> > > getIdPrefixForLinkLabel(), and the page uses that, and then uses that
> > > string + 0, 1, or 2 for the links its making and handing to the
> > > constructor of the Header component.
> > >
> > > So if the Component only gets 1 Labeled Link, it then creates
> > > placeholder objects for the other 2, to make sure the hierarchy as
> > > outlined in the HTML is still ok, and then just hides them.
> > >
> > > And there's a tad more logic for the commas and the "or".
> > >
> > > So, this all seems really hacky to me. What's a better way? In other
> > > words: Is having to make place holders for everything that ever MIGHT
> > > appear on a page or component, and then making them invisible when you
> > > don't need them, the Wicket way, or is there something more direct?
> > > And/or is there a standard way of letting parent pages or component
> > > make subsubcomponents to be added to a subcomponent (e.g the Page
> > > making PageLinks to be added to the Header component -- incidentally I
> > > can't just pass in a reference to the class, because of what we had to
> > > do to make "lazy loading" links that don't fully instantiate the page
> > > they go to until that link is clicked.)
> > >
> > > -
> > > 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]



Best way to add a MarkupFilter

2007-08-29 Thread David Leangen

What's the best way to add a markup filter to my app?

I noticed that in the settings I can override the MarkupParserFactory
and provide my own filter, but that is not what I want to do. I just
want to use the default factory, but add my own filter.


Thanks!



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



Re: Wicket HTML Simplicity

2007-08-29 Thread Eelco Hillenius
On 8/29/07, Carlos Silva <[EMAIL PROTECTED]> wrote:
> Apparently there is a javascript library that allows you to do just
> this.
>
> http://jroller.com/wireframe/entry/auto_previewable_wicket_pages
>
> I'm wondering why such a tool is not part of wicket? I will give it a
> try.

There is actually an example about this in wicket-examples, though I
think it's not on the index page. For the rest, it's completely
javascript, so we don't need to package it for you to use it.

Eelco

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



Re: Wicket capability for LARGE forms

2007-08-29 Thread Eelco Hillenius
On 8/29/07, Antony Stubbs <[EMAIL PROTECTED]> wrote:
>
> I have a couple of pages with _very large forms_, that are also modified
> dynamically to set which fields are editable using javascript, dependant on
> the value of a drop down list. Please see the example image attached. And
> that's only the first page
> the application is in - *gasp* - struts.
> I love what I've seen so far with Wicket, but I'm unsure what it's like to
> use compared to say, Stripes, Struts 2, Click, Tapestry etc when it comes to
> very large forms.
> being that setting up each field in wicket is kinda verbose...

Yeah, you definitively should not just add all these examples by hand :)

What you do is e.g. use a DataTable component. The data provider would
return the rows, and you define the columns on that data table. Rest
should be straightforward. Don't forget to set the itemReuseStrategy
if you're working inside a form (e.g. to use ReuseIfModelsEqual).

Eelco

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



Re: Wicket HTML Simplicity

2007-08-29 Thread Carlos Silva
Apparently there is a javascript library that allows you to do just  
this.


http://jroller.com/wireframe/entry/auto_previewable_wicket_pages

I'm wondering why such a tool is not part of wicket? I will give it a  
try.


Thank you all for your help.

On Aug 29, 2007, at 4:25 PM, Igor Vaynberg wrote:


google wicket:preview

-igor


On 8/29/07, Carlos Silva <[EMAIL PROTECTED]> wrote:


I'm actually very interested in this topic and wondering if there are
any solutions to this problem.

On Aug 29, 2007, at 2:43 PM, Matej Knopp wrote:


Well, it is just HTML. But there is a templating involved. And that
has to
hinder previewability in a certain way.

-Matej

On 8/29/07, Carlos Silva <[EMAIL PROTECTED]> wrote:


I guess the "is just HTML" claim of wicket only goes so far.

On Aug 29, 2007, at 2:16 PM, Martijn Dashorst wrote:


AFAIK, wicket-bench (an eclipse plugin) does support some form of
previewing, but I don't know how far the support actually goes.

Martijn

On 8/29/07, Gwyn Evans <[EMAIL PROTECTED]> wrote:
No, it looks to me as if the OP's not worried about the pages  
while

running, but is rather looking for something to pre-process the
page
for previewing them...

Might be a "very simple question" (but not IMO!) but I'm not sure
what
approaches others use to preview pages, especially when markup
inheritance might be involved...

/Gwyn

On Wednesday, August 29, 2007, 9:12:36 PM, Johan
<[EMAIL PROTECTED]> wrote:


It sounds like you want Markup Inheritance.
http://cwiki.apache.org/WICKET/markup-inheritance.html
Johan



Carlos Silva wrote:

I'm new to wicket and have a very simple question:

Got a usual html template for all my pages:


  HEADER
  ... page content ...
  FOOTER


Inside my span elements for header and footer I have actual
markup and
this allows me to see a full page with headers and footers by
just
opening the html in a browser. The markup gets replaced by
wicket once
the page is rendered via a web server.

Obviously I don't want to replicate the markup inside my span
elements
to all my other 100s of pages but I do want to be able to open
all the
other pages in a browser and see the header and footer.

Is this possible perhaps with some wicket tool?




 
--

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




/Gwyn


- 
--

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





--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0- 
beta3/


-- 
--

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






Wicket capability for LARGE forms

2007-08-29 Thread Antony Stubbs

I have a couple of pages with _very large forms_, that are also modified
dynamically to set which fields are editable using javascript, dependant on
the value of a drop down list. Please see the example image attached. And
that's only the first page
the application is in - *gasp* - struts.
I love what I've seen so far with Wicket, but I'm unsure what it's like to
use compared to say, Stripes, Struts 2, Click, Tapestry etc when it comes to
very large forms.
being that setting up each field in wicket is kinda verbose...


What are people's experiences? How do you find Wicket to use in very large
forms? Thoughts? Ideas? Alternatives?

(disclaimer - I've only written one page in Wicket, and that was just
playing around with Ajax (NCE!! :)))

http://www.nabble.com/file/p12398507/bigForm.png 
-- 
View this message in context: 
http://www.nabble.com/Wicket-capability-for-LARGE-forms-tf4351285.html#a12398507
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: best practice for a header component with links defined by the page

2007-08-29 Thread Igor Vaynberg
or just write something in perl and call it a day.

-igor


On 8/29/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
>
> So let me try to rephrase your problem: you have a header component
> that shows a variable number of components (links). Use a repeater
> (e.g. list view or repeating view) for the variable number of
> components, and you probably want to wrap the header component in a
> panel so that it is easy to move it around, place it on other pages,
> etc. Think a bit about whether those links should be internal or to
> bookmarkable pages, and that should do the trick, right?
>
> Eelco
>
> On 8/29/07, Kirk Israel <[EMAIL PROTECTED]> wrote:
> > Hey there--
> > So I came up with a solution to this, but I suspect it's not very
> > Wicket-y, so I'd like some suggestions on best practices:
> >
> > We want a header component that can go on different pages, with 1 2 or
> > 3 links to other pages.
> > (Well, I guess ideally any #, but with my approach it was easier to
> > match it to the maximum shown in the spec). Visually, the end result
> > would be
> >
> > Back to:  _LINK1_, _LINK2_ or _LINK3_
> >
> > As far as i can tell, the links and their labels should be created by
> > the page containing the component. The trouble is, since the HTML and
> > wicket:id for displaying each link is in the HTML for the component,
> > the page has to "know" what ID to assign its link  (and it doesn't
> > seem like you can change the id of a component object after its
> > created, which would have meant the page could just hand a list of
> > un-ID'd labeled links in, and the component could have re-IDed them to
> > match the HTML)
> >
> > So the component has a static callback getIdPrefixForLink() and
> > getIdPrefixForLinkLabel(), and the page uses that, and then uses that
> > string + 0, 1, or 2 for the links its making and handing to the
> > constructor of the Header component.
> >
> > So if the Component only gets 1 Labeled Link, it then creates
> > placeholder objects for the other 2, to make sure the hierarchy as
> > outlined in the HTML is still ok, and then just hides them.
> >
> > And there's a tad more logic for the commas and the "or".
> >
> > So, this all seems really hacky to me. What's a better way? In other
> > words: Is having to make place holders for everything that ever MIGHT
> > appear on a page or component, and then making them invisible when you
> > don't need them, the Wicket way, or is there something more direct?
> > And/or is there a standard way of letting parent pages or component
> > make subsubcomponents to be added to a subcomponent (e.g the Page
> > making PageLinks to be added to the Header component -- incidentally I
> > can't just pass in a reference to the class, because of what we had to
> > do to make "lazy loading" links that don't fully instantiate the page
> > they go to until that link is clicked.)
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Wicket getting some bad press at Slashdot.org

2007-08-29 Thread Igor Vaynberg
On 8/29/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
>
> Let me just say I'm very very glad I don't have to develop
> the site I'm working on using Perl. :)


yeah, but if you did youd have it done in 1/10th the time. it can probably
all fit in a single file too.

-igor


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


Re: Wicket HTML Simplicity

2007-08-29 Thread Igor Vaynberg
google wicket:preview

-igor


On 8/29/07, Carlos Silva <[EMAIL PROTECTED]> wrote:
>
> I'm actually very interested in this topic and wondering if there are
> any solutions to this problem.
>
> On Aug 29, 2007, at 2:43 PM, Matej Knopp wrote:
>
> > Well, it is just HTML. But there is a templating involved. And that
> > has to
> > hinder previewability in a certain way.
> >
> > -Matej
> >
> > On 8/29/07, Carlos Silva <[EMAIL PROTECTED]> wrote:
> >>
> >> I guess the "is just HTML" claim of wicket only goes so far.
> >>
> >> On Aug 29, 2007, at 2:16 PM, Martijn Dashorst wrote:
> >>
> >>> AFAIK, wicket-bench (an eclipse plugin) does support some form of
> >>> previewing, but I don't know how far the support actually goes.
> >>>
> >>> Martijn
> >>>
> >>> On 8/29/07, Gwyn Evans <[EMAIL PROTECTED]> wrote:
>  No, it looks to me as if the OP's not worried about the pages while
>  running, but is rather looking for something to pre-process the
>  page
>  for previewing them...
> 
>  Might be a "very simple question" (but not IMO!) but I'm not sure
>  what
>  approaches others use to preview pages, especially when markup
>  inheritance might be involved...
> 
>  /Gwyn
> 
>  On Wednesday, August 29, 2007, 9:12:36 PM, Johan
>  <[EMAIL PROTECTED]> wrote:
> 
> > It sounds like you want Markup Inheritance.
> > http://cwiki.apache.org/WICKET/markup-inheritance.html
> > Johan
> 
> > Carlos Silva wrote:
> >> I'm new to wicket and have a very simple question:
> >>
> >> Got a usual html template for all my pages:
> >>
> >> 
> >>   HEADER
> >>   ... page content ...
> >>   FOOTER
> >> 
> >>
> >> Inside my span elements for header and footer I have actual
> >> markup and
> >> this allows me to see a full page with headers and footers by
> >> just
> >> opening the html in a browser. The markup gets replaced by
> >> wicket once
> >> the page is rendered via a web server.
> >>
> >> Obviously I don't want to replicate the markup inside my span
> >> elements
> >> to all my other 100s of pages but I do want to be able to open
> >> all the
> >> other pages in a browser and see the header and footer.
> >>
> >> Is this possible perhaps with some wicket tool?
> >>
> >>
> 
> > --
> > --
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
>  /Gwyn
> 
> 
>  ---
>  --
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> >>>
> >>>
> >>> --
> >>> Buy Wicket in Action: http://manning.com/dashorst
> >>> Apache Wicket 1.3.0-beta3 is released
> >>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
> >>>
> >>> 
> >>> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: RadioChoice and ListView

2007-08-29 Thread Igor Vaynberg
break in your onsubmit and look at the list that the listview is pointing
to. make sure the data is there, the fact that it isnt being persisted might
be a problem outside of wicket's scope.

-igor


On 8/29/07, Alex Pine <[EMAIL PROTECTED]> wrote:
>
> I'm sorry to spam the list like this, but I really need help on this.
> Igor's
> solution doesn't seem to change anything. No information is transferred to
> the database upon hitting "on submit". If no one knows the solution, does
> anyone have any ideas on how I could debug this? Is there some way I can
> reference the selections of the radiogroups from the the onSubmit method
> so
> I can see what their values are?
> Thanks for any help you can give,
> Alex
>
> On 8/29/07, Alex Pine <[EMAIL PROTECTED]> wrote:
> >
> > Thank you for the quick reply, but this fix doesn't seem to work. The
> > selections are never persisted on form submit. Any ideas?
> >
> > On 8/29/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > >
> > > problem is here
> > >
> > > RadioGroup rg = new RadioGroup("choice");
> > >
> > > you are not setting the model for the radiogroup choice so your
> choices
> > > go
> > > no where
> > >
> > > RadioGroup rg = new RadioGroup("choice", new PropertyModel(
> > > item.getModel(),
> > > "status"));
> > >
> > > or leave it as it is and use PropertyListView instead
> > >
> > > -igor
> > >
> > >
> > > On 8/29/07, Alex Pine <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Hi all,
> > > > I'm trying to use a Radio Choice component inside a Listview so that
> > > each
> > > > list
> > > > item has one RadioGroup with three choices. When the form submit
> > > button is
> > > > pressed,
> > > > each selected choice should set a field in the model object of each
> > > list
> > > > item.
> > > > The code below should explain the problem more fully:
> > > >
> > > >
> > > > /*
> > > > The ultimate goal is to set the "status" field in each Participation
> > > > object
> > > > in the participationList of the object below.
> > > > */
> > > > public class Experiment {
> > > >
> > > >   private String name;
> > > >
> > > >   private List participationList;
> > > >
> > > >   /* Other fields, constructors, getters, setters, etc */
> > > >
> > > > }
> > > >
> > > >
> > > > public class Participation {
> > > >
> > > > public static final int PARTICIPATED = 1;
> > > > public static final int NO_SHOW = -1;
> > > > public static final int SHOWED = 0;
> > > >
> > > > private User user;
> > > >
> > > > private int status;
> > > >
> > > > public Participation() {
> > > > status = SHOWED; // Default value
> > > > }
> > > >
> > > > /* getters, setters, etc */
> > > > }
> > > >
> > > >
> > > > /* This is the web page that is supposed to do the setting*/
> > > > public class ParticipationPage extends BasePage {
> > > >
> > > > private static final long serialVersionUID = 1L;
> > > >
> > > > @SpringBean
> > > > private ExperimentDAO exDAO;
> > > >
> > > > private DetachableExperimentModel exModel;
> > > >
> > > > public ParticipationPage(Experiment ex) {
> > > > exModel = new DetachableExperimentModel(ex, exDAO);
> > > > add(new ParticipationForm("form"));
> > > > exModel.detach();
> > > > }
> > > >
> > > > class ParticipationForm extends Form {
> > > >
> > > > public ParticipationForm(String id) {
> > > > super(id);
> > > > List participationList = exModel.getEx
> > > > ().getParticipationList();
> > > >
> > > > ListView subjectListView = new ListView("list",
> > > > participationList) {
> > > >
> > > > private static final long serialVersionUID = 1L;
> > > >
> > > > /*
> > > >  I imagine the correct code should be something like
> > > > this...?
> > > >  */
> > > > public void populateItem(final ListItem item) {
> > > > Participation participation =
> > > > (Participation)item.getModelObject();
> > > > item.add(new Label("name", participation.getUser
> > > > ().getName()));
> > > > RadioGroup rg = new RadioGroup("choice");
> > > > rg.add (new Radio("participated", new Model(
> > > > Participation.PARTICIPATED)));
> > > > rg.add(new Radio("no show", new Model(
> > > > Participation.NO_SHOW)));
> > > > rg.add(new Radio("showed", new Model(
> > > > Participation.SHOWED)));
> > > > item.add(rg);
> > > > }
> > > > };
> > > > subjectListView.setReuseItems (true);
> > > > add(subjectListView);
> > > > }
> > > >
> > > > @Override
> > > > protected void onSubmit() {
> > > >
> > > >   /*
> > > >* Somehow I have to set each Participation object in the
> user's
> > >
> > > > participationList
> > > >* to the choice from corresponding the radio group.
>

Re: best practice for a header component with links defined by the page

2007-08-29 Thread Eelco Hillenius
So let me try to rephrase your problem: you have a header component
that shows a variable number of components (links). Use a repeater
(e.g. list view or repeating view) for the variable number of
components, and you probably want to wrap the header component in a
panel so that it is easy to move it around, place it on other pages,
etc. Think a bit about whether those links should be internal or to
bookmarkable pages, and that should do the trick, right?

Eelco

On 8/29/07, Kirk Israel <[EMAIL PROTECTED]> wrote:
> Hey there--
> So I came up with a solution to this, but I suspect it's not very
> Wicket-y, so I'd like some suggestions on best practices:
>
> We want a header component that can go on different pages, with 1 2 or
> 3 links to other pages.
> (Well, I guess ideally any #, but with my approach it was easier to
> match it to the maximum shown in the spec). Visually, the end result
> would be
>
> Back to:  _LINK1_, _LINK2_ or _LINK3_
>
> As far as i can tell, the links and their labels should be created by
> the page containing the component. The trouble is, since the HTML and
> wicket:id for displaying each link is in the HTML for the component,
> the page has to "know" what ID to assign its link  (and it doesn't
> seem like you can change the id of a component object after its
> created, which would have meant the page could just hand a list of
> un-ID'd labeled links in, and the component could have re-IDed them to
> match the HTML)
>
> So the component has a static callback getIdPrefixForLink() and
> getIdPrefixForLinkLabel(), and the page uses that, and then uses that
> string + 0, 1, or 2 for the links its making and handing to the
> constructor of the Header component.
>
> So if the Component only gets 1 Labeled Link, it then creates
> placeholder objects for the other 2, to make sure the hierarchy as
> outlined in the HTML is still ok, and then just hides them.
>
> And there's a tad more logic for the commas and the "or".
>
> So, this all seems really hacky to me. What's a better way? In other
> words: Is having to make place holders for everything that ever MIGHT
> appear on a page or component, and then making them invisible when you
> don't need them, the Wicket way, or is there something more direct?
> And/or is there a standard way of letting parent pages or component
> make subsubcomponents to be added to a subcomponent (e.g the Page
> making PageLinks to be added to the Header component -- incidentally I
> can't just pass in a reference to the class, because of what we had to
> do to make "lazy loading" links that don't fully instantiate the page
> they go to until that link is clicked.)
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: best practice for a header component with links defined by the page

2007-08-29 Thread Matej Knopp
You should use panels for this. You can have panels for 1 link, 2 links a 3
links. Or even put a repeater into panel to generate as many links as you
want. And you then need only one placeholder on the page (for the panel).

-Matej

On 8/29/07, Kirk Israel <[EMAIL PROTECTED]> wrote:
>
> Hey there--
> So I came up with a solution to this, but I suspect it's not very
> Wicket-y, so I'd like some suggestions on best practices:
>
> We want a header component that can go on different pages, with 1 2 or
> 3 links to other pages.
> (Well, I guess ideally any #, but with my approach it was easier to
> match it to the maximum shown in the spec). Visually, the end result
> would be
>
> Back to:  _LINK1_, _LINK2_ or _LINK3_
>
> As far as i can tell, the links and their labels should be created by
> the page containing the component. The trouble is, since the HTML and
> wicket:id for displaying each link is in the HTML for the component,
> the page has to "know" what ID to assign its link  (and it doesn't
> seem like you can change the id of a component object after its
> created, which would have meant the page could just hand a list of
> un-ID'd labeled links in, and the component could have re-IDed them to
> match the HTML)
>
> So the component has a static callback getIdPrefixForLink() and
> getIdPrefixForLinkLabel(), and the page uses that, and then uses that
> string + 0, 1, or 2 for the links its making and handing to the
> constructor of the Header component.
>
> So if the Component only gets 1 Labeled Link, it then creates
> placeholder objects for the other 2, to make sure the hierarchy as
> outlined in the HTML is still ok, and then just hides them.
>
> And there's a tad more logic for the commas and the "or".
>
> So, this all seems really hacky to me. What's a better way? In other
> words: Is having to make place holders for everything that ever MIGHT
> appear on a page or component, and then making them invisible when you
> don't need them, the Wicket way, or is there something more direct?
> And/or is there a standard way of letting parent pages or component
> make subsubcomponents to be added to a subcomponent (e.g the Page
> making PageLinks to be added to the Header component -- incidentally I
> can't just pass in a reference to the class, because of what we had to
> do to make "lazy loading" links that don't fully instantiate the page
> they go to until that link is clicked.)
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Wicket getting some bad press at Slashdot.org

2007-08-29 Thread Eelco Hillenius
On 8/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Over in the Slashdot article about "GWT in Action" there are some negative
> opinions toward Wicket expressed.  Just thought I'd mention it in case any
> of the gurus want to weigh in too.  (Head over to this link, set the
> threshold to 4, then search for "Wicket",
> http://books.slashdot.org/article.pl?sid=07/08/29/1418229 ).

I just did, cheers. There are also a lot of people complaining about
GWT, as there are a bunch defending it. Welcome to Java Land :)

That Wicket and GWT aren't for everyone isn't surprising, since both
make a couple of strong assumptions. And people who complain about
framework bloat are as old as our profession (and they are often right
as well). Let me just say I'm very very glad I don't have to develop
the site I'm working on using Perl. :)

Eelco

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



Re: Wicket getting some bad press at Slashdot.org

2007-08-29 Thread Per Ejeklint

Oh dear, some guys in that thread really suffer from delusions of adequacy...

I just love the quote "I just don't see what Wicket - or possibly any web
framework - buys you." I dare say that "kisrael" who wrote it won't buy a
lot at all.

And Eelco, I admire your patience and endurance. Where do you get your
strength? :-)

/Per


Justin Morgan (Logic Sector) wrote:
> 
> Over in the Slashdot article about "GWT in Action" there are some negative
> opinions toward Wicket expressed.  Just thought I'd mention it in case any
> of the gurus want to weigh in too.  (Head over to this link, set the
> threshold to 4, then search for "Wicket",
> http://books.slashdot.org/article.pl?sid=07/08/29/1418229 ).
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-getting-some-bad-press-at-Slashdot.org-tf4350622.html#a12396633
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket HTML Simplicity

2007-08-29 Thread Carlos Silva
I'm actually very interested in this topic and wondering if there are  
any solutions to this problem.


On Aug 29, 2007, at 2:43 PM, Matej Knopp wrote:

Well, it is just HTML. But there is a templating involved. And that  
has to

hinder previewability in a certain way.

-Matej

On 8/29/07, Carlos Silva <[EMAIL PROTECTED]> wrote:


I guess the "is just HTML" claim of wicket only goes so far.

On Aug 29, 2007, at 2:16 PM, Martijn Dashorst wrote:


AFAIK, wicket-bench (an eclipse plugin) does support some form of
previewing, but I don't know how far the support actually goes.

Martijn

On 8/29/07, Gwyn Evans <[EMAIL PROTECTED]> wrote:

No, it looks to me as if the OP's not worried about the pages while
running, but is rather looking for something to pre-process the  
page

for previewing them...

Might be a "very simple question" (but not IMO!) but I'm not sure
what
approaches others use to preview pages, especially when markup
inheritance might be involved...

/Gwyn

On Wednesday, August 29, 2007, 9:12:36 PM, Johan
<[EMAIL PROTECTED]> wrote:


It sounds like you want Markup Inheritance.
http://cwiki.apache.org/WICKET/markup-inheritance.html
Johan



Carlos Silva wrote:

I'm new to wicket and have a very simple question:

Got a usual html template for all my pages:


  HEADER
  ... page content ...
  FOOTER


Inside my span elements for header and footer I have actual
markup and
this allows me to see a full page with headers and footers by  
just

opening the html in a browser. The markup gets replaced by
wicket once
the page is rendered via a web server.

Obviously I don't want to replicate the markup inside my span
elements
to all my other 100s of pages but I do want to be able to open
all the
other pages in a browser and see the header and footer.

Is this possible perhaps with some wicket tool?




-- 
--

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




/Gwyn


--- 
--

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





--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

 
-

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




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





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



Re: Wicket getting some bad press at Slashdot.org

2007-08-29 Thread Matej Knopp
Yeah, we have alrady seen it. But I personally think that responding to
arguments such as "I just don't see what Wicket - or possibly any web
framework - buys you." is just a waste of time.

-Matej

On 8/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Over in the Slashdot article about "GWT in Action" there are some negative
> opinions toward Wicket expressed.  Just thought I'd mention it in case any
> of the gurus want to weigh in too.  (Head over to this link, set the
> threshold to 4, then search for "Wicket",
> http://books.slashdot.org/article.pl?sid=07/08/29/1418229 ).
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Wicket HTML Simplicity

2007-08-29 Thread Matej Knopp
Well, it is just HTML. But there is a templating involved. And that has to
hinder previewability in a certain way.

-Matej

On 8/29/07, Carlos Silva <[EMAIL PROTECTED]> wrote:
>
> I guess the "is just HTML" claim of wicket only goes so far.
>
> On Aug 29, 2007, at 2:16 PM, Martijn Dashorst wrote:
>
> > AFAIK, wicket-bench (an eclipse plugin) does support some form of
> > previewing, but I don't know how far the support actually goes.
> >
> > Martijn
> >
> > On 8/29/07, Gwyn Evans <[EMAIL PROTECTED]> wrote:
> >> No, it looks to me as if the OP's not worried about the pages while
> >> running, but is rather looking for something to pre-process the page
> >> for previewing them...
> >>
> >> Might be a "very simple question" (but not IMO!) but I'm not sure
> >> what
> >> approaches others use to preview pages, especially when markup
> >> inheritance might be involved...
> >>
> >> /Gwyn
> >>
> >> On Wednesday, August 29, 2007, 9:12:36 PM, Johan
> >> <[EMAIL PROTECTED]> wrote:
> >>
> >>> It sounds like you want Markup Inheritance.
> >>> http://cwiki.apache.org/WICKET/markup-inheritance.html
> >>> Johan
> >>
> >>> Carlos Silva wrote:
>  I'm new to wicket and have a very simple question:
> 
>  Got a usual html template for all my pages:
> 
>  
>    HEADER
>    ... page content ...
>    FOOTER
>  
> 
>  Inside my span elements for header and footer I have actual
>  markup and
>  this allows me to see a full page with headers and footers by just
>  opening the html in a browser. The markup gets replaced by
>  wicket once
>  the page is rendered via a web server.
> 
>  Obviously I don't want to replicate the markup inside my span
>  elements
>  to all my other 100s of pages but I do want to be able to open
>  all the
>  other pages in a browser and see the header and footer.
> 
>  Is this possible perhaps with some wicket tool?
> 
> 
> >>
> >>> 
> >>> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >> /Gwyn
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > Buy Wicket in Action: http://manning.com/dashorst
> > Apache Wicket 1.3.0-beta3 is released
> > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
> >
> > -
> > 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]
>
>


Wicket getting some bad press at Slashdot.org

2007-08-29 Thread jmorgan
Over in the Slashdot article about "GWT in Action" there are some negative
opinions toward Wicket expressed.  Just thought I'd mention it in case any
of the gurus want to weigh in too.  (Head over to this link, set the
threshold to 4, then search for "Wicket",
http://books.slashdot.org/article.pl?sid=07/08/29/1418229 ).



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



Re: Wicket HTML Simplicity

2007-08-29 Thread Carlos Silva

I guess the "is just HTML" claim of wicket only goes so far.

On Aug 29, 2007, at 2:16 PM, Martijn Dashorst wrote:


AFAIK, wicket-bench (an eclipse plugin) does support some form of
previewing, but I don't know how far the support actually goes.

Martijn

On 8/29/07, Gwyn Evans <[EMAIL PROTECTED]> wrote:

No, it looks to me as if the OP's not worried about the pages while
running, but is rather looking for something to pre-process the page
for previewing them...

Might be a "very simple question" (but not IMO!) but I'm not sure  
what

approaches others use to preview pages, especially when markup
inheritance might be involved...

/Gwyn

On Wednesday, August 29, 2007, 9:12:36 PM, Johan  
<[EMAIL PROTECTED]> wrote:



It sounds like you want Markup Inheritance.
http://cwiki.apache.org/WICKET/markup-inheritance.html
Johan



Carlos Silva wrote:

I'm new to wicket and have a very simple question:

Got a usual html template for all my pages:


  HEADER
  ... page content ...
  FOOTER


Inside my span elements for header and footer I have actual  
markup and

this allows me to see a full page with headers and footers by just
opening the html in a browser. The markup gets replaced by  
wicket once

the page is rendered via a web server.

Obviously I don't want to replicate the markup inside my span  
elements
to all my other 100s of pages but I do want to be able to open  
all the

other pages in a browser and see the header and footer.

Is this possible perhaps with some wicket tool?




 
-

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




/Gwyn


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





--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

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




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



Re: Wicket HTML Simplicity

2007-08-29 Thread Martijn Dashorst
AFAIK, wicket-bench (an eclipse plugin) does support some form of
previewing, but I don't know how far the support actually goes.

Martijn

On 8/29/07, Gwyn Evans <[EMAIL PROTECTED]> wrote:
> No, it looks to me as if the OP's not worried about the pages while
> running, but is rather looking for something to pre-process the page
> for previewing them...
>
> Might be a "very simple question" (but not IMO!) but I'm not sure what
> approaches others use to preview pages, especially when markup
> inheritance might be involved...
>
> /Gwyn
>
> On Wednesday, August 29, 2007, 9:12:36 PM, Johan <[EMAIL PROTECTED]> wrote:
>
> > It sounds like you want Markup Inheritance.
> > http://cwiki.apache.org/WICKET/markup-inheritance.html
> > Johan
>
> > Carlos Silva wrote:
> >> I'm new to wicket and have a very simple question:
> >>
> >> Got a usual html template for all my pages:
> >>
> >> 
> >>   HEADER
> >>   ... page content ...
> >>   FOOTER
> >> 
> >>
> >> Inside my span elements for header and footer I have actual markup and
> >> this allows me to see a full page with headers and footers by just
> >> opening the html in a browser. The markup gets replaced by wicket once
> >> the page is rendered via a web server.
> >>
> >> Obviously I don't want to replicate the markup inside my span elements
> >> to all my other 100s of pages but I do want to be able to open all the
> >> other pages in a browser and see the header and footer.
> >>
> >> Is this possible perhaps with some wicket tool?
> >>
> >>
>
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> /Gwyn
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

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



Re: Wicket HTML Simplicity

2007-08-29 Thread Gwyn Evans
No, it looks to me as if the OP's not worried about the pages while
running, but is rather looking for something to pre-process the page
for previewing them...

Might be a "very simple question" (but not IMO!) but I'm not sure what
approaches others use to preview pages, especially when markup
inheritance might be involved...

/Gwyn

On Wednesday, August 29, 2007, 9:12:36 PM, Johan <[EMAIL PROTECTED]> wrote:

> It sounds like you want Markup Inheritance.
> http://cwiki.apache.org/WICKET/markup-inheritance.html
> Johan

> Carlos Silva wrote:
>> I'm new to wicket and have a very simple question:
>> 
>> Got a usual html template for all my pages:
>> 
>> 
>>   HEADER
>>   ... page content ...
>>   FOOTER
>> 
>> 
>> Inside my span elements for header and footer I have actual markup and 
>> this allows me to see a full page with headers and footers by just 
>> opening the html in a browser. The markup gets replaced by wicket once 
>> the page is rendered via a web server.
>> 
>> Obviously I don't want to replicate the markup inside my span elements 
>> to all my other 100s of pages but I do want to be able to open all the 
>> other pages in a browser and see the header and footer.
>> 
>> Is this possible perhaps with some wicket tool?
>> 
>> 

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



/Gwyn


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



Re: RadioChoice and ListView

2007-08-29 Thread Alex Pine
I'm sorry to spam the list like this, but I really need help on this. Igor's
solution doesn't seem to change anything. No information is transferred to
the database upon hitting "on submit". If no one knows the solution, does
anyone have any ideas on how I could debug this? Is there some way I can
reference the selections of the radiogroups from the the onSubmit method so
I can see what their values are?
Thanks for any help you can give,
Alex

On 8/29/07, Alex Pine <[EMAIL PROTECTED]> wrote:
>
> Thank you for the quick reply, but this fix doesn't seem to work. The
> selections are never persisted on form submit. Any ideas?
>
> On 8/29/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> >
> > problem is here
> >
> > RadioGroup rg = new RadioGroup("choice");
> >
> > you are not setting the model for the radiogroup choice so your choices
> > go
> > no where
> >
> > RadioGroup rg = new RadioGroup("choice", new PropertyModel(
> > item.getModel(),
> > "status"));
> >
> > or leave it as it is and use PropertyListView instead
> >
> > -igor
> >
> >
> > On 8/29/07, Alex Pine <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi all,
> > > I'm trying to use a Radio Choice component inside a Listview so that
> > each
> > > list
> > > item has one RadioGroup with three choices. When the form submit
> > button is
> > > pressed,
> > > each selected choice should set a field in the model object of each
> > list
> > > item.
> > > The code below should explain the problem more fully:
> > >
> > >
> > > /*
> > > The ultimate goal is to set the "status" field in each Participation
> > > object
> > > in the participationList of the object below.
> > > */
> > > public class Experiment {
> > >
> > >   private String name;
> > >
> > >   private List participationList;
> > >
> > >   /* Other fields, constructors, getters, setters, etc */
> > >
> > > }
> > >
> > >
> > > public class Participation {
> > >
> > > public static final int PARTICIPATED = 1;
> > > public static final int NO_SHOW = -1;
> > > public static final int SHOWED = 0;
> > >
> > > private User user;
> > >
> > > private int status;
> > >
> > > public Participation() {
> > > status = SHOWED; // Default value
> > > }
> > >
> > > /* getters, setters, etc */
> > > }
> > >
> > >
> > > /* This is the web page that is supposed to do the setting*/
> > > public class ParticipationPage extends BasePage {
> > >
> > > private static final long serialVersionUID = 1L;
> > >
> > > @SpringBean
> > > private ExperimentDAO exDAO;
> > >
> > > private DetachableExperimentModel exModel;
> > >
> > > public ParticipationPage(Experiment ex) {
> > > exModel = new DetachableExperimentModel(ex, exDAO);
> > > add(new ParticipationForm("form"));
> > > exModel.detach();
> > > }
> > >
> > > class ParticipationForm extends Form {
> > >
> > > public ParticipationForm(String id) {
> > > super(id);
> > > List participationList = exModel.getEx
> > > ().getParticipationList();
> > >
> > > ListView subjectListView = new ListView("list",
> > > participationList) {
> > >
> > > private static final long serialVersionUID = 1L;
> > >
> > > /*
> > >  I imagine the correct code should be something like
> > > this...?
> > >  */
> > > public void populateItem(final ListItem item) {
> > > Participation participation =
> > > (Participation)item.getModelObject();
> > > item.add(new Label("name", participation.getUser
> > > ().getName()));
> > > RadioGroup rg = new RadioGroup("choice");
> > > rg.add (new Radio("participated", new Model(
> > > Participation.PARTICIPATED)));
> > > rg.add(new Radio("no show", new Model(
> > > Participation.NO_SHOW)));
> > > rg.add(new Radio("showed", new Model(
> > > Participation.SHOWED)));
> > > item.add(rg);
> > > }
> > > };
> > > subjectListView.setReuseItems (true);
> > > add(subjectListView);
> > > }
> > >
> > > @Override
> > > protected void onSubmit() {
> > >
> > >   /*
> > >* Somehow I have to set each Participation object in the user's
> >
> > > participationList
> > >* to the choice from corresponding the radio group.
> > >*/
> > >
> > > exDAO.persistExperiment(exModel.getEx());
> > > exModel.detach();
> > > }
> > > }
> > > }
> > >
> > > Does anyone know how to do this easily? I imagine it's not difficult,
> > I
> > > just
> > > can't figure it out
> > > from the examples on the web.
> > > Thanks!
> > > -Alex Pine
> > >
> >
>
>


Re: Wicket HTML Simplicity

2007-08-29 Thread Johan Compagner
currently i dont know a html editor/viewer that does that, that
understands wicket inheritance or and this is worse panels (because
panels you also need to parse the java code.. to know that you insert
panel X here...)

On 8/29/07, Carlos Silva <[EMAIL PROTECTED]> wrote:
> FOOTER still leaves me in the same
> situation of having the markup inside it (in this case FOOTER) be
> repeated all over the place if I want that markup to show up when I
> open the page in dreamweaver for example.
>
> On Aug 29, 2007, at 1:12 PM, Johan Karlberg wrote:
>
> > It sounds like you want Markup Inheritance.
> >
> > http://cwiki.apache.org/WICKET/markup-inheritance.html
> >
> > Johan
> >
> > Carlos Silva wrote:
> >> I'm new to wicket and have a very simple question:
> >> Got a usual html template for all my pages:
> >> 
> >>   HEADER
> >>   ... page content ...
> >>   FOOTER
> >> 
> >> Inside my span elements for header and footer I have actual markup
> >> and this allows me to see a full page with headers and footers by
> >> just opening the html in a browser. The markup gets replaced by
> >> wicket once the page is rendered via a web server.
> >> Obviously I don't want to replicate the markup inside my span
> >> elements to all my other 100s of pages but I do want to be able to
> >> open all the other pages in a browser and see the header and footer.
> >> Is this possible perhaps with some wicket tool?
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: DatePicker problem

2007-08-29 Thread Matej Knopp
Might be a bug. Can you please create a jira entry and attach a quick start
project that can be used to reproduce this behaviors?

-Matej

On 8/29/07, fero <[EMAIL PROTECTED]> wrote:
>
>
> Hi, I use DatePicker with DateTextField. Date form the DateTextField is
> bound
> to an object with PropertyModel. I want that user can choose no date. I
> put
> there an AjaxLink which will set null in model object and repaint
> DateTextField. But when I use this link DatePicker doesn't work anymore. I
> opens the calendar but if i choose something it does not appear in the
> DateTextField. What only helps is to go on other page and then come back.
> What i am doing wrong?
>
> Thanks for help
>
> Fero
> --
> View this message in context:
> http://www.nabble.com/DatePicker-problem-tf4350098.html#a12394835
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Johan Compagner
GWT for a webshop? that doesnt look as a right fit to me. Also you
need nice bookmarkable an crawleable urls for a webshop, that is
possible just fine now in wicket (especially the new hybrid url
support in 1.3) but with gwt this is not really possible, a full ajax
webshop is in my eyes a contradiction..

On 8/28/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> It sounds to me like GWT might be a better choice, especially if you
> need Ajax & robust back button support. Wicket is a good choice when
> you need a mixed approach.
>
> I don't think SpringMVC would be a better choice in any way.
>
> Eelco
>
> On 8/28/07, neekibo <[EMAIL PROTECTED]> wrote:
> >
> > Hi all Wicket-users!
> >
> > I am new to web development and so to Wicket. I'm searching for a/the
> > suitable framework for my case.
> >
> > So here a few constrains:
> >  - A webshop with lots of products and categories
> >  - Integration with SpringCore and Hibernate
> >  - Ajax-Magic for a fast responding UI and Drag'n'Drop
> >
> > And a few misgivings:
> >  1.) A component framework is overhead for a webshop (mostly simple
> > db-read-access operations without a state). A request/response-driven
> > framework fits better in this context.
> >  2.) I need standard back and forth browser behaviour. Is this easy to
> > achieve (with ajax in mind) ?
> >  3.) Security: I need to easy code "sign in" and secure the payment
> process
> > (ssl over http is guess)
> >  4.) Performance/Scalability. I know, in general the DB is the bottleneck
> > but ... compared to action-based frameworks. I read somewhere that Wicket
> is
> > much faster that JSF, so this seems good to me.
> >
> > So these are just a few thoughts, I'm a new to this topic, so pardon me if
> > something is wrong. In the moment my alternative is SpringMVC. But the
> > concepts of Wicket appeals to me. Especially the complete lack of JSPs.
> >
> > Thanks in advance
> > Paul
> > --
> > View this message in context:
> http://www.nabble.com/Is-Wicket-a-proper-framework-for-a-Webshop---tf4341788.html#a12368098
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



best practice for a header component with links defined by the page

2007-08-29 Thread Kirk Israel
Hey there--
So I came up with a solution to this, but I suspect it's not very
Wicket-y, so I'd like some suggestions on best practices:

We want a header component that can go on different pages, with 1 2 or
3 links to other pages.
(Well, I guess ideally any #, but with my approach it was easier to
match it to the maximum shown in the spec). Visually, the end result
would be

Back to:  _LINK1_, _LINK2_ or _LINK3_

As far as i can tell, the links and their labels should be created by
the page containing the component. The trouble is, since the HTML and
wicket:id for displaying each link is in the HTML for the component,
the page has to "know" what ID to assign its link  (and it doesn't
seem like you can change the id of a component object after its
created, which would have meant the page could just hand a list of
un-ID'd labeled links in, and the component could have re-IDed them to
match the HTML)

So the component has a static callback getIdPrefixForLink() and
getIdPrefixForLinkLabel(), and the page uses that, and then uses that
string + 0, 1, or 2 for the links its making and handing to the
constructor of the Header component.

So if the Component only gets 1 Labeled Link, it then creates
placeholder objects for the other 2, to make sure the hierarchy as
outlined in the HTML is still ok, and then just hides them.

And there's a tad more logic for the commas and the "or".

So, this all seems really hacky to me. What's a better way? In other
words: Is having to make place holders for everything that ever MIGHT
appear on a page or component, and then making them invisible when you
don't need them, the Wicket way, or is there something more direct?
And/or is there a standard way of letting parent pages or component
make subsubcomponents to be added to a subcomponent (e.g the Page
making PageLinks to be added to the Header component -- incidentally I
can't just pass in a reference to the class, because of what we had to
do to make "lazy loading" links that don't fully instantiate the page
they go to until that link is clicked.)

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



Re: Why AJAX call resets the focus on the component?

2007-08-29 Thread Matej Knopp
just call AjaxRequestTarget.focuscomponent(null), that should prevent wicket
from focusing the element.

On 8/29/07, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
>
> you can call AjaxRequestTarget#focusComponent(Component).
> either you pass the AjaxRequestTarget to the replacing panel and let it
> set
> the focus itself or you can have a method which returns the component that
> should get the focus.
>
> gerolf
>
> On 8/29/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED]>
> wrote:
> >
> > Hi, I am changing a panel inside a page with an ajax link, I
> > change them from one to another panels A B C D etc.
> > Inside each of the panels there is a field (textfield, choicefield, etc,
> > depending on which panel) that must have the focus when loaded.
> >
> > I previously built a behavior that can be added to any component that
> > needs
> > the focus.
> > That behavior function is called perfectly but before the pos-handlers
> for
> > the ajax call end.
> > So what happens is that the ajax functions are putting the focus on the
> > component that had it before the call started, in this case the ajax
> link.
> >
> > And what is happening due to that call is that my component gets the
> > focus,
> > but immediately after gets blur or the focus is taken away from the
> field
> > and back to the link.
> >
> >
> > Is there another way? or a form to avoid refocusing of components in
> ajax
> > calls?
> >
> >
> > f(t)
> >
>


Re: Wicket HTML Simplicity

2007-08-29 Thread Carlos Silva
FOOTER still leaves me in the same  
situation of having the markup inside it (in this case FOOTER) be  
repeated all over the place if I want that markup to show up when I  
open the page in dreamweaver for example.


On Aug 29, 2007, at 1:12 PM, Johan Karlberg wrote:


It sounds like you want Markup Inheritance.

http://cwiki.apache.org/WICKET/markup-inheritance.html

Johan

Carlos Silva wrote:

I'm new to wicket and have a very simple question:
Got a usual html template for all my pages:

  HEADER
  ... page content ...
  FOOTER

Inside my span elements for header and footer I have actual markup  
and this allows me to see a full page with headers and footers by  
just opening the html in a browser. The markup gets replaced by  
wicket once the page is rendered via a web server.
Obviously I don't want to replicate the markup inside my span  
elements to all my other 100s of pages but I do want to be able to  
open all the other pages in a browser and see the header and footer.

Is this possible perhaps with some wicket tool?


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




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



Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Eelco Hillenius
On 8/29/07, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
> >
> > google wicket-bench
> >
> > -igor
> >
>
> i know wicket-bench, have used it for wicket 1.2 actually.
> oh, and i like mark occurences too ;)

And to make it complete, there is supposedly nice support for Netbeans
as well: https://nbwicketsupport.dev.java.net/. It's seen a whole
batch of improvements just weeks ago for the new Netbeans version.

Eelco

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



Re: Why AJAX call resets the focus on the component?

2007-08-29 Thread Gerolf Seitz
you can call AjaxRequestTarget#focusComponent(Component).
either you pass the AjaxRequestTarget to the replacing panel and let it set
the focus itself or you can have a method which returns the component that
should get the focus.

gerolf

On 8/29/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED]>
wrote:
>
> Hi, I am changing a panel inside a page with an ajax link, I
> change them from one to another panels A B C D etc.
> Inside each of the panels there is a field (textfield, choicefield, etc,
> depending on which panel) that must have the focus when loaded.
>
> I previously built a behavior that can be added to any component that
> needs
> the focus.
> That behavior function is called perfectly but before the pos-handlers for
> the ajax call end.
> So what happens is that the ajax functions are putting the focus on the
> component that had it before the call started, in this case the ajax link.
>
> And what is happening due to that call is that my component gets the
> focus,
> but immediately after gets blur or the focus is taken away from the field
> and back to the link.
>
>
> Is there another way? or a form to avoid refocusing of components in ajax
> calls?
>
>
> f(t)
>


DatePicker problem

2007-08-29 Thread fero

Hi, I use DatePicker with DateTextField. Date form the DateTextField is bound
to an object with PropertyModel. I want that user can choose no date. I put
there an AjaxLink which will set null in model object and repaint
DateTextField. But when I use this link DatePicker doesn't work anymore. I
opens the calendar but if i choose something it does not appear in the
DateTextField. What only helps is to go on other page and then come back.
What i am doing wrong?

Thanks for help

Fero
-- 
View this message in context: 
http://www.nabble.com/DatePicker-problem-tf4350098.html#a12394835
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket HTML Simplicity

2007-08-29 Thread Johan Karlberg

It sounds like you want Markup Inheritance.

http://cwiki.apache.org/WICKET/markup-inheritance.html

Johan

Carlos Silva wrote:

I'm new to wicket and have a very simple question:

Got a usual html template for all my pages:


  HEADER
  ... page content ...
  FOOTER


Inside my span elements for header and footer I have actual markup and 
this allows me to see a full page with headers and footers by just 
opening the html in a browser. The markup gets replaced by wicket once 
the page is rendered via a web server.


Obviously I don't want to replicate the markup inside my span elements 
to all my other 100s of pages but I do want to be able to open all the 
other pages in a browser and see the header and footer.


Is this possible perhaps with some wicket tool?




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



wantOnSelectionChangedNotifications causing table redraw

2007-08-29 Thread salmas

I have a DataTable in which I have a panel which contains a textfield and a
radiogroup. When the user changes the selection in the radiogroup I'd like
to populate a value in the textfield. I subclassesed RadioGroup to catch the
selectionChangedEvent

RadioGroup choice = new RadioGroup(workflowFrame_radioPanel_radioGroup,new
Model()){
protected void onSelectionChanged(java.lang.Object newSelection) {
//Figure out what is selected and set value in textfield
}

 protected boolean wantOnSelectionChangedNotifications() { 
   return true; 
} 
};

As soon as I override the wantOnSelectionChangedNotifications method I get
the notifications but the table is redrawn as soon as the user selects an
option in the radiogroup while if I do not override this method the UI does
not do this ugly redraw when the user toggles the selection in the
radiogroup. I am using AJAX to redraw my table in other instances so that
the table redraw is smooth. Is there any way I can catch the selection
changed event and have the table not redraw? I can redraw it myself with an
AJAX target after I set the value in the textfield.

-- 
View this message in context: 
http://www.nabble.com/wantOnSelectionChangedNotifications-causing-table-redraw-tf4350095.html#a12394832
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Why AJAX call resets the focus on the component?

2007-08-29 Thread Francisco Diaz Trepat - gmail
Hi, I am changing a panel inside a page with an ajax link, I
change them from one to another panels A B C D etc.
Inside each of the panels there is a field (textfield, choicefield, etc,
depending on which panel) that must have the focus when loaded.

I previously built a behavior that can be added to any component that needs
the focus.
That behavior function is called perfectly but before the pos-handlers for
the ajax call end.
So what happens is that the ajax functions are putting the focus on the
component that had it before the call started, in this case the ajax link.

And what is happening due to that call is that my component gets the focus,
but immediately after gets blur or the focus is taken away from the field
and back to the link.


Is there another way? or a form to avoid refocusing of components in ajax
calls?


f(t)


Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Gerolf Seitz
>
> google wicket-bench
>
> -igor
>

i know wicket-bench, have used it for wicket 1.2 actually.
oh, and i like mark occurences too ;)


Wicket HTML Simplicity

2007-08-29 Thread Carlos Silva

I'm new to wicket and have a very simple question:

Got a usual html template for all my pages:


  HEADER
  ... page content ...
  FOOTER


Inside my span elements for header and footer I have actual markup  
and this allows me to see a full page with headers and footers by  
just opening the html in a browser. The markup gets replaced by  
wicket once the page is rendered via a web server.


Obviously I don't want to replicate the markup inside my span  
elements to all my other 100s of pages but I do want to be able to  
open all the other pages in a browser and see the header and footer.


Is this possible perhaps with some wicket tool?



Re: RadioChoice and ListView

2007-08-29 Thread Alex Pine
Thank you for the quick reply, but this fix doesn't seem to work. The
selections are never persisted on form submit. Any ideas?

On 8/29/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>
> problem is here
>
> RadioGroup rg = new RadioGroup("choice");
>
> you are not setting the model for the radiogroup choice so your choices go
> no where
>
> RadioGroup rg = new RadioGroup("choice", new PropertyModel(item.getModel
> (),
> "status"));
>
> or leave it as it is and use PropertyListView instead
>
> -igor
>
>
> On 8/29/07, Alex Pine <[EMAIL PROTECTED]> wrote:
> >
> > Hi all,
> > I'm trying to use a Radio Choice component inside a Listview so that
> each
> > list
> > item has one RadioGroup with three choices. When the form submit button
> is
> > pressed,
> > each selected choice should set a field in the model object of each list
> > item.
> > The code below should explain the problem more fully:
> >
> >
> > /*
> > The ultimate goal is to set the "status" field in each Participation
> > object
> > in the participationList of the object below.
> > */
> > public class Experiment {
> >
> >   private String name;
> >
> >   private List participationList;
> >
> >   /* Other fields, constructors, getters, setters, etc */
> >
> > }
> >
> >
> > public class Participation {
> >
> > public static final int PARTICIPATED = 1;
> > public static final int NO_SHOW = -1;
> > public static final int SHOWED = 0;
> >
> > private User user;
> >
> > private int status;
> >
> > public Participation() {
> > status = SHOWED; // Default value
> > }
> >
> > /* getters, setters, etc */
> > }
> >
> >
> > /* This is the web page that is supposed to do the setting*/
> > public class ParticipationPage extends BasePage {
> >
> > private static final long serialVersionUID = 1L;
> >
> > @SpringBean
> > private ExperimentDAO exDAO;
> >
> > private DetachableExperimentModel exModel;
> >
> > public ParticipationPage(Experiment ex) {
> > exModel = new DetachableExperimentModel(ex, exDAO);
> > add(new ParticipationForm("form"));
> > exModel.detach();
> > }
> >
> > class ParticipationForm extends Form {
> >
> > public ParticipationForm(String id) {
> > super(id);
> > List participationList = exModel.getEx
> > ().getParticipationList();
> >
> > ListView subjectListView = new ListView("list",
> > participationList) {
> >
> > private static final long serialVersionUID = 1L;
> >
> > /*
> >  I imagine the correct code should be something like
> > this...?
> >  */
> > public void populateItem(final ListItem item) {
> > Participation participation =
> > (Participation)item.getModelObject();
> > item.add(new Label("name", participation.getUser
> > ().getName()));
> > RadioGroup rg = new RadioGroup("choice");
> > rg.add(new Radio("participated", new Model(
> > Participation.PARTICIPATED)));
> > rg.add(new Radio("no show", new Model(
> > Participation.NO_SHOW)));
> > rg.add(new Radio("showed", new Model(
> > Participation.SHOWED)));
> > item.add(rg);
> > }
> > };
> > subjectListView.setReuseItems(true);
> > add(subjectListView);
> > }
> >
> > @Override
> > protected void onSubmit() {
> >
> >   /*
> >* Somehow I have to set each Participation object in the user's
> > participationList
> >* to the choice from corresponding the radio group.
> >*/
> >
> > exDAO.persistExperiment(exModel.getEx());
> > exModel.detach();
> > }
> > }
> > }
> >
> > Does anyone know how to do this easily? I imagine it's not difficult, I
> > just
> > can't figure it out
> > from the examples on the web.
> > Thanks!
> > -Alex Pine
> >
>


Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Igor Vaynberg
google wicket-bench

-igor


On 8/29/07, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
>
> >
> > ..., how many component libraries and tools there
> > are for them (regardless of the fact the quality of them and whether
> > that is a good thing in the first place), ...
> >
>
> that's what i like about wicket, you practically don't need additional
> tools
> (which you have to learn to use, learn to avoid any drawbacks or known
> issues of the tool etc...). everything you know about your ide, you can
> use
> to develop with wicket. productivity++ ;)
>
> having said that, i like the feature list of wicketforge (
> http://code.google.com/p/wicketforge/) as it seems that . but as i'm on
> the
> eclipse side of the world, ...
>
>   gerolf
>


Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Gerolf Seitz
>
> ..., how many component libraries and tools there
> are for them (regardless of the fact the quality of them and whether
> that is a good thing in the first place), ...
>

that's what i like about wicket, you practically don't need additional tools
(which you have to learn to use, learn to avoid any drawbacks or known
issues of the tool etc...). everything you know about your ide, you can use
to develop with wicket. productivity++ ;)

having said that, i like the feature list of wicketforge (
http://code.google.com/p/wicketforge/) as it seems that . but as i'm on the
eclipse side of the world, ...

  gerolf


Re: Updating Panels with AjaxLazyLoadingPanel

2007-08-29 Thread Gerolf Seitz
my understanding is that AjaxLazyLoadingPanel is most useful when you have a
component that is very costly on the serverside (e.g. loading a big pile of
data from the database or doing some crazy calculations, ...). so instead of
having to wait for that single component to finish processing, you add the
lightweight AjaxLazyLoadingPanel to the page. as soon as the page is
rendered, the ALLP lazily loads the heavyweight component via ajax.
this obviously leads to faster inital page loading.

although you could also load an ALLP via ajax (which in turn loads the
heavyweight component), but that needs an additional ajax-roundtrip. but
there could still be a valid usecase for that...

so basically, if you just want to load a component via ajax and want the
little wheel, you could take a look at
(AjaxIndicating)[Fallback](Link|Button) which automatically render the
little wheel during an ajax request.

puh, enough for now ;)
please let me know if i got something wrong...

hth,
  gerolf

On 8/29/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED]>
wrote:
>
> Hi list, I have a simple site with a menu on the left and a content in the
> center that needs some wicket magic. ;-)
>
> Instead of reloading the page from menu link to menu link, I would like to
> have AjaxLinks and a kind of AjaxLazyLoadingPanel that could change by
> each
> click without reloading all pages.
>
> Thankfully one big part is done. All pages basically creates a new panel
> instance that holds its contents, so I already have every panel developed.
> I
> just need to load them into the main page by ajax means and if it is
> possible, have the little wheel from the AjaxLazyLoadingPanel.
>
>
> f(t)
>


Re: Hibernate/Spring transaction problem

2007-08-29 Thread fero

I dont know anything about Spring Hibernate template. But I use a class
HibernateUtil from book Manning: Hibernate in Action (or Java perzistnce
with Hibernate, it is a 2nd edition of first book) and it works super. I
have only one SessionFactory in JVM, and only one Session and Transaction in
every  thread. U can look for it. 

Fero


pokkie wrote:
> 
> Hey Vincenzo , 
> 
> thanks for your response. have tried it, but still having the problem.
> will have a look again
> 
> 
> Vincenzo Vitale wrote:
>> 
>> Have you the same problem using directly the Hibernate session?
>> 
>> It's also interesting to read this article about the Hibernate template:
>> 
>> http://blog.interface21.com/main/2007/06/26/so-should-you-still-use-springs-hibernatetemplate-andor-jpatemplate/
>> 
>> I remember I had in the past similar porblems with the hibernate
>> template...  actually I didn't understand the problems I was
>> experiencing but after having red the article I tried to use directly
>> the session and it worked.
>> 
>> My code now looks in this way:
>> 
>> public Account saveOrUpdate(Account account) {
>> account.setDateModified(new Date());
>> getSession().saveOrUpdate(account);
>> 
>> //Maybe flush and refresh can be avoided...
>> getSession().flush();
>> getSession().refresh(account);
>> return (Account) account;
>> }
>> 
>> Hope this helps.
>> 
>> 
>> Ciao,
>> V.
>> 
>> 
>> On 8/29/07, pokkie <[EMAIL PROTECTED]> wrote:
>>>
>>> i have a button on a form, when clicked it saves a object to the
>>> database
>>> (via Spring's HibernateTemplate),
>>> but for some reason when i look in the db it is not there, until i go to
>>> another page, then suddenly the object is being written into the
>>> database.
>>>
>>> i am presuming that the session is not being flushed, until i go to
>>> another
>>> page, so i added a flush
>>> to my save method, but still experience the same behaviour.
>>>
>>> either the session or i am thinking that it might be running in a long
>>> running transaction,
>>> which only ends once a new request is coming in, and subsequently write
>>> the
>>> data to the database.
>>>
>>> any thoughts?
>>>
>>>  -- pokkie
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Hibernate-Spring-transaction-problem-tf4347663.html#a12386692
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>> 
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Hibernate-Spring-transaction-problem-tf4347663.html#a12392329
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Eelco Hillenius
> I the time we've been working on Wicket, and especially in the
> beginning, about 80% of the discussions outside the lists about Wicket
> and other non-standard technologies are always lead back to the same
> lousy short sighted arguments. Take for instance

Hmmm... I didn't quite finish that sentence. Basically, I mean
arguments like how many hits on job search sites it has, whether it is
backed by big vendors, how many component libraries and tools there
are for them (regardless of the fact the quality of them and whether
that is a good thing in the first place), etc. Arguments that may have
some merit in them, but I hate to see those managerial arguments
prevail in technical discussions so often.

Eelco

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



Re: Presentation and application logic separation

2007-08-29 Thread fero

Thanks Gabor. I had the same idea. I'll try it soon and leave here a message
how it works. Btw I think many people would appreciate an article about
wicket application architecture.

Fero


Gabor Szokoli wrote:
> 
> On 8/28/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>> well, what wicket does is version the state if you keep it inside its
>> model,
>> so it all Just Works. But because you are keeping your state outside of
>> wicket you have to build your own versioning mechanism, or remove your
>> state
>> machine and use wicket.
> 
> Assuming the SM state is not too big,  you could keep it in your base
> page object.
> Then it would get replicated along with the page in the cache, wouldn't
> it?
> Make sure it is serialisable.
> Or to get bookmarkable pages, keep it in the PageParameters.
> 
> Except for the variables which truly belong to the session, like
> logged in user, of course.
> 
> More experienced people please correct me if I'm wrong.
> 
> 
> Gabor
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Presentation-and-application-logic-separation-tf4341077.html#a12392226
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Hibernate/Spring transaction problem

2007-08-29 Thread pokkie

Hey Vincenzo , 

thanks for your response. have tried it, but still having the problem. will
have a look again


Vincenzo Vitale wrote:
> 
> Have you the same problem using directly the Hibernate session?
> 
> It's also interesting to read this article about the Hibernate template:
> 
> http://blog.interface21.com/main/2007/06/26/so-should-you-still-use-springs-hibernatetemplate-andor-jpatemplate/
> 
> I remember I had in the past similar porblems with the hibernate
> template...  actually I didn't understand the problems I was
> experiencing but after having red the article I tried to use directly
> the session and it worked.
> 
> My code now looks in this way:
> 
> public Account saveOrUpdate(Account account) {
> account.setDateModified(new Date());
> getSession().saveOrUpdate(account);
> 
> //Maybe flush and refresh can be avoided...
> getSession().flush();
> getSession().refresh(account);
> return (Account) account;
> }
> 
> Hope this helps.
> 
> 
> Ciao,
> V.
> 
> 
> On 8/29/07, pokkie <[EMAIL PROTECTED]> wrote:
>>
>> i have a button on a form, when clicked it saves a object to the database
>> (via Spring's HibernateTemplate),
>> but for some reason when i look in the db it is not there, until i go to
>> another page, then suddenly the object is being written into the
>> database.
>>
>> i am presuming that the session is not being flushed, until i go to
>> another
>> page, so i added a flush
>> to my save method, but still experience the same behaviour.
>>
>> either the session or i am thinking that it might be running in a long
>> running transaction,
>> which only ends once a new request is coming in, and subsequently write
>> the
>> data to the database.
>>
>> any thoughts?
>>
>>  -- pokkie
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Hibernate-Spring-transaction-problem-tf4347663.html#a12386692
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Hibernate-Spring-transaction-problem-tf4347663.html#a12391502
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Eelco Hillenius
On 8/29/07, William Hoover <[EMAIL PROTECTED]> wrote:
> Could you elaborate on what is lacking in Wicket when referring to the back 
> button support (when compared to GWT)? I was under the impression that Wicket 
> had robust back button support?

Wicket's back button support is pretty robust for normal (non-ajax)
requests. The problem we have with the Ajax back button comes down to
the fact that we have to synchronize client with server state in such
a fashion that it also keeps working with normal requests. GWT is all
client side and thus doesn't have that problem. It's *Ajax* back
button support is better, though it's not very automatic from what
I've seen, and I wonder how it survives leaving a single page
approach.

We haven't given up on better Ajax back button support for Wicket
though. See https://issues.apache.org/jira/browse/WICKET-271.
Contributions are welcome as always.

Regards,

Eelco

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



Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Nathan Hamblen

Xavier Hanin wrote:

Note that databinder can be used with Spring too. It's useful for exposing
your hibernate beans as wicket models.


The beginning of this thread is not on gmane for some reason. But, yeah 
actually I've done a few web stores with Databinder. As always I find 
Wicket to be helpful no matter how simple the front end is, but where it 
really pays off is on the administration side. You can pile on the 
functionality without the code becoming a nightmare, and reusing 
components is even easier when no one is obsessing over appearance. Even 
on the front end, checkout is a multistep process that I would hate to 
code without managed state.


Nathan


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



Re: RadioChoice and ListView

2007-08-29 Thread Igor Vaynberg
problem is here

RadioGroup rg = new RadioGroup("choice");

you are not setting the model for the radiogroup choice so your choices go
no where

RadioGroup rg = new RadioGroup("choice", new PropertyModel(item.getModel(),
"status"));

or leave it as it is and use PropertyListView instead

-igor


On 8/29/07, Alex Pine <[EMAIL PROTECTED]> wrote:
>
> Hi all,
> I'm trying to use a Radio Choice component inside a Listview so that each
> list
> item has one RadioGroup with three choices. When the form submit button is
> pressed,
> each selected choice should set a field in the model object of each list
> item.
> The code below should explain the problem more fully:
>
>
> /*
> The ultimate goal is to set the "status" field in each Participation
> object
> in the participationList of the object below.
> */
> public class Experiment {
>
>   private String name;
>
>   private List participationList;
>
>   /* Other fields, constructors, getters, setters, etc */
>
> }
>
>
> public class Participation {
>
> public static final int PARTICIPATED = 1;
> public static final int NO_SHOW = -1;
> public static final int SHOWED = 0;
>
> private User user;
>
> private int status;
>
> public Participation() {
> status = SHOWED; // Default value
> }
>
> /* getters, setters, etc */
> }
>
>
> /* This is the web page that is supposed to do the setting*/
> public class ParticipationPage extends BasePage {
>
> private static final long serialVersionUID = 1L;
>
> @SpringBean
> private ExperimentDAO exDAO;
>
> private DetachableExperimentModel exModel;
>
> public ParticipationPage(Experiment ex) {
> exModel = new DetachableExperimentModel(ex, exDAO);
> add(new ParticipationForm("form"));
> exModel.detach();
> }
>
> class ParticipationForm extends Form {
>
> public ParticipationForm(String id) {
> super(id);
> List participationList = exModel.getEx
> ().getParticipationList();
>
> ListView subjectListView = new ListView("list",
> participationList) {
>
> private static final long serialVersionUID = 1L;
>
> /*
>  I imagine the correct code should be something like
> this...?
>  */
> public void populateItem(final ListItem item) {
> Participation participation =
> (Participation)item.getModelObject();
> item.add(new Label("name", participation.getUser
> ().getName()));
> RadioGroup rg = new RadioGroup("choice");
> rg.add(new Radio("participated", new Model(
> Participation.PARTICIPATED)));
> rg.add(new Radio("no show", new Model(
> Participation.NO_SHOW)));
> rg.add(new Radio("showed", new Model(
> Participation.SHOWED)));
> item.add(rg);
> }
> };
> subjectListView.setReuseItems(true);
> add(subjectListView);
> }
>
> @Override
> protected void onSubmit() {
>
>   /*
>* Somehow I have to set each Participation object in the user's
> participationList
>* to the choice from corresponding the radio group.
>*/
>
> exDAO.persistExperiment(exModel.getEx());
> exModel.detach();
> }
> }
> }
>
> Does anyone know how to do this easily? I imagine it's not difficult, I
> just
> can't figure it out
> from the examples on the web.
> Thanks!
> -Alex Pine
>


Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Eelco Hillenius
> It could also mean their unwillingness to commit their time and
> money on education. Do not rush with this kinds of claims. Everyone
> has their reasons - not everyone is lazy. If you have good enough
> reasons to make them move to Wicket they will probably do so.
> Otherwise, blame yourself for your inability to influence.

I think you are the one rushing to a conclusion here. Or do you know his team?

I the time we've been working on Wicket, and especially in the
beginning, about 80% of the discussions outside the lists about Wicket
and other non-standard technologies are always lead back to the same
lousy short sighted arguments. Take for instance

> Component based frameworks are not obvious. While a reasonable
> developer of decent experience could pick up Struts 1/2 and be
> efficient with it in a couple of hours. I would definitely drop Struts 1,
> and stick with Struts 2 as that is a different kind of animal.

Whether component based frameworks are obvious or not largely depends
on where you're coming from. Don't think Struts is obvious to many
people, even if you can learn it in a few hours.

> I am not quite sure why Eelco is being so pushy on claiming no OOP is
> done there

Well, sorry for having an opinion. Model 2 frameworks encourage
procedural programming. I'll repeat that a thousand times if you like.
'Actions' are not stateful, and their abstraction level matches the
request/ response cycle, not anything more granular. If you're coding
with model 2 frameworks, you are basically receiving a request,
interpreting the parameters sent with that request, preparing the data
for use in the view - which you in fact do globally for that template!
- and finally requesting the framework to render a template. Now in
contrast, applying OOP means that you can create abstractions that
combine data (stateful) and behavior (scoped on the class, not the
request/ response cycle) and that you can properly apply data hiding
(link A doesn't have to have knowledge of link B/ rest of the page to
function).

> but I would really stay away from his opnions unless
> they are somehow Wicket directed :-)

Wow. I'd really like you to elaborate on that.

Eelco

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



RadioChoice and ListView

2007-08-29 Thread Alex Pine
Hi all,
I'm trying to use a Radio Choice component inside a Listview so that each
list
item has one RadioGroup with three choices. When the form submit button is
pressed,
each selected choice should set a field in the model object of each list
item.
The code below should explain the problem more fully:


/*
The ultimate goal is to set the "status" field in each Participation object
in the participationList of the object below.
 */
public class Experiment {

  private String name;

  private List participationList;

  /* Other fields, constructors, getters, setters, etc */

}


public class Participation {

public static final int PARTICIPATED = 1;
public static final int NO_SHOW = -1;
public static final int SHOWED = 0;

private User user;

private int status;

public Participation() {
status = SHOWED; // Default value
}

/* getters, setters, etc */
}


/* This is the web page that is supposed to do the setting*/
public class ParticipationPage extends BasePage {

private static final long serialVersionUID = 1L;

@SpringBean
private ExperimentDAO exDAO;

private DetachableExperimentModel exModel;

public ParticipationPage(Experiment ex) {
exModel = new DetachableExperimentModel(ex, exDAO);
add(new ParticipationForm("form"));
exModel.detach();
}

class ParticipationForm extends Form {

public ParticipationForm(String id) {
super(id);
List participationList = exModel.getEx
().getParticipationList();

ListView subjectListView = new ListView("list",
participationList) {

private static final long serialVersionUID = 1L;

/*
 I imagine the correct code should be something like
this...?
 */
public void populateItem(final ListItem item) {
Participation participation =
(Participation)item.getModelObject();
item.add(new Label("name", participation.getUser
().getName()));
RadioGroup rg = new RadioGroup("choice");
rg.add(new Radio("participated", new Model(
Participation.PARTICIPATED)));
rg.add(new Radio("no show", new Model(
Participation.NO_SHOW)));
rg.add(new Radio("showed", new Model(
Participation.SHOWED)));
item.add(rg);
}
};
subjectListView.setReuseItems(true);
add(subjectListView);
}

@Override
protected void onSubmit() {

  /*
   * Somehow I have to set each Participation object in the user's
participationList
   * to the choice from corresponding the radio group.
   */

exDAO.persistExperiment(exModel.getEx());
exModel.detach();
}
}
}

Does anyone know how to do this easily? I imagine it's not difficult, I just
can't figure it out
from the examples on the web.
Thanks!
-Alex Pine


Updating Panels with AjaxLazyLoadingPanel

2007-08-29 Thread Francisco Diaz Trepat - gmail
Hi list, I have a simple site with a menu on the left and a content in the
center that needs some wicket magic. ;-)

Instead of reloading the page from menu link to menu link, I would like to
have AjaxLinks and a kind of AjaxLazyLoadingPanel that could change by each
click without reloading all pages.

Thankfully one big part is done. All pages basically creates a new panel
instance that holds its contents, so I already have every panel developed. I
just need to load them into the main page by ajax means and if it is
possible, have the little wheel from the AjaxLazyLoadingPanel.


f(t)


Re: MarkupCache Issue

2007-08-29 Thread Igor Vaynberg
wicket caches markup, that is needed. so what you should do is add a
component in your basepage that outputs the base tag.

-igor


On 8/29/07, Kumarasun Nadar1 <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> In our aplication we are using a filter to populate the HTML  tag
> with the base URL.
> But since the markupcache caches the page markup the base tag is getting
> populated incorrectly for 2 different users using different hostnames.
>
> Is there a way wherein we can tell wicket not to cache the base tag and
> populate it for each request.
>
>
> Thanks
> kumar
>


MarkupCache Issue

2007-08-29 Thread Kumarasun Nadar1
Hi All,

In our aplication we are using a filter to populate the HTML  tag 
with the base URL.
But since the markupcache caches the page markup the base tag is getting 
populated incorrectly for 2 different users using different hostnames.

Is there a way wherein we can tell wicket not to cache the base tag and 
populate it for each request.


Thanks
kumar


Ajax operations on Panels nested in Fragments

2007-08-29 Thread Oli Evans
I just lost a few hours on a problem where an ajax operation on a Panel 
nested in a Fragment was failing as my nested panel could not find its 
associated markup. It seems this was because a Fragment will only 
reliably find its markup if you explicitly provide it with the Component 
that contains its markup in the Fragment constructor.


If you don't, Fragment.getAssociatedMarkupStream() will find its 
markupProvider field is null, and so have to take a guess at where its 
markup might be. If your fragment usage happens to be as a direct child 
of the component that defines the fragment markup then it will all work 
out, but if you have nested it in something like a ListView then it will 
fail.


...So watch out kids, if you use fragments, use a constructor that tells 
it where its markup is. Would you like to have to guess who your real 
parents are? I think not.


Oli

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



Re: 1.3 beta2 -> beta3 = NullPointerException

2007-08-29 Thread Matej Knopp
Hi, could you please create a jira issue and attach a quickstart project
that can be used to reproduce this? Thanks. I'll look at it ASAP.

-Matej

On 8/29/07, Stojce Dimski <[EMAIL PROTECTED]> wrote:
>
> I have a simple app embedded in my jetty (no web.xml, I wire-up the
> components) with:
> - Application (extends SpringWebApplication)
> - 3 Pages (extends WebPage) 2 without instance variables and one with
> one non serializable @SpringBean injected variable
> - Session (extends WebSession) which contains above mentioned
> @SpringBean as instance variable
>
> with beta2 it worked, but today I updated it to beta3 and I get
> following error, can some kind shed some light ?
>
> WARN [org.mortbay.log] - failed
> org.apache.wicket.protocol.http.WicketServlet-2080726
> javax.servlet.ServletException: java.lang.NullPointerException
>   at
> org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java
> :437)
>   at
> org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
>   at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>   at
> org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java
> :612)
>   at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
>   at
> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
>   at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>   at
> org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
>   at org.mortbay.jetty.Server.doStart(Server.java:217)
>   at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>   at ...
> Caused by: java.lang.NullPointerException
>   at
> org.apache.wicket.protocol.http.pagestore.DiskPageStore.(
> DiskPageStore.java:486)
>   at
> org.apache.wicket.protocol.http.pagestore.DiskPageStore.(
> DiskPageStore.java:512)
>   at
> org.apache.wicket.protocol.http.pagestore.DiskPageStore.(
> DiskPageStore.java:521)
>   at
> org.apache.wicket.protocol.http.WebApplication.newSessionStore(
> WebApplication.java:563)
>   at org.apache.wicket.Application.internalInit(Application.java:953)
>   at
> org.apache.wicket.protocol.http.WebApplication.internalInit(
> WebApplication.java:475)
>   at
> org.apache.wicket.spring.SpringWebApplication.internalInit(
> SpringWebApplication.java:68)
>   at
> org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:414)
>   at
> org.apache.wicket.protocol.http.WicketServlet.init(WicketServlet.java:153)
>   at javax.servlet.GenericServlet.init(GenericServlet.java:241)
>   at
> org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java
> :433)
>   ... 10 more
>
>
>
>   ___
> L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail:
> http://it.docs.yahoo.com/nowyoucan.html
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: DataTable with DropDownChoice to set rowsPerPage

2007-08-29 Thread janders

Ok, got it working, thanks to igor.  Here is the code for Wicket version
1.2.3 that dynamically updates the rowsPerPage for a given DataTable:

List rows = Arrays.asList(new String[] {"5", "10", "15", "20"});

add(new DropDownChoice("rows", new IModel() {
public void setObject(Component component, Object e) {
Integer rows = Integer.parseInt((String) e);
contacts.setRowsPerPage(rows);
} 
public Object getObject(Component component) {return
contacts.getRowsPerPage();} 
public void detach(){}
public IModel getNestedModel() {return null;}
}, rows) {
@Override
protected boolean wantOnSelectionChangedNotifications() {
return true;
}
}); 


janders wrote:
> 
> Thank you, I will review the models page on the wiki.  If I can figure out
> a working solution I will post it here.  
> 
> This certainly seems like a good candidate for a DataTable Toolbar so that
> developers can easily add a dropdown to allow users to change the number
> of rows displayed.
> 
> - JA
> 
> 
> 
> igor.vaynberg wrote:
>> 
>> On 8/27/07, janders <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>> I understand, but being a newbie, this makes little sense.  Where is
>>> wantOnSelectionChangedNotifications()
>>> and onSelectionChanged().  Aren't these require?
>> 
>> 
>> only if you want the selection updated right after selecting a new value
>> in
>> the dropdown
>> 
>> How does the selection
>>> value get passed to rowsPerPage?  Can you point me to a working example?
>> 
>> 
>> im afraid i dont know of any cases that do this exact thing. what i have
>> shown you should work, i suggest you read the models page on the wiki.
>> 
>> -igor
>> 
>> 
>> 
>> BTW, I'm currently using Wicket 1.2.3.
>>>
>>>
>>>
>>> igor.vaynberg wrote:
>>> >
>>> > heh, you have to meet us half way here. you cant expect to be able to
>>> > paste
>>> > pseudocode into the ide and have it compile and work.
>>> >
>>> > the int[] param is intended to be the third constructor param of
>>> > dropdownchoice not the second param of add().
>>> >
>>> > if you are using an older wicket ver - 1.2 then imodel has an extra
>>> > component param which you can ignore
>>> >
>>> > my point is: look at what the example is trying to do.
>>> >
>>> > -igor
>>> >
>>> >
>>> > On 8/27/07, janders <[EMAIL PROTECTED]> wrote:
>>> >>
>>> >>
>>> >> I'm new to wicket and I fail to see how the proposed solution
>>> >> works.  Coping
>>> >> this into the IDE, and even after correcting for caps, there are
>>> several
>>> >> errors.  For one, add takes a component, not a component plus int[].
>>> >> Also
>>> >> IModel wanted to implement unimplemented methods. What I'm I missing?
>>> >>
>>> >>
>>> >>
>>> >> igor.vaynberg wrote:
>>> >> >
>>> >> > class mypage() {
>>> >> >   static int[] pages=new int[] {10,15,20,25};
>>> >> >
>>> >> >   public mypage () {
>>> >> > final DataTable dt=new datatable(..);
>>> >> >
>>> >> >add(new dropdownchoice("pages", new imodel() {
>>> >> >void setObject(Object e) { dt.setrowsperpage((Integer)e); }
>>> >> >Object getObject() { return td.getrowsperpage(); }
>>> >> >void detach() {}), pages);
>>> >> > }
>>> >> >
>>> >> > -igor
>>> >> >
>>> >> >
>>> >> > On 8/26/07, janders <[EMAIL PROTECTED]> wrote:
>>> >> >>
>>> >> >>
>>> >> >> The format of the Exception got munged with the example code. This
>>> >> should
>>> >> >> read as:
>>> >> >>
>>> >> >> IllegalStateException: Attempt to set model object on null model
>>> of
>>> >> >> component: rows
>>> >> >>
>>> >> >> final DataTable contacts = NEWDataTable("contacts", columns,
>>> >> >> contactProvider, rowsPerPage) {
>>> >> >> @Override
>>> >> >> PROTECTEDItem newRowItem(String id, INTindex, IModel model) {
>>> >> >> RETURNNEWOddEvenItem(id, index, model);
>>> >> >> }
>>> >> >> };
>>> >> >>
>>> >> >>
>>> >> >> janders wrote:
>>> >> >> >
>>> >> >> > I would like to be able to add a dropdown to a DataTable so that
>>> a
>>> >> user
>>> >> >> > can change the rowsPerPage.  Has anyone done this before?  If
>>> not,
>>> >> what
>>> >> >> is
>>> >> >> > the best / recommended approach?
>>> >> >> > I tried the following, but I get:
>>> >> >> >
>>> >> >> > IllegalStateException: Attempt to set model object on null model
>>> of
>>> >> >> > component: rowsFINALDataTable contacts =
>>> NEWDataTable("contacts",
>>> >> >> columns,
>>> >> >> > contactProvider, rowsPerPage) {
>>> >> >> > @Override
>>> >> >> > PROTECTEDItem newRowItem(String id, INTindex, IModel model)
>>> {
>>> >> >> > RETURNNEWOddEvenItem(id, index, model);
>>> >> >> > }
>>> >> >> > };
>>> >> >> >
>>> >> >> > List rows = Arrays._asList_(NEWString[] {"5", "10", "15", "20",
>>> >> >> "all"});
>>> >> >> > add(NEWDropDownChoice("rows", rows) {
>>> >> >> > @Override
>>> >> >> > PROTECTEDBOOLEANwantOnSelectionChangedNotifications() {
>>> >> >> 

Re: where can i find wicket jasperreport integration project?

2007-08-29 Thread Evan Chooly
Let me know if you have any questions about that.  I haven't used JR in a
while so I haven't updated that project.  If you run into issues, I can take
a look, though.

On 8/28/07, aozster <[EMAIL PROTECTED]> wrote:
>
>
> Thank you , igor.
>
> igor.vaynberg wrote:
> >
> >
> http://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicket-contrib-jasperreports/
> >
> > -igor
> >
> >
> > On 8/28/07, aozster <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >> I'm looking for wikcet-contrib-jasperreport but I can't find it. Is
> this
> >> project discontinued? where can I get the jar file?
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/where-can-i-find-wicket-jasperreport-integration-project--tf4345301.html#a12379635
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/where-can-i-find-wicket-jasperreport-integration-project--tf4345301.html#a12380338
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Regression in 1.3.0-beta3(?)

2007-08-29 Thread Igor Vaynberg
hmm, if you could create a quickstart for this it would be very helpful.

-igor


On 8/29/07, Johannes Schneider <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I just updated to the latest beta release. But now I get the following
> exception. Everything worked with beta2. Any ideas?
>
>
> Regards,
>
> Johannes Schneider
>
>
> org.apache.wicket.markup.MarkupException: Expected close tag for  wicket:id="column1">
> [markup =
>
> file:/home/johannes/projects/eu/cedarsoft/wicket/yaml-integration/target/classes/eu/cedarsoft/wicket/yaml/test/TestYamlPage.html
>   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml";
> xmlns:wicket="http://wicket.apache.org";>
> 
>*** UNKNOWN TITLE 
>
>
> wicket:id="baseStyleSheet"/>
> href="css/layout/col1_col3_col2_25_x_25.css"
> wicket:id="layoutStyleSheet"/>
>
>
> 
>   wicket:id="basemodStyleSheet"/>
>   wicket:id="contentStyleSheet"/>
>
>
> 
> 
>
>  
>
>  
>  Skip to
> the navigation.
>  Skip to the
> content.
>  
>  #topnav is here
>
>
>  
>
>  
>  
>
>  
>
>
>   wicket:id="col1Content">
>
>
>
>   wicket:id="col2Content">
>
>
>
>  
>
>  
>
>
>
>
>
>  
>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed
> diam nonummy nibh euismod tincidunt ut laoreet dolore
>magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis
> nostrud exerci tation ullamcorper suscipit lobortis
>nisl ut aliquip ex ea commodo consequat. Duis autem vel eum
> iriure dolor in hendrerit in vulputate velit esse molestie
>  
>  
>consequat, vel illum dolore eu feugiat nulla facilisis at vero et
> accumsan et iusto odio dignissim qui blandit
>praesent luptatum zzril delenit augue duis dolore te feugait
> nulla facilisi. Lorem ipsum dolor sit amet, consectetuer
>adipiscing elit, sed diam nonummy nibh euismod tincidunt ut
> laoreet dolore magna aliquam erat volutpat. Ut wisi enim
>ad minim veniam, quis nostrud exerci tation ullamcorper suscipit
> lobortis nisl ut aliquip ex ea commodo consequat.
>Duis autem vel eum iriure dolor in hendrerit in vulputate velit
> esse molestie consequat, vel illum dolore eu feugiat
>nulla facilisis at vero et accumsan et iusto odio dignissim qui
> blandit praesent luptatum zzril delenit augue duis
>dolore te feugait nulla facilisi. Nam liber tempor cum soluta
> nobis eleifend option congue nihil imperdiet doming id
>quod mazim placerat facer possim assum.
>  
>
>
> 
>
>  
>   
>
>  
>
>  The Fter
>
> 
> 
> 
> , index = 51, current = '' (line 30, column 3)]
> at
> org.apache.wicket.markup.MarkupStream.throwMarkupException(
> MarkupStream.java:472)
> at
> org.apache.wicket.Component.renderClosingComponentTag(Component.java:3748)
> at org.apache.wicket.Component.renderComponent(Component.java
> :2197)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java
> :1315)
> at org.apache.wicket.Component.render(Component.java:2013)
> at
> org.apache.wicket.markup.html.border.Border$BorderBodyContainer.resolve(
> Border.java:366)
> at org.apache.wicket.MarkupContainer.renderNext(
> MarkupContainer.java:1211)
> at
> org.apache.wicket.MarkupContainer.renderComponentTagBody(
> MarkupContainer.java:1370)
> at
> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java
> :1305)
> at
>
> org.apache.wicket.markup.html.border.Border$BorderBodyContainer.onComponentTagBody
> (Border.java:347)
> at org.apache.wicket.Component.renderComponent(Component.java
> :2189)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java
> :1315)
> at org.apache.wicket.Component.render(Component.java:2013)
> at org.apache.wicket.markup.html.border.Border.resolve(Border.java
> :246)
> at org.apache.wicket.MarkupContainer.renderNext(
> MarkupContainer.java:1211)
> at
> org.apache.wicket.MarkupContainer.renderComponentTagBody(
> MarkupContainer.java:1370)
> at
> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java
> :1305)
> at org.apache.wicket.Component.renderComponent(Component.java
> :2189)
> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java
> :1315)
> at org.apache.wicket.Component.render(Component.java:2013)
> at org.apache.wicket.MarkupContainer.renderNext(
> MarkupContainer.java:1200)
> at
> org.apache.wicket.MarkupContainer.renderComponentTagBody(
> MarkupContainer.java:1370)
> at
> org.apache.wicket.MarkupContainer.renderAssociatedMarkup(
> MarkupContainer.java:642)
> at
> org.apache.wicket.markup.html.border.Border.onCompo

Re: handle resource with several formats (minified, gzipped,...)

2007-08-29 Thread Igor Vaynberg
i think you should create your own ResourceReference and do the selection in
newresource()

-igor


On 8/29/07, David Bernard <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> To avoid runtime/on-the-fly compression (js minification/packing,... gzip
> compression) of static resources (!= dynamic),
> I do it at compile time (done via the yuicompressor-maven-plugin) and
> provide 3 formats (original, minified, minified+gzip)
>
> But I need to choose the right at runtime.
>
> if !settingsMinifiedSuffixes.isEmpty() {
>foreach minifiedSuffix {
>  if resource with minifiedSuffix exists {
>resource = resource with minifiedSuffix
>  }
>}
> }
> if gzipAllowed {
>if resource with gzip exists {
>resource = resource with gzip
>  }
>} else compress(resource)
>setHttpHeader(gzip)
> }
>
> In your opinion where is right (simplest/best) place to implement the
> Resource Selection Policy (may be later could be generalized with locale and
> style selection).
> 1/ When resource is requested
> 2/ When url of the resource is build
> 3/ In a filter
> 4/ ...
>
> optionals requirements :
> * define settings at Application level (init)
> * no need to patch wicket source
> * applied and compatible with existing Resource's implementation
>
> What are your suggestions ?
>
> Regards
>
> /David
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Hibernate/Spring transaction problem

2007-08-29 Thread Vincenzo Vitale
Have you the same problem using directly the Hibernate session?

It's also interesting to read this article about the Hibernate template:

http://blog.interface21.com/main/2007/06/26/so-should-you-still-use-springs-hibernatetemplate-andor-jpatemplate/

I remember I had in the past similar porblems with the hibernate
template...  actually I didn't understand the problems I was
experiencing but after having red the article I tried to use directly
the session and it worked.

My code now looks in this way:

public Account saveOrUpdate(Account account) {
account.setDateModified(new Date());
getSession().saveOrUpdate(account);

//Maybe flush and refresh can be avoided...
getSession().flush();
getSession().refresh(account);
return (Account) account;
}

Hope this helps.


Ciao,
V.


On 8/29/07, pokkie <[EMAIL PROTECTED]> wrote:
>
> i have a button on a form, when clicked it saves a object to the database
> (via Spring's HibernateTemplate),
> but for some reason when i look in the db it is not there, until i go to
> another page, then suddenly the object is being written into the database.
>
> i am presuming that the session is not being flushed, until i go to another
> page, so i added a flush
> to my save method, but still experience the same behaviour.
>
> either the session or i am thinking that it might be running in a long
> running transaction,
> which only ends once a new request is coming in, and subsequently write the
> data to the database.
>
> any thoughts?
>
>  -- pokkie
>
> --
> View this message in context: 
> http://www.nabble.com/Hibernate-Spring-transaction-problem-tf4347663.html#a12386692
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: wicket contrib yui

2007-08-29 Thread James McLaughlin
>
> IMHO hardwiring is somehow an antipattern for me - maybe we could have a
>   "setYuiPath" in it that defaults to the delivered YUI but leaves the
> possibility to have other YUI versions as well?
>

Well, its not really hardwired, its just a default fallback used by
the static factory methods. Other factory methods exist to provide
choice for these attributes. But while you are in there adapting it to
2.3.0, by all means feel free to make whatever adjustments you want.
You might even want to start with a clean slate, since the work
YuiHeaderContributor was set up to do has been made redundant with the
addition of the dynamic loader.

best,
jim

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



Re: Testing AbstractAjaxTimerBehavior with WicketTester, executeBehavior???

2007-08-29 Thread wicket user
Ok this is becoming a habit answering my own questions but I've just worked
it out, please let me know if there is a more elegant solution:

tester.assertComponent("resendLabel", Label.class);
tester.assertLabel("resendLabel", "in 20 seconds");
tester.executeBehavior((AbstractAjaxBehavior)tester.getLastRenderedPage().getBehaviors().get(0));
tester.executeBehavior
((AbstractAjaxBehavior)tester.getLastRenderedPage().getBehaviors().get(0));

Label resendLabel = (Label)tester.getLastRenderedPage().get("resendLabel");
assertEquals("Resend label has not updated", "in 19 seconds",
resendLabel.getModel().toString());


Hope that helps some noob like me.

Thanks
Simon

On 29/08/2007, wicket user <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Another noob question here but I'm trying to setup a test case that tests
> the abstract timer on my page, like the WorldClock example.
>
> I see there is the executeBehavior method in the WicketTester but I'm not
> entirely sure how to set this up.  Basically I want to fire the timer event
> that I've setup on the page and check the appropriate changes have been made
> to the labels on the page. So for the world clock example it would mean that
> I would fire the event in my test then check that the time had updated in
> the label.
>
> Help would be much appreciated.
>
> Cheers
> Simon
>


Hibernate/Spring transaction problem

2007-08-29 Thread pokkie

i have a button on a form, when clicked it saves a object to the database
(via Spring's HibernateTemplate), 
but for some reason when i look in the db it is not there, until i go to
another page, then suddenly the object is being written into the database.

i am presuming that the session is not being flushed, until i go to another
page, so i added a flush 
to my save method, but still experience the same behaviour. 

either the session or i am thinking that it might be running in a long
running transaction, 
which only ends once a new request is coming in, and subsequently write the
data to the database. 

any thoughts?

 -- pokkie

-- 
View this message in context: 
http://www.nabble.com/Hibernate-Spring-transaction-problem-tf4347663.html#a12386692
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Testing AbstractAjaxTimerBehavior with WicketTester, executeBehavior???

2007-08-29 Thread wicket user
Hi,

Another noob question here but I'm trying to setup a test case that tests
the abstract timer on my page, like the WorldClock example.

I see there is the executeBehavior method in the WicketTester but I'm not
entirely sure how to set this up.  Basically I want to fire the timer event
that I've setup on the page and check the appropriate changes have been made
to the labels on the page. So for the world clock example it would mean that
I would fire the event in my test then check that the time had updated in
the label.

Help would be much appreciated.

Cheers
Simon


1.3 beta2 -> beta3 = NullPointerException

2007-08-29 Thread Stojce Dimski
I have a simple app embedded in my jetty (no web.xml, I wire-up the
components) with:
- Application (extends SpringWebApplication)
- 3 Pages (extends WebPage) 2 without instance variables and one with
one non serializable @SpringBean injected variable
- Session (extends WebSession) which contains above mentioned
@SpringBean as instance variable

with beta2 it worked, but today I updated it to beta3 and I get
following error, can some kind shed some light ?

WARN [org.mortbay.log] - failed
org.apache.wicket.protocol.http.WicketServlet-2080726
javax.servlet.ServletException: java.lang.NullPointerException
  at
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:437)
  at
org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
  at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
  at
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:612)
  at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
  at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
  at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
  at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
  at org.mortbay.jetty.Server.doStart(Server.java:217)
  at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
  at ...
Caused by: java.lang.NullPointerException
  at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.(DiskPageStore.java:486)
  at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.(DiskPageStore.java:512)
  at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.(DiskPageStore.java:521)
  at
org.apache.wicket.protocol.http.WebApplication.newSessionStore(WebApplication.java:563)
  at org.apache.wicket.Application.internalInit(Application.java:953)
  at
org.apache.wicket.protocol.http.WebApplication.internalInit(WebApplication.java:475)
  at
org.apache.wicket.spring.SpringWebApplication.internalInit(SpringWebApplication.java:68)
  at
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:414)
  at
org.apache.wicket.protocol.http.WicketServlet.init(WicketServlet.java:153)
  at javax.servlet.GenericServlet.init(GenericServlet.java:241)
  at
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:433)
  ... 10 more



  ___ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: 
http://it.docs.yahoo.com/nowyoucan.html

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



Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Xavier Hanin
On 8/29/07, neekibo <[EMAIL PROTECTED]> wrote:
>
>
> Thanks to all,
>
> I will analyse how complex my UI will be and than evaluate if Wicket fits
> in.
>
> Thanks for pointing at Stripes... I always thought: "Spring is so cool,
> everybody says that." So SpringMVC is the way to go, but as mentioned here
> it is quite low-level.
>
> My today's two favourites :=)
>
> 1. Wicket - SpringCore - Hibernate
> 2. Stripes - SpringCore - Hibernate
>
> Thanks for pointing at  http://databinder.net/site/show/overviewDatabinder
> . I will discuss with myself if abandon Spring is an option. I guess using
> Spring only makes sense when you have to code quite a bit of business
> logic.


Note that databinder can be used with Spring too. It's useful for exposing
your hibernate beans as wicket models.

Xavier

Discussion, especially arguments against Wicket, my case in mind, are
> welcome :=)
>
> Paul
>
>
> --
> View this message in context:
> http://www.nabble.com/Is-Wicket-a-proper-framework-for-a-Webshop---tf4341788.html#a12384390
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://incubator.apache.org/ivy/
http://www.xoocode.org/


Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread Alex Shneyderman
> I'm in the process of slapping the developers around here, trying to get
> them to wake up.
>
> Senior dev's recommending struts 1 for gods sake... now that's what i call
> afraid of change
> It's out of ignorance, and their unwillingness to see what else is out
> there.

It could also mean their unwillingness to commit their time and
money on education. Do not rush with this kinds of claims. Everyone
has their reasons - not everyone is lazy. If you have good enough
reasons to make them move to Wicket they will probably do so.
Otherwise, blame yourself for your inability to influence.

Component based frameworks are not obvious. While a reasonable
developer of decent experience could pick up Struts 1/2 and be
efficient with it in a couple of hours. I would definitely drop Struts 1,
and stick with Struts 2 as that is a different kind of animal. I am not
quite sure why Eelco is being so pushy on claiming no OOP is
done there, but I would really stay away from his opnions unless
they are somehow Wicket directed :-)

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



Re: Presentation and application logic separation

2007-08-29 Thread Gabor Szokoli
On 8/28/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> well, what wicket does is version the state if you keep it inside its model,
> so it all Just Works. But because you are keeping your state outside of
> wicket you have to build your own versioning mechanism, or remove your state
> machine and use wicket.

Assuming the SM state is not too big,  you could keep it in your base
page object.
Then it would get replicated along with the page in the cache, wouldn't it?
Make sure it is serialisable.
Or to get bookmarkable pages, keep it in the PageParameters.

Except for the variables which truly belong to the session, like
logged in user, of course.

More experienced people please correct me if I'm wrong.


Gabor

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



Wicket 1.3 problems

2007-08-29 Thread Matej Knopp
Hi,

If anyone has problems with latest 1.3 in a way that nothing seems to work,
you should try updating the slf4j libraries to version at least 1.4.

-Matej


Re: wicket problem

2007-08-29 Thread bhupat parmar
if u check the file upload example in wicket site u can see this . any way
the only having a file upload so no probs but my form also contains some
text fields
thanks
bhupat

On 8/29/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>
> upload.getfileupload() ?
>
> -igor
>
>
> On 8/28/07, bhupat parmar <[EMAIL PROTECTED]> wrote:
> >
> > hi
> > my code goes like this
> >
> >
> > private static class TabPanel3 extends Panel
> > {
> > FileUploadField fileUploadField = null;
> > TextField styleNameTFld=null;
> > private String message = "";
> > /** available sites for the multiple select. */
> > private static final List SITES =
> > Arrays.asList(new String[] { "The Server Side", "Java
> Lobby","
> > Java.Net" });
> >
> > public TabPanel3(String id)
> > {
> > super(id);
> > final FileUploadForm simpleUploadForm = new
> > FileUploadForm("simpleUpload");
> >
> > add(simpleUploadForm);
> > }
> > private class FileUploadForm extends Form
> > {
> > private FileUploadField fileUploadField;
> > private TextField styleNameTFld;
> >
> > /**
> >  * Construct.
> >  *
> >  * @param name
> >  * Component name
> >  */
> > public FileUploadForm(String name)
> > {
> > super(name);
> >
> > // set this form to multipart mode (always needed for
> > uploads!)
> > setMultiPart(true);
> >
> > // Add one file input field
> > add(fileUploadField = new FileUploadField("fileInput"));
> > add(styleNameTFld=new TextField("styleNameTFld"));
> >
> > // Set maximum size to 100K for demo purposes
> > setMaxSize(Bytes.kilobytes(500));
> > }
> >
> > /**
> >  * @see wicket.markup.html.form.Form#onSubmit()
> >  */
> > protected void onSubmit()
> > {
> > final wicket.markup.html.form.upload.FileUpload upload =
> > fileUploadField.getFileUpload();
> >
> > String imgPath = upload.getClientFileName();
> >
> > if (upload != null)
> > {
> >
> > System.out.println("inside onSubmit "+ imgPath);
> >   // here i am getting the path but how do i get the
> value
> > in the text field??
> > }
> >
> > }
> > }
> >
>


RE: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread William Hoover
Could you elaborate on what is lacking in Wicket when referring to the back 
button support (when compared to GWT)? I was under the impression that Wicket 
had robust back button support?

-Original Message-
From: Eelco Hillenius [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 28, 2007 1:56 PM
To: users@wicket.apache.org
Subject: Re: Is Wicket a proper framework for a Webshop ?


It sounds to me like GWT might be a better choice, especially if you
need Ajax & robust back button support. Wicket is a good choice when
you need a mixed approach.

I don't think SpringMVC would be a better choice in any way.

Eelco

On 8/28/07, neekibo <[EMAIL PROTECTED]> wrote:
>
> Hi all Wicket-users!
>
> I am new to web development and so to Wicket. I'm searching for a/the
> suitable framework for my case.
>
> So here a few constrains:
>  - A webshop with lots of products and categories
>  - Integration with SpringCore and Hibernate
>  - Ajax-Magic for a fast responding UI and Drag'n'Drop
>
> And a few misgivings:
>  1.) A component framework is overhead for a webshop (mostly simple
> db-read-access operations without a state). A request/response-driven
> framework fits better in this context.
>  2.) I need standard back and forth browser behaviour. Is this easy to
> achieve (with ajax in mind) ?
>  3.) Security: I need to easy code "sign in" and secure the payment process
> (ssl over http is guess)
>  4.) Performance/Scalability. I know, in general the DB is the bottleneck
> but ... compared to action-based frameworks. I read somewhere that Wicket is
> much faster that JSF, so this seems good to me.
>
> So these are just a few thoughts, I'm a new to this topic, so pardon me if
> something is wrong. In the moment my alternative is SpringMVC. But the
> concepts of Wicket appeals to me. Especially the complete lack of JSPs.
>
> Thanks in advance
> Paul
> --
> View this message in context: 
> http://www.nabble.com/Is-Wicket-a-proper-framework-for-a-Webshop---tf4341788.html#a12368098
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



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



Re: Is Wicket a proper framework for a Webshop ?

2007-08-29 Thread neekibo

Thanks to all,

I will analyse how complex my UI will be and than evaluate if Wicket fits
in.

Thanks for pointing at Stripes... I always thought: "Spring is so cool,
everybody says that." So SpringMVC is the way to go, but as mentioned here
it is quite low-level.

My today's two favourites :=)

1. Wicket - SpringCore - Hibernate
2. Stripes - SpringCore - Hibernate

Thanks for pointing at  http://databinder.net/site/show/overview Databinder
. I will discuss with myself if abandon Spring is an option. I guess using
Spring only makes sense when you have to code quite a bit of business logic.

Discussion, especially arguments against Wicket, my case in mind, are
welcome :=) 

Paul


-- 
View this message in context: 
http://www.nabble.com/Is-Wicket-a-proper-framework-for-a-Webshop---tf4341788.html#a12384390
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: No localizer has been set

2007-08-29 Thread Johan Compagner
thats odd
on your production machine you have enabled debugging:
if (log.isDebugEnabled())
{
log.debug("detaching " + this + " for requestCycle " +
RequestCycle.get());
}

and that code is not executed for development machine?
Thats a bit the reverse what it should be..

But the problem is that StringResourceModel.toString() calls getString()
thats wrong it shouldn't do that.

johan


On 8/29/07, Martin Bednář <[EMAIL PROTECTED]> wrote:
>
> I use code below, it works on my development machine (linux, jetty6) but
> don't work on production server (linux,tomcat-5, tomcat 5.5).
> Any advice ?
>
> public LanguageCheckBoxPanel(String id) {
> super(id);
> for (LanguageSelectOption languageOption :
> LanguageModel.languages) {
> languages.add(new CheckBoxLanguageWrapper(languageOption));
> }
>
> add(new ListView("languageList", languages) {
> protected void populateItem(ListItem item) {
> CheckBoxLanguageWrapper wrapper =
> (CheckBoxLanguageWrapper) item
> .getModelObject();
>
> //On this line code fails
> item.add(new Label("name", new StringResourceModel(wrapper
> .getValue(), null, null)));
>
> item.add(new CheckBox("check", new PropertyModel(wrapper,
> "selected")));
> }
> });
>
> }
>
>
> Stack trace
>
> WicketMessage: Exception in rendering component: [Component id = name,
> page = cz.triax.marathon.statistics.BatchPrintPage, path =
> 2:navomaticBorder:form:languagePanel:languageList:0:name.Label,
> isVisible = true, isVersioned = false]
>
> Root cause:
>
> java.lang.IllegalStateException: No localizer has been set at
> wicket.model.StringResourceModel.getString(StringResourceModel.java:397)
> at
> wicket.model.StringResourceModel.toString(StringResourceModel.java:464)
> at java.lang.String.valueOf(String.java:2827) at
> java.lang.StringBuffer.append(StringBuffer.java:219) at
> wicket.model.AbstractDetachableModel.attach(AbstractDetachableModel.java
> :60)
> at
> wicket.model.AbstractDetachableModel.getObject(
> AbstractDetachableModel.java:101)
> at wicket.Component.getModelObject(Component.java:983) at
> wicket.Component.getModelObjectAsString(Component.java:998) at
> wicket.markup.html.basic.Label.onComponentTagBody(Label.java:113) at
> wicket.Component.renderComponent(Component.java:1712) at
> wicket.markup.html.WebComponent.onRender(WebComponent.java:61) at
> wicket.Component.render(Component.java:1526) at
> wicket.MarkupContainer.renderNext(MarkupContainer.java:1334) at
> wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
> at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917)
> at wicket.Component.renderComponent(Component.java:1712) at
> wicket.MarkupContainer.onRender(MarkupContainer.java:927) at
> wicket.Component.render(Component.java:1526) at
> wicket.markup.html.list.ListView.renderItem(ListView.java:676) at
> wicket.markup.html.list.ListView.onRender(ListView.java:637) at
> wicket.Component.render(Component.java:1526) at
> wicket.MarkupContainer.renderNext(MarkupContainer.java:1334) at
> wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
> at
> wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:571)
> at wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:108) at
> wicket.Component.renderComponent(Component.java:1712) at
> wicket.MarkupContainer.onRender(MarkupContainer.java:927) at
> wicket.Component.render(Component.java:1526) at
> wicket.MarkupContainer.renderNext(MarkupContainer.java:1334) at
> wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
> at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917)
> at wicket.markup.html.form.Form.onComponentTagBody(Form.java:779) at
> wicket.Component.renderComponent(Component.java:1712) at
> wicket.MarkupContainer.onRender(MarkupContainer.java:927) at
> wicket.markup.html.form.Form.onRender(Form.java:850) at
> wicket.Component.render(Component.java:1526) at
> wicket.MarkupContainer.renderNext(MarkupContainer.java:1334) at
> wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
> at wicket.markup.html.border.Border.renderBodyComponent(Border.java:300)
> at wicket.markup.html.border.Border.resolve(Border.java:215) at
> wicket.MarkupContainer.renderNext(MarkupContainer.java:1345) at
> wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
> at wicket.markup.html.border.Border.renderBodyComponent(Border.java:300)
> at wicket.markup.html.border.Border.resolve(Border.java:215) at
> wicket.MarkupContainer.renderNext(MarkupContainer.java:1345) at
> wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
> at
> wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:571)
> at wicket.markup.html.border.Border.onComponentTagBody(Border.java:244

Re: Panel/Localizer issue

2007-08-29 Thread Johan Compagner
i changed it on 2 places.

On 8/29/07, Johan Compagner <[EMAIL PROTECTED]> wrote:
>
> yes that should also be lazy through a model
> can you create an jira issue ? (with a patch if possible)
>
> On 8/29/07, Edvin Syse < [EMAIL PROTECTED]> wrote:
> >
> > I have found that when I create a new Palette with the constructor:
> >
> > (String id, IModel model, IModel choicesModel, IChoiceRenderer
> > choiceRenderer, int rows, boolean allowOrder)
> >
> > .. it calls add(newAvailableHeader(AVAILABLE_HEADER_ID)) in the
> > constructor, which in turn does a:
> >
> > new Label(componentId, getString("palette.available", null,
> > "Available"));
> >
> > This gives the same error message, since the Palette is not added to the
> > page yet.
> >
> > Should this be rewritten to
> >
> > new Label(componentId, new ResourceModel("palette.available"));
> >
> > or something instead or am I missing something?
> >
> > -- Edvin
> >
> >
> > Edvin Syse wrote:
> > > Thank you!
> > >
> > > That both solved the problem and made my code cleaner :)
> > >
> > > -- Edvin
> > >
> > > Matej Knopp wrote:
> > >> You should use ResourceModel for this, it does the
> > localization/message
> > >> lookup for you.
> > >>
> > >> -Matej
> > >>
> > >> On 8/28/07, Edvin Syse < [EMAIL PROTECTED]> wrote:
> > >>> Hi,
> > >>>
> > >>> When I instantiate a Panel that does getLocalizer().getString() in
> > the
> > >>> constructor, I obviously get the errormessage:
> > >>>
> > >>> WARN  [Localizer] Tried to retrieve a localized string for a
> > component
> > >>> that has not yet been added to the page. This can sometimes lead to
> > an
> > >>> invalid or no localized resource returned. Make sure you are not
> > calling
> > >>> Component#getString() inside your Component's constructor. Offending
> > >>> component: [MarkupContainer [Component id = , page =  > Page>,
> > >>> path = ]]
> > >>>
> > >>> This is understandable, since I haven't added the component to a
> > page
> > >>> before the constructor is run.
> > >>>
> > >>> In the constructor, I do things like:
> > >>>
> > >>> add(new Label("articleTitle", new
> > >>> Model(getLocalizer().getString("articleTitle", this;
> > >>>
> > >>> and:
> > >>>
> > >>> deleteLink.add(new
> > >>> ConfirmBehaviour(getLocalizer().getString("confirmDelete", this)));
> > >>>
> > >>> Is there a way to create the panel and give it a page-instance
> > directly,
> > >>> or how should I get around this the wicket way?
> > >>>
> > >>> I use 1.3-SNAPSHOT, btw.
> > >>>
> > >>> -- Edvin
> > >>>
> > >>>
> > -
> > >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >>> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>>
> > >>>
> > >>
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


Re: Panel/Localizer issue

2007-08-29 Thread Johan Compagner
yes that should also be lazy through a model
can you create an jira issue ? (with a patch if possible)

On 8/29/07, Edvin Syse <[EMAIL PROTECTED]> wrote:
>
> I have found that when I create a new Palette with the constructor:
>
> (String id, IModel model, IModel choicesModel, IChoiceRenderer
> choiceRenderer, int rows, boolean allowOrder)
>
> .. it calls add(newAvailableHeader(AVAILABLE_HEADER_ID)) in the
> constructor, which in turn does a:
>
> new Label(componentId, getString("palette.available", null, "Available"));
>
> This gives the same error message, since the Palette is not added to the
> page yet.
>
> Should this be rewritten to
>
> new Label(componentId, new ResourceModel("palette.available"));
>
> or something instead or am I missing something?
>
> -- Edvin
>
>
> Edvin Syse wrote:
> > Thank you!
> >
> > That both solved the problem and made my code cleaner :)
> >
> > -- Edvin
> >
> > Matej Knopp wrote:
> >> You should use ResourceModel for this, it does the localization/message
> >> lookup for you.
> >>
> >> -Matej
> >>
> >> On 8/28/07, Edvin Syse <[EMAIL PROTECTED]> wrote:
> >>> Hi,
> >>>
> >>> When I instantiate a Panel that does getLocalizer().getString() in the
> >>> constructor, I obviously get the errormessage:
> >>>
> >>> WARN  [Localizer] Tried to retrieve a localized string for a component
> >>> that has not yet been added to the page. This can sometimes lead to an
> >>> invalid or no localized resource returned. Make sure you are not
> calling
> >>> Component#getString() inside your Component's constructor. Offending
> >>> component: [MarkupContainer [Component id = , page =  Page>,
> >>> path = ]]
> >>>
> >>> This is understandable, since I haven't added the component to a page
> >>> before the constructor is run.
> >>>
> >>> In the constructor, I do things like:
> >>>
> >>> add(new Label("articleTitle", new
> >>> Model(getLocalizer().getString("articleTitle", this;
> >>>
> >>> and:
> >>>
> >>> deleteLink.add(new
> >>> ConfirmBehaviour(getLocalizer().getString("confirmDelete", this)));
> >>>
> >>> Is there a way to create the panel and give it a page-instance
> directly,
> >>> or how should I get around this the wicket way?
> >>>
> >>> I use 1.3-SNAPSHOT, btw.
> >>>
> >>> -- Edvin
> >>>
> >>> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: PasswordTextField no longer supports cookies in beta3

2007-08-29 Thread Erik van Oosten

In a reaction to myself:

I can now see why the change was valid: it is easy to allow persistence 
again by overloading method supportsPersistence(). Giving false is the 
safest default value for PasswordTextField.


It should be added to the migration list though (I'll do that in a sec).

Regards,
   Erik.


Erik van Oosten wrote:

Dear wicketeers,

In 1.3beta3 I can no longer call
  new PasswordTextField(...).setPersistence(true);
as this results in a:
 java.lang.UnsupportedOperationException: FormComponent class 
org.apache.wicket.markup.html.form.PasswordTextField does not support 
cookies


I do not understand why PasswordTextField no longer allows this. Okay, 
it is not super safe, but it is also not very unsafe and very 
desirable in some circumstances.


Could someone provide the rationale for the change?

Regards,
   Erik.





--
Erik van Oosten
http://2008.rubyenrails.nl/
http://www.day-to-day-stuff.blogspot.com/


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



  1   2   >