I hope someone can help me with this.
I've got a form. The form is used to record information about a work site. Name, Address, Foreman, etc.
The form also contains a web-block used to list observations about the work site. Equipment, who is allowed to use it, last time it was checked, etc.
Each time the user wishes to add a new observation, they click a button/link at the bottom of the page and a new observation appears underneath the last one.
User can also delete observations by clicking on a delete button in the web-block.
The adding/deleting an observation works by AJAX submit method. And to reduce the amount of loading/reloading, an AJAX refresh is implemented to only refresh the Observations web-block.
While deleting is working 100% no problems, adding only works if there is already an observation in the list. When I click on "Add Observation" on a brand new form, the screen just spins and gets stuck at the AJAX refresh stage. Pressing F5 to reload the whole page, the new observation then appears.
If however, there's already an observation in the list, I can click on the Add Observation button and it will create a new Observation and refresh the web-block without having to reload the page.
Reloading the whole page each time an observation is added isn't a huge problem, but this method needs to be used on other forms and web-blocks as well which causes issues with usability when the user is working off a mobile device.
So, any ideas as to how I could possibly fix this or causing the problem?
If I am getting correct then you are trying to add new record in a list using web-block. And problem is occurring when you added first record in a list.
If you are creating new record into the table at the time of adding row then you have to refresh your SQL from which your are getting previously added record also need to refresh list widget at the same time.
Please reply if needed.
Thanks for your replay, Narendra.
I have refreshed the SQL.
My function process:
1. Assign Form_ID to Observation.Form_ID
2. CreateObservation Action
3. Refresh GetObservationByForm_ID
4. AJAX refresh Observation web-block.