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

Disconnected Cascading Dropdowns

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

    Disconnected Cascading Dropdowns

    I have a requirement to build cascading drop-downs for an App that's intended to work in disconnected mode. It seems that the built-in functionality uses only AJAX, so that won't work.

    Also, the built-in functionality doesn't seem to work with Lists with Detail Views, which my app also uses. Specifically, when I switch between items in the list, the drop down list that is filtered doesn't update its list.

    What's the best way to make a cascading drop down that will work with both a List's Detail View and in disconnected mode?

    Note, the total number of items in the drop down list to be filtered is not so long, so caching this data locally should not be an issue.

    -Kevin

    #2
    Re: Disconnected Cascading Dropdowns

    I posted a message about this just yesterday.

    https://forum.alphasoftware.com/show...-local-storage
    -Steve
    sigpic

    Comment


      #3
      Re: Disconnected Cascading Dropdowns

      Originally posted by Steve Workings View Post
      I posted a message about this just yesterday.

      https://forum.alphasoftware.com/show...-local-storage
      I saw it, though my requirements are a slightly different, so I posted my own. Hope someone replies!

      Comment


        #4
        Re: Disconnected Cascading Dropdowns

        You need to set them up in the Client Side Data Cache of the UX in the Pre-release build.
        2016-03-30_1458.png
        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: Disconnected Cascading Dropdowns

          Uh huh. And for those of us who are working with clients who cannot use a pre-release build, and still seek the javascript to do this, the question seems to remain open.
          -Steve
          sigpic

          Comment


            #6
            Re: Disconnected Cascading Dropdowns

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

            Comment


              #7
              Re: Disconnected Cascading Dropdowns

              Would using the pre-release build fix the issue with List Detail View bound drop down controls too?

              Comment


                #8
                Re: Disconnected Cascading Dropdowns

                What issue is causing you problems with dropdowns in detail view Kevin
                Insanity: doing the same thing over and over again and expecting different results.
                Albert Einstein, (attributed)
                US (German-born) physicist (1879 - 1955)

                Comment


                  #9
                  Re: Disconnected Cascading Dropdowns

                  If the cascading drop downs do are bound as part of the list control's detail view, switch between items in the list does not cause the drop doen to refresh its list.

                  For example, let's say I have a list of International addresses. In the detail list, there is a Country and a Province/State field configured as a cascading drop down (filtered by country). With the app running, I enter a Canadian address. After selecting Canada in the furst drop down, the State/Province combo box populates correctly. Now, suppose I select an existing American address in the list that was created in a previous session. The state/province's drop down's list doesn't get updated, it's still displaying Canadian provinces. What's worse, because the state that had been entered for that American address is not in the drop diwn lists options, it gets overwritten.

                  Comment


                    #10
                    Re: Disconnected Cascading Dropdowns

                    Is this in a mobile device using phonegap or a browser?
                    Insanity: doing the same thing over and over again and expecting different results.
                    Albert Einstein, (attributed)
                    US (German-born) physicist (1879 - 1955)

                    Comment


                      #11
                      Re: Disconnected Cascading Dropdowns

                      Originally posted by peteconway View Post
                      Is this in a mobile device using phonegap or a browser?
                      Browser

                      Comment


                        #12
                        Re: Disconnected Cascading Dropdowns

                        OK ill take a look tomorrow for you.
                        Insanity: doing the same thing over and over again and expecting different results.
                        Albert Einstein, (attributed)
                        US (German-born) physicist (1879 - 1955)

                        Comment


                          #13
                          Re: Disconnected Cascading Dropdowns

                          The prerelease build is too unstable right now, even for an application that's in Beta. Trying it, a ran into two crippling bugs. Maybe if they had a stable-ish pre-release, instead of nightly builds.

                          For now, I'm going to work around the issue by using an invisible list control to download the data. Then I can read the data from the list to filter and populate the dropdown as-needed.

                          Comment


                            #14
                            Re: Disconnected Cascading Dropdowns

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

                            Comment


                              #15
                              Re: Disconnected Cascading Dropdowns

                              In response to post #9 of this thread:
                              I am also seeing the issues Kevin sees when two cascading dropdown controls are placed onto a list's detail view. I believe, I found a solution for the case where the app does not need to run in disconnected mode.
                              I am posting it here, in case someone finds this helpful:

                              The two controls are called LocationCategoryId (the parent control) and LocationId (the child control whose dropdown list should be filtered by the value in the parent control). These two controls have been placed on the panel that displays the detail view of a list called "Activities".

                              I have set the two controls up as normal dropdown controls. The child control gets the initial dropdown list from a sql statement. "Cascading choices" is off for this control. (The parent control gets its dropdown list from a variable, but I don't think that matters.)

                              On the panel that displays the "Activities" list I have a button that slides in the detail view for the selected record. It has this code in the onClick event:

                              Code:
                              //We will use the refreshDropdownBoxChoices method to filter the dropdown list of
                              //the LocationId control on the detail view we are about to open, by the value in the 
                              //LocationCategoryId control
                              
                              //From Alphapedia:
                              //{dialog.Object}.refreshDropdownBoxChoices(controlName [[,dynamicFilter [[,dynamicFilterArguments [[,selectedValue [[,currentRowOnly]]]]);
                              //refresh the choices and filter choices to only show items where the 'type' field is 'a' and 'code' field is 'x'
                              //{dialog.object}.refreshDropdownBoxChoices('PRODUCTS','type=:whatType and code = :whatCode','a|||c|whatType\nx|||c|whatCode');
                              //Note that in the above example the dynamicFilterArguments is a crlf delimited string (\n is the CRLF code in javascript) of the form
                              //value|||datatype|argumentname
                              
                              var detailLocationCategoryId = {dialog.Object}.getValue('list::ACTIVITIES::LocationCategoryId');
                              var detailLocationId = {dialog.Object}.getValue('list::ACTIVITIES::LocationId'); 
                              {dialog.object}.stateInfo['si_detailLocationCategoryId'] = detailLocationCategoryId.toString();
                              {dialog.object}.stateInfo['si_detailLocationId'] = detailLocationId.toString();
                              
                              function func1() {
                              	{dialog.object}.refreshDropdownBoxChoices('LocationId', 'LocationCategoryId = :argLocationCategoryId', detailLocationCategoryId + '|||n|argLocationCategoryId', detailLocationId);
                              };
                              function func2() {
                              	{dialog.object}.panelSetActive('PC_ACTIVITIES_DETAIL');
                              };
                              A5.executeThisThenThat(func1, func2);
                              This refreshes the dropdown list of the child control and puts the correct value into it - otherwise the child control would be blank. I am also storing the original values of the parent and the child control in the stateInfo object. I will use these to address the issue that the value in the child control gets overwritten when the user changes the value of the parent control. Note that the refreshDropdownBoxChoices method won't work for disconnected apps.

                              The onChange event of the LocationCategoryId control (i.e. the parent control) contains the following code:
                              Code:
                              var originalLocationId         = {dialog.object}.stateInfo['si_detailLocationId'];
                              var originalLocationCategoryId = {dialog.object}.stateInfo['si_detailLocationCategoryId'];
                              
                              var currentValueInLocationCategoryId = {dialog.object}.getValue('LOCATIONCATEGORYID');
                              
                              //If the current value in the LocationCategoryId control equals the original one that was put into the 
                              //stateInfo object when the user clicked the "Details" button on the Activities list panel, we will put 
                              //the original LocationId back into the LocationId control.
                              
                              //Or rather, we'll ask the refreshDropdownBoxChoices function to set this value.
                              
                              if (currentValueInLocationCategoryId === originalLocationCategoryId) {
                              		{dialog.object}.refreshDropdownBoxChoices('LocationId', 'LocationCategoryId = :argLocationCategoryId', originalLocationCategoryId + '|||n|argLocationCategoryId', originalLocationId);
                              } else { 
                              	//if it isn't we'll leave the value in the LocationId control blank.
                              		{dialog.object}.refreshDropdownBoxChoices('LocationId', 'LocationCategoryId = :argLocationCategoryId', originalLocationCategoryId + '|||n|argLocationCategoryId','');
                              }
                              Finally, I put the following code into the onClick event of the detail view's "Reset" button:

                              Code:
                              {dialog.object}.setValue('LOCATIONCATEGORYID',{dialog.object}.stateInfo['si_detailLocationCategoryId']);
                              {dialog.object}.setValue('LOCATIONID',{dialog.object}.stateInfo['si_detailLocationId']);
                              
                              var lObj = {dialog.object}.getControl('ACTIVITIES');
                              lObj.resetForm({prompt: true});
                              When the user changes the value in the parent control, the value in the child control gets lost. This ensures it gets put back when the user clicks the reset button.

                              Comment

                              Working...
                              X