|
I am not really doing the normal form processing in the navigation. The form has a navigator, just for showing more parts of the GridView, it also has a submit button to process the users request after they have selected items on one or more pages, So when they use the navigator, all I do is update the component models, when they press the submit button, I validate and process the whole form, But I see your point. I suppose I could pull the code from the form submit and process that in the onSubmit method of the default form submit button. I will give that a try. But that might be a little obscure if someone else were to use my components. Igor Vaynberg wrote: --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]so you call setdefaultformprocessing(false) and yet update the form yourself? that is the same as leaving setdefaultformprocessing(true)-igor On Tue, Mar 18, 2008 at 8:00 PM, Trevor Campbell <[EMAIL PROTECTED]> wrote:I should have added, I needed to setDefaultFormProcessing(false) because I don't want to process the form while just paging forward and without the DefaultFormProcessing, the model wasn't updating. Is this wrong? or am I missing something else. Igor Vaynberg wrote: you shouldnt have to do any of that form updating yourself...it should all be done before your link's onsubmit is called, there is a reason why its called a submitlink -igor On Tue, Mar 18, 2008 at 7:47 PM, Trevor Campbell <[EMAIL PROTECTED]> wrote: Thanks Maurice, I was able to get this to work by copying PagingNavigator, PagingNavigation, PagingNavigationLink and PagingNavigationIncrementLink. The only substantial changes I made were to make PagingNavigationLink and PagingNavigationIncrementLink extend SubmitLink and then in the onsubit to do some horrible stuff to update the models. public void onSubmit() { pageable.setCurrentPage(getPageNumber()); FormComponent.IVisitor visitor = new FormComponent.IVisitor(){ @Override public Object formComponent(IFormVisitorParticipant formComponent) { if (formComponent instanceof FormComponent) { ((FormComponent) formComponent).validate(); ((FormComponent) formComponent).updateModel(); } if (formComponent.processChildren()) { return Component.IVisitor.CONTINUE_TRAVERSAL; } else { return Component.IVisitor.CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER; } } }; getForm().visitFormComponents(visitor); } I still haven't got the autoEnable and linksTo functionality working, but it is just some cosmetics. Trev Maurice Marrink wrote: That is a known issue, unfortunately you will need to create your own version of a submittingpagingnavigator. The api for those classes is however not very extendable friendly so you probably end up copy-pasting large portions of code. I believe Martijn is planning on refactoring that component, just not for wicket 1.3.x. As an alternative you might be able to use ajaxcheckboxes? Maurice On Tue, Mar 18, 2008 at 12:30 PM, Trevor Campbell <[EMAIL PROTECTED]> wrote: I have a form containing a GridView with a PagingNavigator. Within each cell I have an image and a CheckBox. When a user submits the form I collect all the image refs from the selected cells and process them. My problem is I would like to do this across multiple pages. So the user scenario is: A user goes through the pages using the navigator and selects, using the checkboxes, what images they like and then presses a select button. Unfortunately the selections are not preserved when I use a PagingNavigator on the form. A paging navigator renders links rather than a submit, so any selections are lost. Any ideas how to get around this?? --------------------------------------------------------------------- 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] --------------------------------------------------------------------- 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] |
- Need help with GridView and checkboxes. Trevor Campbell
- Re: Need help with GridView and checkboxes. Maurice Marrink
- Re: Need help with GridView and checkboxes. Trevor Campbell
- Re: Need help with GridView and checkboxes. Igor Vaynberg
- Re: Need help with GridView and checkboxe... Trevor Campbell
- Re: Need help with GridView and chec... Igor Vaynberg
- Re: Need help with GridView and ... Trevor Campbell
