Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Parent-Child Records In A Mobile-App

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Parent-Child Records In A Mobile-App

    I'm working on a mobile application where the user essentially edits data in two tables:

    * Screening
    * Diversion Plan

    Screening has a one-to-many relationship with Diversion Plan, and both tables use identity (a.k.a., auto-increment) integers for their primary key. I've built a UX component which constists of a series of panels. The first panel is a list of the user's screenings (along with an 'Add' button), followed by a series of panels that let's the user edit whatever fields of the screening they want to edit. On one of thse panels, I want the user to be able to add Diversion Plans to the Screening and edit them.

    As far as I can tell, there seems to be two ways to do this: use Repeating Sections or use a List Control with the "Open a UX Component to Edit Record in List Control or Enter a New Record" action.

    Using the List Control solution would be ideal, because it's better optimized for a mobile interface. However, I'm not sure this approach will work because, if a user creates a new Diversion Plan for the Screening, how does the new Diversion Plan get linked back the Screening? Screening's ID wont necessarily be known yet because the Screening may not have been saved the server yet. Am I stuck with using a Repeating Containers? Should I switch to using an ID that can be generated client-side, like a GUID perhaps? Does AlphaAnywhere somehow handle this for you already?

    Also, the client has expressed that they'd like this application to be offline-capable, if that makes a difference.

    What would be the best approach to use in this situation?

    #2
    Re: Parent-Child Records In A Mobile-App

    My suggestions would be:

    1) Don't allow the user to create a diversion plan unless the screening has been saved. That eliminates the issue of not having a screening ID. And who wants to create a screening, then create a diversion plan only to have something go wrong and lose all that work? You could even save the screening automatically if the user elects to create a diversion plan.

    2) If you are going to be doing offline stuff, then the IDs should be taken care of during the upload process once the system reconnects. Worst case scenario, you can write a trigger (if this is a sql system) to update the foreign key in the diversion table with the new Key from the screening table when that gets changed in the upload process.

    Comment


      #3
      Re: Parent-Child Records In A Mobile-App

      A Screening record, including any diversion plans it has, is usually created and entered by the user all at once. So this would be a very common usage scenario. Additionally, users can only see and edit their own data, so there basically is no risk of edit conflicts or something "going wrong" to cause data loss.

      Auto-saving when the user wants to add a diversion would be an acceptable solution except, unless I'm mistaken, this is impossible if the user is offline. If that is the case, option #1 wont work.

      I'm not sure how suggestion #2 would work either. A user might created multiple screening records, each with their own diversion plans, while offline. How would the trigger determine which Screening each Divsion Plan goes with if multiple Screenings and multiple Diversion Plans are uploaded all at once?

      Comment


        #4
        Re: Parent-Child Records In A Mobile-App

        Diversion List is a child of the Screening List.
        Both Lists can exist in the one UX each having a detailed view.
        NOT a bound UX. Binding is done in the LIST.
        Set an argument for the ScreeningID you can call it ScreeningID
        In the Diversion LIST filter the SQL against the :ScreeningID argument Say Where Diversion.ScreeningID = :ScreeningID
        Set the Has Parent in the Diversion List to yes and name Screening as the Parent
        Nominate the Fields that link the two. (This is how the child gets the Parent ID)
        And basically your done.

        Cheers, Peter
        Insanity: doing the same thing over and over again and expecting different results.
        Albert Einstein, (attributed)
        US (German-born) physicist (1879 - 1955)

        Comment


          #5
          Re: Parent-Child Records In A Mobile-App

          Even though the system is offline, it knows what a primary key is. And it does allow you to "save" edited data.

          The difference is that it is storing it to temporary storage on your phone instead of back to the live server.

          It will create temporary PKs for each record.

          When the system syncs with the live server, it will get new PKs and use them throughout.

          That is my understanding of how it is supposed to work, anyway. I don't have any offline systems myself at the moment, but I've seen some videos.

          Perhaps someone more in the know will chime in!

          Comment


            #6
            Re: Parent-Child Records In A Mobile-App

            Originally posted by peteconway View Post
            Diversion List is a child of the Screening List.
            Both Lists can exist in the one UX each having a detailed view.
            NOT a bound UX. Binding is done in the LIST.
            Set an argument for the ScreeningID you can call it ScreeningID
            In the Diversion LIST filter the SQL against the :ScreeningID argument Say Where Diversion.ScreeningID = :ScreeningID
            Set the Has Parent in the Diversion List to yes and name Screening as the Parent
            Nominate the Fields that link the two. (This is how the child gets the Parent ID)
            And basically your done.

            Cheers, Peter
            Thanks. I will test that and report back.

            Comment


              #7
              Re: Parent-Child Records In A Mobile-App

              Hi Kevin - any luck with Peter's method? I'm attempting to do something very similar and still getting a zero where the foreign key should be.

              Comment


                #8
                Re: Parent-Child Records In A Mobile-App

                Hi,
                It's been a while I am banging my head with a similar scenario.
                I need a parent-child screen entry, While I need the child section to be edited directly (like a grid) so the user don't have to click on "new record" each time.
                for 1 screen I used a repeating section, while it is working I have a feeling that repeating section are not as flexible as other form of entries.
                I am thinking to use a list with an embeded grid (with live link). but now I am having issues with the primary key (being zero).
                Maybe a guid is good along with a trigger to updated the forein key???

                Thank you for your help

                Comment


                  #9
                  Re: Parent-Child Records In A Mobile-App

                  Grid does not work in mobile apps, I am also trying to find better grid alternative(there is this list but it lacks all features of grid), I hope alpha adds touch events to grid(save, edit, sort and filter.

                  Comment


                    #10
                    Re: Parent-Child Records In A Mobile-App

                    Originally posted by amitloh View Post
                    Grid does not work in mobile apps, I am also trying to find better grid alternative(there is this list but it lacks all features of grid), I hope alpha adds touch events to grid(save, edit, sort and filter.
                    Hi,
                    I am not specificaly looking for mobile compatibility,
                    This is what I am trying to reproduce:
                    imm.png

                    Comment


                      #11
                      Re: Parent-Child Records In A Mobile-App

                      is this android or iphone mobile app? I see you are looking for a grid with inline editing. If you are not looking for inline editing then you can use I guess lists provided you do want app to be published(not browser based application).

                      Comment


                        #12
                        Re: Parent-Child Records In A Mobile-App

                        Hi,
                        Thank you for your answer,
                        This is a browser app, Not a mobile one.
                        and I am looking for inline editing.
                        That's why i cant use list

                        Comment


                          #13
                          Re: Parent-Child Records In A Mobile-App

                          i am just curious,
                          if this is just a browser app, why you are not able to use an ux
                          with header and a repeating section?
                          thanks for reading

                          gandhi

                          version 11 3381 - 4096
                          mysql backend
                          http://www.alphawebprogramming.blogspot.com
                          [email protected]
                          Skype:[email protected]
                          1 914 924 5171

                          Comment


                            #14
                            Re: Parent-Child Records In A Mobile-App

                            Hi Ghandi,
                            I can use a ux with repeating section and works perfectly (I have done some other screens).
                            I am just afraid that at a certain point those repeating sections becomes obsolete and start giving errors :(
                            I am probably wrong and should keep doing it the old way "repeating sections".

                            Thank you for you answer

                            Comment


                              #15
                              Re: Parent-Child Records In A Mobile-App

                              I am just afraid that at a certain point those repeating sections becomes obsolete and start giving errors :(
                              would you be willing to elaborate?
                              thanks for reading

                              gandhi

                              version 11 3381 - 4096
                              mysql backend
                              http://www.alphawebprogramming.blogspot.com
                              [email protected]
                              Skype:[email protected]
                              1 914 924 5171

                              Comment

                              Working...
                              X