I`m using persistence API in form builder, but i can't redirecting orbeon form builder after pushing 'save' button. Anyone knows?
You probably want to look at the Buttons and Processes documentation. This allows you to create simple workflows when a button is pressed. So you could have a button which saves, then redirects to another page.
Related
In my web application I have a form that is accessible from multiple screens. I'd like the Cancel button in the form to lead back to the previous page. The link_to 'Cancel', :back solution doesn't work if form is submitted before the Cancel button is pressed. In such case it simple refreshes the page, which is an expected behavior.
What is a path-independent alternative that ensures that the Cancel button always leads to the screen that the form was opened from?
You can use request.referer as a 'Cancel' button. But I'm not sure how it will handle the submit.
Another solution would be to store the page where the user came from in a session, and then redirect them back there
I programmed a few reusable forms by splitting them into a partial and then passing the URLs to the partial. This way the html is fully reusable. Looks not as pretty but it's clear what it does
I have an Angular JS app with a bootstrap ui modal dialogue hosting a simple edit form.
The form can be for a new "thing" or a populated "thing".
I find that when I cancel out of the modal with the form populated, submit is being called.
Any help appreciated.
Plunkr here... http://plnkr.co/edit/XhQCqlGUfcmQOhqLDeXR?p=preview
I forked your plunk and got it working here: http://plnkr.co/edit/jgg5pDQOH46XgrbW3Mvh?p=preview I think the cancel button was participating in the form submit event since it was inside the form element. Moving it outside of the form seems to have fixed the problem. I also set up the submit event to fire the modalInstance close event and the cancel event to fire the modalInstance dismiss event. This gives you the opportunity to handle things appropriately in the parent controller (ModalDemoCtrl).
EDIT
You could also stop the click event from propagating in the cancel event and still use the save as an input element inside the form tag. See this plunk for example: http://plnkr.co/edit/A81KkUUQEL3IBbOSnHQb?p=preview
I was having a similar problem. My problem was that when I clicked in the button to open the modal, my form was submited. I was using a "button" html tag, without specifying the "type" attribute. So, I found your problem and I went to the W3C documentation. I found that:
Tip: Always specify the type attribute for a button element. Different browsers use different default types for the button element. (http://www.w3schools.com/tags/tag_button.asp)
I wasn't defining the type of my button, so the default type of my browser was submit. I defined the type to "button" and everything is ok now.
How to implement a browse button which would not be in a form tag in MVC?
I want a normal button - when clicked, to handle the file selected.
This is impossible to do. The browse button has to be in a form tag.
I am new to grails, and I have been trying to get the following functionality to work.
I am using grails modal box, and I have a save button. When I click on save, how can I close the modal box, and pass a variable back to the parent window?
I think I'm doing what you want in my Customer Change actions in a couple screens at http://ibidem.cloudfoundary.com. Login as ibidem/ibidem and do a Customer Change on a Lookup Table.
Then if this is what you want, see
https://trac.maflt.org/web/ibidem/browser/trunk/src/ibidem/grails-app/views/lookupTable/show.gsp
and the corresponding controller:
https://trac.maflt.org/web/ibidem/browser/trunk/src/ibidem/grails-app/controllers/org/maflt/ibidem/LookupTableController.groovy
I have 2 radio button with values New & Existing. If user chooses New, then I show a textbox on the form and if Existing a dropdown and textbox is hidden. The question is , does the hide/show of the textbox/dropdownlist have to be written in the View or the Controller class? Also when I choose the selection my whole form is posting back and hence all validation error msgs are being shown which should not be shown nless the save button is clicked, how do I a partial postback without full form submission? Any code snippets or urls would be benificial in this respect.
The question is , does the hide/show of the textbox/dropdownlist have to be written in the View or the Controller class?
Just show/hide with jQuery that.
Also when I choose the selection my whole form is posting back and hence all validation error msgs are being shown which should not be shown nless the save button is clicked, how do I a partial postback without full form submission? Any code snippets or urls would be benificial in this respect.
Perform 'partial postbacks' through javascript.
Post form to save action only once when it's ready (when Save button is clicked).
Some resources:
jQuery tutorial
jQuery AJAX
About form AJAX`ifying
If I understand you correctly, the answer is the hiding and showing of controls should be done on the view as it's display specific.
If you use javascript to show and hide the controls then because it's on the client side you would not have to postback the form, and could do server side validation when the save button is clicked.
jQuery is very good: Jquery Website
Hope that helps?