You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Wolfgang Grossinger <wo...@gmx.net> on 2010/03/27 13:09:53 UTC
Master/Detail with DropDownChoice
Hi,
I have a real big problem and cant find any solution: What I want to do
ist to have a master/detail view, where a DropDownChoice is the master
to select the detail. The detail view is also used to save new Items and
where some fields are 'required'.
1.) I need some kind of submit behavior. AjaxEventBehavior("onchange")
will not work, because it doesn't deliver the current selection.
2.) Master and detail must be 2 different forms, because if I use one
form, I would get a validation error when the required fields are not
set what is not intended when I just want to select another item.
What I did at the moemnt is something like
<wicket:panel>
<form id="masterForm" method="post" wicket:id="masterForm">
<select id="selNotamFilter2" wicket:id="selNotamFilter2"/>
</form>
<form id="detailsForm" method="post" wicket:id="detailsForm">
.....
and the handling is done in this way:
protected void onSubmit(AjaxRequestTarget target) {
DropDownChoice<String> component =
(DropDownChoice<String>) this.getComponent();
Details selected =
getMatchingItem(component.getConvertedInput());
So I come to the point that I have the right details to set and can also
set the details to the model, but whatever I add via
target.addComponent(...) is not updated after the request.
So my question is what do I wrong? (Is it not possible to update one
form from another form?)
What can I do to get this right? (I find absolutely no solution for a
quite common ans simpel problem in my opinion and this stuff cost me
already days).
Thanks a lot for any help!
Wolfgang
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How to put a validation error message near its field?
Posted by David Chang <da...@yahoo.com>.
Jame, thanks for quick reply on a Saturday evening.. Exactly what I want. Best, David
--- On Sat, 3/27/10, James Carman <jc...@carmanconsulting.com> wrote:
> From: James Carman <jc...@carmanconsulting.com>
> Subject: Re: How to put a validation error message near its field?
> To: users@wicket.apache.org
> Date: Saturday, March 27, 2010, 10:19 PM
> http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/panel/ComponentFeedbackPanel.html
>
> On Sat, Mar 27, 2010 at 10:11 PM, David Chang <da...@yahoo.com>wrote:
>
> > FeedbackPanel is great in in terms of gathering
> messages in a central
> > place. But I saw many great sites have messages near
> their fields.
> >
> > How can we do this in Wicket?
> >
> > Thank in advance for any info or pointer!
> >
> > Regards.
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How to put a validation error message near its field?
Posted by James Carman <jc...@carmanconsulting.com>.
http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/panel/ComponentFeedbackPanel.html
On Sat, Mar 27, 2010 at 10:11 PM, David Chang <da...@yahoo.com>wrote:
> FeedbackPanel is great in in terms of gathering messages in a central
> place. But I saw many great sites have messages near their fields.
>
> How can we do this in Wicket?
>
> Thank in advance for any info or pointer!
>
> Regards.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
How to put a validation error message near its field?
Posted by David Chang <da...@yahoo.com>.
FeedbackPanel is great in in terms of gathering messages in a central place. But I saw many great sites have messages near their fields.
How can we do this in Wicket?
Thank in advance for any info or pointer!
Regards.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Master/Detail with DropDownChoice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Hi!
> 1.) I need some kind of submit behavior. AjaxEventBehavior("onchange") will
> not work, because it doesn't deliver the current selection.
We have no problem using AjaxFormComponentUpdatingBehavior
> 2.) Master and detail must be 2 different forms, because if I use one form,
> I would get a validation error when the required fields are not set what is
> not intended when I just want to select another item.
Use AjaxFormComponentUpdatingBehavior. It will not process the rest of the form.
**
Martin
>
> What I did at the moemnt is something like
>
> <wicket:panel>
> <form id="masterForm" method="post" wicket:id="masterForm">
> <select id="selNotamFilter2" wicket:id="selNotamFilter2"/>
> </form>
> <form id="detailsForm" method="post" wicket:id="detailsForm">
> .....
>
> and the handling is done in this way:
>
> protected void onSubmit(AjaxRequestTarget target) {
> DropDownChoice<String> component =
> (DropDownChoice<String>) this.getComponent();
> Details selected =
> getMatchingItem(component.getConvertedInput());
>
> So I come to the point that I have the right details to set and can also set
> the details to the model, but whatever I add via target.addComponent(...) is
> not updated after the request.
>
> So my question is what do I wrong? (Is it not possible to update one form
> from another form?)
> What can I do to get this right? (I find absolutely no solution for a quite
> common ans simpel problem in my opinion and this stuff cost me already
> days).
>
> Thanks a lot for any help!
>
> Wolfgang
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org