you shouldnt rerender the entire form, just some div that surrounds
the area you are changing

i have something similar going, and there i have a div that is around
the label+editor, so i repaint that diff when i need to swap it out
with a different editor...

-igor


On Thu, Feb 14, 2008 at 12:39 PM, Jay Hogan <[EMAIL PROTECTED]> wrote:
> Timo,
>
>  Thanks for your response. Here's a practical example of how this component
>  will be used.
>
>  Let's say I have an employee table out in some database that has firstName,
>  lastName and department fields. I need to give HR a web page that allows
>  them to search for employees based on firstName, lastName and/or department.
>  Now I could easily design a page that has a search form with 3 TextField's
>  and a submit button to simply get the job done. But what if I have 30 or 40
>  tables and all of those tables require search pages....I don't want to
>  recreate the wheel each time if I can get away with it. So I design a
>  component (thanks to wicket) that accepts general search parameters and
>  handles the grunt work. Plus, I can make the search panel more powerful by
>  allowing the user to select how they want to search (using =, >, <, LIKE, IN
>  etc...).
>
>  Getting back to the employees example, I want the search form to look
>  something like this:
>
>  First Name: <SearchOperatorDropDown: =, LIKE, IN LIST> [Textfield to hold
>  search criteria entered by user]
>  Last Name: <SearchOperatorDropDown: =, LIKE, IN LIST> [Textfield to hold
>  search criteria entered by user]
>  Department: <SearchOperatorDropDown: =, LIKE, IN LIST> [Textfield to hold
>  search criteria entered by user]
>  [SearchButton]
>
>  Here is where I am stuck. If the user chooses to search by department using
>  the "in list" operator, I want to be able to replace, using AJAX, the
>  TextField component with a MultipleListChoice component so they can select 1
>  or more departments. I don't really need the form to be submitted every time
>  the search operator is changed but when I add the form to
>  AjaxRequestTarget.addComponent() the form is re-rendered and my changes are
>  lost.
>
>  Am I making any sense?
>
>  Thanks,
>  Jay
>
>  On Thu, Feb 14, 2008 at 3:12 PM, Timo Rantalaiho <[EMAIL PROTECTED]>
>  wrote:
>
>
>
>  > On Thu, 14 Feb 2008, Jay Hogan wrote:
>  > > Here's what I'm trying to do. I'm designing a SearchPanel component that
>  > > accepts a List<SearchField> and renders these items on a search form.
>  > The
>  > > SearchField object has properties for search field name, search operator
>  > (an
>  > > enum), search value and a list of allowed search operators. I am
>  > following
>  > > the dynamic form
>  > > elements<http://cwiki.apache.org/WICKET/forms-with-dynamic-elements.html
>  > >example
>  >
>  > Wow, that's a complicated search! I hope that you have a lot
>  > of data behind it.
>  >
>  > > This is where I run into problems. If I add the form component to the
>  > > AjaxRequestTarget provided by AjaxEditableChoiceLabel.onSubmit, any
>  > dirty
>  > > form components lose their values. I've tried to add a call to
>  >
>  > Hmm, so are you submitting the entire form when any
>  > AjaxEditableChoiceLabel is edited? Have you checked that it
>  > does submit the form? If not you might be better off by
>  > rolling your own component with AjaxFormSubmittingBehavior.
>  >
>  > > form.processin the
>  > > AjaxEditableChoiceLabel.onSubmit method in attempt to force the form to
>  > > update it's model, but that doesn't work. I also tried just adding the
>  > > ListItem to the AjaxRequestTarget but the component is not re-rendered
>  > by
>  > > the target.
>  >
>  > Have you tried adding a feedback panel to see if there are
>  > validation errors?
>  >
>  > I didn't understand very well what was the expected behavior
>  > of each input element and the form (a practical example would
>  > be handy).
>  >
>  > Best wishes,
>  > Timo
>  >
>  > --
>  > Timo Rantalaiho
>  > Reaktor Innovations Oy    <URL: http://www.ri.fi/ >
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>  >
>
>
>  --
>  ============================================
>  Computer Science: solving today's problems tomorrow.
>

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

Reply via email to