Hi Fellow AppStudio Users,
I have recently been developing a quick report application for a post-doctoral researcher who wanted just the landing page and map page from which you could submit the sighting. I knew this was possible, but was not aware of how to properly move the "Save" and "Submit" buttons. I did some tinkering with the code and found that there is already some code implemented into the RefineLocation.qml page that can be used to submit the report. I haven't been able to get the "isOnline" feature working yet, but this can potentially be processed in a future version of the application. If anyone has any suggestions for implementing this feature with what I already have, please feel free to post in the comments.
Anyways, I'll go ahead and start with structure for the QuickReportApp.qml page. To create an application that only displays the landing page and RefineLocation page, scroll down to approximately line 2071 (refineLocationPage component) and implement the code from the addDetailsPage component to the refineLocationPage. Note that my app did not handle any attachments, so it automatically switched to the refineLocation page upon hitting "New" on the landingPage. If you are wanting to handle attachments, you may have to change the the logic in this area of the QuickReportApp to switch to the appropriate page upon clicking next on the addPhotoPage. The logic is handled by the stackView.XYZPage, where XYZ is the page that you are wanting to switch to.
Now that the refineLocationPage is handling the "submit" message, we can go to the addDetails page and copy the code for the Save and Submit buttons to paste in place of the "Next" button on the refineLocation page, approximately line 1380. NOTE: do not replace the code for the "MouseArea" function. Format the buttons to what is necessary for your app and then review the code. You will see the nextPage( ); function in the MouseArea, this is where we will handle the save request. Scroll to approximately line 1485 to the nextPage( ) function. Leave the code the way it is, but insert "save" at the bottom of the function within the next( ); code. I then copied and pasted this same code (either above or below, it doesn't matter) and renamed the function nextPageSubmit ( ) and inserted "submit" in the bottom next( ) code. This should allow you to submit your sightings from the refineLocation page instead of the addDetailsPage.
Please feel free to provide suggestions if there is a more elegant design that I may have missed. In the meantime, this has seemed to work well for the current version of my application.
Dustin Baumbach, PhD