FeedbackPanel for nested Form - wicket

Is it possible to catch a nested form submit for rendering its feedback panel?
More specifically:
I have an outer form with a feedback panel and an inner form with a feedback panel. The outer form is submitted via an AjaxButton. Within the button's onError method I add the feedback panel to the AjaxRequestTarget.
But this "outer" feedback panel shows also the inner form's validation messages. I would like to add the inner form's feedback panel with its validation messages. But I can't find any way how to catch the inner form submit event.

You should use FencedFeedbackPanel for this.

Related

Nested redux-forms: voucher form inside checkout form

I'm trying to make a checkout page with a nested coupon code / voucher subform using redux-form.
So the checkout form would include for example a Country selection and inside this form I'd like to add a sub form to apply a Voucher.
The user needs to be able to apply a voucher separately from the main checkout form to view the possible discount.
When submitting the general checkout form the voucher must also be validated in case it wasn't applied.
What would be the best way to implement this?
I understand I can't simply nest reduxForms. I don't want to create 2 seperate forms, because i'd like to show possible validation and submit errors of the general checkout form also below the voucher field
I might be able to use asyncValidation for the voucher field, but I'd like to trigger that with a apply button instead of a field blur.
In the end I've implemented this using asyncValidation. To trigger this, not when leaving the voucher field but when clicking the apply button I created a custom Field component with the textfield and button. The textfield gets the whole input except the onBlur function, the button's click handler calls the input.onBlur.
Because it's a field I could also easily use the meta information to disable the button when appropriate.
Feels like quite a hack, so better solutions are welcome.

Implementing "onclickout" with GWT

I need a way of capturing onclick event when a user clicks out of a FocusPanel(in the form of a dialog box). I need to warn the user to save their work before clicking outside thus losing the panel. I know how to do it in JavaScript but it I am stuck with GWT. Any assistance will be appreciated.
Every click event provides coordinates of a click. Check that these coordinates are outside of your popup panel.
Alternatively, make your PopupPanel modal, so that users can exit it only by clicking on UI elements that you provide, for example, submit and cancel/close buttons.

use one text box with multiple form submit buttons ruby on rails

I'm making an app where I have multiple forms on one page but they are all similar; there is a text box and a submit button.
What I would like to do is consolidate all text boxes into one then have many submit buttons. That way the user inputs the data once in the obvious text box at top then decides which category (submit button) he would like to apply the data in the input box to.
Is this possible? I can't find and documentation on how to do this. Thanks!
You can do so by using <%= fomr_tag url: "/myCust" do %> method to create a form and wrap all the fields inside form tag. on submit button you will be redirect to /myCust method.
There you can get all the params in myCust method. You are using rails 4 then define all params under private method as it does. Store each of them. as you may want.

Wicket modalwindow returning value

I want to create a settings-dialog in my wicket page. I created a ModalWindow that contains a form to achieve this. This works great, the dialog shows up and it contains the form but now I need to return some of these values in the form back to the caller page. Is there someone who could give me pointers on how to do this?
Thanks in advance.
Quote from ModalWindow API:
"If you want to use form in modal window component make sure that you
put the modal window itself in another form (nesting forms is legal in
Wicket) and that the form on modal window is submitted before the
window get closed"
This way when you submit the form in the modal window actually the parent form gets submitted and you get the values transferred.

Display Additional Form on Update - RadGrid

I'm using a RadGrid for changing record status's. Users have the ability to select a status from a dropdown and update that record with that status. Depending on the status chosen, when the user clicks update I want to popup an additional form so the user can fill out more data required for the update. I'm not sure the best way to go about implementing this. Any suggestions are appreciated.
One way is to use the RadWindow like a modal and pop it up to the user via client-side JavaScript. We use RadWindows in our applications and it works. Or, the RadWindow supports a Nested Grid or View that you can have as a record's child; so you can have the master record, click on the arrow on the left and expand the record to view a nested grid of data, or a custom view (via the NestedViewTemplate property). You can also have the form in a DIV, hide it, then show it via JavaScript too.
Those are two ways.
HTH.