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

OFFLINE: Lookup field value in another UX list control with edit combo box

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

  • OFFLINE: Lookup field value in another UX list control with edit combo box

    Hi,

    I have multiple list controls in my offline ux.
    "List1", "List2" & "List3"

    "List1" has no "records" whilst in offline and i want to capture a new record.
    "List3" was pre-populated from my sql database BEFORE the app went offline. Records are available in detail view whilst offline.

    I need to create a edit combo box lookup from field A in "List1" to field A in the data source "List3"

    "List3" will be the data source for "list1" if and when an edit combo box for a field is defined.

    How do i configure edit combo box in the detail view of "List1" to lookup the values from the source "List3"?

    Your assistance will be appreciated

  • #2
    Re: OFFLINE: Lookup field value in another UX list control with edit combo box

    Do you have to use an text control configured as an edit combo box?

    If you could use a DropdownBox control, then you could populate it with a Javascript function which would grab data from List3. I'm not sure if an edit combo box can do that.

    Basically... all you want to do is use List3 as the source of a dropdown control while building a new record for List1... is that right?

    Comment


    • #3
      Re: OFFLINE: Lookup field value in another UX list control with edit combo box

      Originally posted by Davidk View Post
      Do you have to use an text control configured as an edit combo box?

      If you could use a DropdownBox control, then you could populate it with a Javascript function which would grab data from List3. I'm not sure if an edit combo box can do that.

      Basically... all you want to do is use List3 as the source of a dropdown control while building a new record for List1... is that right?
      Dave,

      Correct, drop down box will suffice. I just want to use List3 as the source for List1 new record data.

      Comment


      • #4
        Re: OFFLINE: Lookup field value in another UX list control with edit combo box

        Attached is a UX showing how to populate a DropdownBox control from a List control. I've used static data in the Lists but that shouldn't matter... I'm just getting data from a loaded List. You'll need to change the names of the object properties used in the code. My test List3 is State names and abbreviates... which you'll see in the code.

        The DropdownBox control starts out with an empty row which I've added... and the .populateDropdownBox() method does not clear this out. The code which populates the dropdown is...

        Code:
        var lObj = {dialog.Object}.getControl('LIST3');
        var lData = lObj._data;
        var stateData = lData.map(function(a){
         	return [a.StateName,a.StateAbbr];
        });
        {dialog.Object}.populateDropdownBox('State',stateData,false);
        ux_List1_Dropdown_List3.a5wcmp

        Comment


        • #5
          Re: OFFLINE: Lookup field value in another UX list control with edit combo box

          Dave

          It does exactly what i needed. It keeps the "downloaded" choices and adds the "new" records captured during the offline status. Great stuff.

          Question;
          How do you propose i "lookup and fill" the rest of the field based on the offline dropdown box. Do i do it in the same code you provided?

          List1 fields = SiteName (dropdown box, List3 as source), Address (Auto fill with SiteAddress), ContactName (Auto fill with SiteContactName)
          List3 fields = SiteName (offline source), SiteAddress, SiteContactName

          Comment


          • #6
            Re: OFFLINE: Lookup field value in another UX list control with edit combo box

            Since the DropdownBox control can hold only 2 columns of data, you'll need to back to List3 to get more data. So, you might as well get the key for List3 from the dropdown and the balance of the data from List3... which means loading the dropdown with just 1 column of data.

            The code is below and a UX is attached which now mimics your columns... but I have to ask why use a List control as a data source? Just curious. Is this anything to do with the Lookup Fields features just added to Alpha? Is this a PhoneGap Build app? Does List3 do anything more than provide data for List1?

            Code to populate the dropdown...

            Code:
            var lObj = {dialog.Object}.getControl('LIST3');
            var lData = lObj._data;
            var siteData = lData.map(function(a){
             	return [a.SiteName];
            });
            {dialog.Object}.populateDropdownBox('SiteName',siteData,false);
            onChange event of the dropdown. Lots of ways to get this data... this is just one way...

            Code:
            var list3Key = this.value;
            var lObj = {dialog.object}.getControl('LIST3');
            var siteAddress = lObj.getData(this.value).SiteAddress;
            var siteContactName = lObj.getData(this.value).SiteContactName;
            {dialog.Object}.setValue('SiteAddress',siteAddress);
            {dialog.Object}.setValue('SiteContactName',siteContactName);
            You'll note in the attached UX that the DropdownBox control is configured is bit differently. There is no static data entered... no pipe... since it's just one column populating this control now.

            The onChange event of the dropdown gets the value selected and then goes after List3 for the balance of the data.
            ux_List1_Dropdown_List3.a5wcmp

            Comment


            • #7
              Re: OFFLINE: Lookup field value in another UX list control with edit combo box

              Hi David,

              My client has requested a true offline app whereby field workers can "download" specific data from sql on their laptops. this data should then be persisted on the laptop for up to a week at a time without any communication to the sql db. Once a week they will sync back to the server.

              The strategy here is;
              Create a UX with a list representing the sql tables required for field workers to capture what they need whilst still complying to certain validations i.e. "no duplicate clients" etc.

              the client can also at any time "update" or change data in one of these tables. by doing this they will request field workers to only refresh this table from the server and not everything.

              The above is working great thus far and my only challenges is;
              1 - Once the list is populated from sql and the field worker goes offline, the list becomes the source for all fields[List3 = Client table]
              2 - A second list becomes the source for a series of "cascading with explicit filtering"[List4 = Substrates]. This became problematic due to the "auto" population of field data/options. A call back is required once a field value is required on an explicit filtering method. Cascading lists does not [in my experience] pre-populate these field options.
              3 - In the app a client is "captured" with some specific requirements captured as part of the client site visit. These fields obtain their values from the other "lists".

              ALL of this happens whilst there is NO callback to the server.

              I hope i made sense in the above, but the logic is the following;
              By using the UX component with Lists controls, i don't need to create localised sql dbs and backend sql sync procedures with i.e. sync framework etc. The maintenance and admin overheads would be just to great as this will be utilised by about 340 people in the field.

              Comment


              • #8
                Re: OFFLINE: Lookup field value in another UX list control with edit combo box

                Sorry David, i forgot to answer your question;

                The app has 6 lists of which only 2 of them are used during the capture period. The other 4 are ONLY source of field data to these 2 lists.

                Lists in app;
                List 1 = Client capturing / information
                List 2 = Specification capturing / Information
                List 3 = Substrates Information [only a source of information to List 2 using explicit filtering on cascading controls] multiple fields
                List 4 = Primer Information [only a source of information to list 2 using explicit filtering on cascading controls] 1 field only
                List 5 = TopCoat Information [only a source of information to list 2 using explicit filtering on cascading controls] 2 field only
                List 6 = Waterproof information [only a source of information to list 2 using explicit filtering on cascading controls] 1 field only

                The client list is the 1st list appearing in the app followed by a cascading "specifications" list. You require a client before you can capture the specification for that client.

                Comment


                • #9
                  Re: OFFLINE: Lookup field value in another UX list control with edit combo box

                  David,

                  I'm most probably being daft, but i can't seem to get your "fill" code to work on mine. The only difference between them as i see, is the source field name is different than the populate field.

                  you're code

                  debugger;
                  var list3Key = this.value;
                  var lObj = {dialog.object}.getControl('LIST3');
                  var siteAddress = lObj.getData(this.value).SiteAddress;
                  var siteContactName = lObj.getData(this.value).SiteContactName;
                  {dialog.Object}.setValue('SiteAddress',siteAddress);
                  {dialog.Object}.setValue('SiteContactName',siteContactName);

                  My code

                  debugger;
                  var ClientKey = this.value;
                  var lObj = {dialog.object}.getControl('CLIENT');
                  var clientcontact = lObj.getData(this.value).ContactName;
                  var clientofftel = lObj.getData(this.value).ContactOffTel;
                  {dialog.Object}.setValue('clientcontact',clientcontact);
                  {dialog.Object}.setValue('clientofftel',clientofftel);

                  I attached my ux for you to see
                  Attached Files

                  Comment


                  • #10
                    Re: OFFLINE: Lookup field value in another UX list control with edit combo box

                    Your CLIENT list is set to return the PrimaryKey... which is ClientID. So, the code to load your DropdownBox control would have to be changed to...

                    Code:
                    return [a.BusinessName,a.ClientID];
                    Now... "this.value" will be the ClientID... which is the key into the CLIENT List control.

                    You don't need "var ClientKey = this.value;"... it's not being used. I forgot to delete it from my code.

                    If this is a PhoneGap Build app I wouldn't use List controls as data sources. I'd use a SQLite database stored on the device... or store the data you need in the local filesystem. There are several methods available for storing data other than using a List control. The List control is great, but as a data store it's a bit heavy.

                    What version/build of Alpha are you using?

                    Comment


                    • #11
                      Re: OFFLINE: Lookup field value in another UX list control with edit combo box

                      Thanks Dave, I actually thought "this.value" reads the value chosen in the dropdown box as the key value.
                      I will test and provide you with feedback

                      Comment


                      • #12
                        Re: OFFLINE: Lookup field value in another UX list control with edit combo box

                        Dave,

                        It's not a phonegap app. I'm using the UX and offline capabilities for a desktop app. It does actually work well, especially if i use the HTML page function to start the app without the sql connection. There is little niggles that is beyond me, but i'm trying to resolve them as they pop up.

                        Do you propose another way this can be hosted on localised devices [laptops/desktops]?

                        Comment


                        • #13
                          Re: OFFLINE: Lookup field value in another UX list control with edit combo box

                          Originally posted by CLaubscher View Post
                          Thanks Dave, I actually thought "this.value" reads the value chosen in the dropdown box as the key value.
                          I will test and provide you with feedback
                          Yes... that's right... in the onChange event of the DropdownBox, this.value is the selection made by the user. That value is then used to get the appropriate row from the List. We're actually using this.value throughout the code instead of assigning it to a variable.

                          Comment


                          • #14
                            Re: OFFLINE: Lookup field value in another UX list control with edit combo box

                            Dave,

                            Attached is my UX (OfflineFill) with the the 2 relevant lists. It just does not work and I've searched the message board for answers / examples. I saw a few where you explained exactly the same.

                            Does it NOT make a difference if my list data is actually SQL data and yours static.
                            Attached Files

                            Comment


                            • #15
                              Re: OFFLINE: Lookup field value in another UX list control with edit combo box

                              Your DropdownBox control onChange event code is wrong. You have...

                              Code:
                              debugger;
                              //var list3Key = this.value;
                              var listObj = {dialog.object}.getControl('LIST1');
                              var ClientContact = listObj.getData(ClientID).ContactName;
                              var ClientOffTel = listObj.getData(ClientID).ContactOffTel;
                              {dialog.Object}.setValue('clientcontact',ClientContact);
                              {dialog.Object}.setValue('clientofftel',ClientOffTel);
                              ,
                              Where ClientID is not defined... and you have an extra comma at the end of the code.

                              The code should be...

                              Code:
                              var listObj = {dialog.object}.getControl('LIST1');
                              var ClientContact = listObj.getData(this.value).ContactName;
                              var ClientOffTel = listObj.getData(this.value).ContactOffTel;
                              {dialog.Object}.setValue('clientcontact',ClientContact);
                              {dialog.Object}.setValue('clientofftel',ClientOffTel);
                              and... you don't have the Return value type property set in LIST1. Set that to PrimaryKey... and all is good. Attached is your corrected, working UX. In some cases there may be a difference between working with Static Data and SQL Data. In this instance there is no difference.

                              Dropdown_Fill.a5wcmp

                              Comment

                              Working...
                              X