I'm sending images that are grouped together on the server.
Sending the first image, the onSubmit checks if a id is set client side and if not the server creates one. This is then send back to the client via the onComplete responseJSON and is then ready for the then next onSubmit.
However if I upload 4 images at once, currently fine uploader fires 4 submits then 4 completes putting these images in to 4 separate groups.
Is there a way to order the process as submit, complete, submit, complete and so on?
Related
I am doing image upload in my Laravel application where after selecting some images I want to remove some selected images , I have done that but when submitting ,the request still has all the images selected at the beginning.
What are the changes on your code from the first group of selections to the second?
I'm having an issue with a my current dgrid. I have a column which is dijit/Form/FilteringSelect with a Ajax-based store. The store works fine for searching and populating, but, when I open a page with the dgrid store having a couple of rows already I face a problem. Only the last FilteringSelect triggers the edit event and fires the XHR request.
For example, if the Grid store has 4 items, so it will have 4 rows, only the FilteringSelect of the last row will go to the server to get the display value.
I'm a bit lost, any help?
I am making an application using ASP.NET MVC 3 which contains "form wizard", i.e. there are three forms which are wizards.
First form is for entering user details, second is for selecting product and third is for entering his payment details.
When the user enters his details in first form and goes to second form by clicking next submit button. And in the second form when the user selects the product, then his details from first form and his product choice from second form is sent to admin for approval. My question is that where should I save data from first and second form till users approval. When the user is approved then user data is saved to database. Where should I save form data when going from one form to other.
JavaScript Way
Just because "form1" and "form2" look like two physically different forms doesn't mean they have to be. You can initially display the container for the first set of inputs, then when the user clicks next it hides the first and shows the second.
Once the user is finished with the second set of inputs the page submits both sets of fields to the server using one form. At this point it would need to go in a database or be emailed to someone for persistence.
Traditional Way
If you need to have each form on a different page and submit between each one you could do it like this: (Note: this is a really bad way)
1. Form 1 submits
2. Server responds with form2 and data from form1 (to store in hidden fields on form 2)
3. User submits form2 (along with the hidden form1 data)
I have been tasked with re-creating an old PL/SQL Web Toolkit front end in Application Express (Apex).
I would like to display a popup after the page is submitted and after computations and validations.
The page can be submitted by clicking a button OR by hitting enter.
I have googled and got a modal popup working (called by javascript) but I can't seem to call it at the right point. I can call it on submit (before the validations etc.) but not after the validations.
I have tried creating a branch to URL at the correct processing point and then have the URL set to:
javascript:openForm();
But then I get a page will not display error.
Can anyone out there explain how I could do this?
Apex Version: 4.0.2
Oracle 10g
I suppose what you want to do is to perform the validations, have values submitted to session state, but not execute further processes.
However, when you submit the page it is sent to the server; and everything you see in the page processing region will sequentially fire. There is no way to halfway through the processes call a javascript function, since basically you are not on the clientside anymore.
What you can do is to create a branch after your validations to the same page. Redirect to it but provide a REQUEST value, for example OPENFORM.
Create a dynamic action, firing on page load, with a true action that executes javascript and opens up your modal page. Then set the condition on your dynamic action to Request = Expression 1, providing the request value to Expression 1 (OPENFORM).
(Note that this is the Conditions region, and not the 'Condition' field of the 'When' region)
This should cause the page to be submitted, validated, then re-loaded but with a request value, and the dynamic action firing, opening your modal page.
Just a point of interest:
If you have actual processes on this page though, then be careful with the Enter key. Buttons by default submit to session with the request value set to their name, and thus making it possible to conditionally execute processes or branches. The enter key does not submit with a request value set i believe. So if your branch is conditional, the enter key might simply skip over it.
I have a web application which among other things contains a table of items created using an Ajax callback. A bunch of form fields at the top of the table allow me to filter the items that will be displayed in the table according to various criteria and show it.
Some parts of the table have lists of items with an [X] marked next to them that I can delete by clicking on those items.
Now, if I were doing this the non-ajax/javascript way, the page would receive a bunch of POSTed data fields and then would render the table accordingly. I can do this but I would also like to Ajaxify the entire setup. My questions are regarding this.
How would I create the [X] button. A simple <a> would "work" but it's a GET modifying state so I don't want to do that. The way I'm doing it now is a tiny form with a hidden parameter than holds the item to be deleted and a styled submit button that's the [x]. If I ajaxify this, I can get the response and do the needful.
How do I keep my backend DRY? I don't want to have two completely different bits of code for the Ajaxified version and the regular ones. What I'm doing right now is having the non-ajax version submit to a URL that changes the state and then redirects to the main page again (similar to a PRG type system). With the Ajax enabled, I simply call the URL and ignore the redirect but use the returned data to adjust the table. Is this the "right way"?
Any other advice on graceful degradation on how to keep my backend DRY?
I would put each row into it's own form (with method='POST'), and include a hidden field to say which item is to be deleted. The [X] would submit the form, and in the form's submit event, if no XmlHttpRequest is present simply submit the form to the server which would delete the item and redirect to the same page again (this is good practise to avoid a reload from resubmitting the delete POST).
If an XmlHttpRequest is present, set it up to POST with the id of the thing to delete and then remove the row if the request succeeded. You could set a flag in the AJAX request so that redirect doesn't happen, just a success (200 OK).