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

Display Google Map for a new record (before it is submitted/saved)

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

    Display Google Map for a new record (before it is submitted/saved)

    I have spent many hours trying to figure out how to display a google map for new records before they are committed. This is a grid component and works fine for existing records, but not new records.
    In my component, I get the latitude/longitude from fields that are populated when the user selects a city and state (this comes from a table that has all the cities in North America and includes lots of other info including the latitude/longitude)

    The alternate view builder expression says to use tbl.data("mylatitudefield"), but that is not populated for new records. I've tried changing tbl.data to every possible reference I can think of, and also tried session and state variables. Anything other than tbl.data seems to be ignored completely

    I've gone through tons of documentation and videos to no avail. Any suggestions or pointers are most appreciated

    Thanks, Dave

    V 4.5.4.5 Build 5221

    #2
    Re: Display Google Map for a new record (before it is submitted/saved)

    Ah so the key is to get the lat and lon for the NEW record! Once you have the address you can add a button to draw the marker OR after some event has taken place during the process. The trick would be figuring out when to run the code that the button would. To help you out it would be most helpful to know more about how and when you actually get the coordinates.
    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

    Comment


      #3
      Re: Display Google Map for a new record (before it is submitted/saved)

      The lat/long values are retrieved when the City field is filled out. City is a lookup field set as "auto-suggest" which populates multiple fields lat, long, state, etc. The screen shots show the lat/long as blank before the city is selected, and then populated after the city is selected. In this example, I'm using an alternate view to display the map, I've also done it through a button that calls a ux component using session and/or state variables. The map doesn't get called with the lat/long when it's a new record, but works fine when it's an existing record. I need to figure out how to get the lat/long values to the map definition when it's a new record

      dispatch1.jpgdispatch2.jpg
      Last edited by ids-dave; 09-30-2018, 08:47 AM.

      Comment


        #4
        Re: Display Google Map for a new record (before it is submitted/saved)

        put the code that the button would initiate to draw the map in the on change event (with a wait) of the city field. You'll probably need the wait to give it a split second to actually get the values in the lat and lon fields. In one of my UX's I created an actionscript action to "map the job" and then in the after select client side of the list I put the run action statement which then runs the code to map the job.
        In your case, you might be able to go to the "OnChange" event of the CITY field, create an action to map the location and then run that action there. Hope that helps and be sure to post back if you need any more help! Again, if it doesn't always "work" it could be a timing issue in which case you can convert it to text mode and add in a short wait time "Set time out" to fire the action, like 1000ms or 1500. I think it work without the set time out function but if not post back and maybe we can wrap it in a set time out function for you if your not familiar with that.
        NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

        Comment


          #5
          Re: Display Google Map for a new record (before it is submitted/saved)

          Well, it doesn't look to be a timing issue

          Only happens if it's a new record that has not been saved to the database

          I'm thinking the expression in the Marker Properties only get populated with tbl.data("myfieldlongitude") and tbl.data("myfieldlongitude") for existing rows - not new rows

          mapbuilder.PNG

          Comment


            #6
            Re: Display Google Map for a new record (before it is submitted/saved)

            I didn't know this was for an alternate view in a grid until now. It's not that the marker properties only get populated for existing rows, it is more a matter of when the code runs to add the markers. I don't know the exact code it would take but I am pretty sure it's doable by running the code again to display the alternate view - if that makes sense. I just looked at soem past posts and didn't see the answer pop out at me.
            There's probably a bunch of ways to do this though. Is your map in the detail view? Is this an editable grid? I am wondering where the alternate view is displayed out of curiosity.
            Last edited by CharlesParker; 10-01-2018, 06:53 PM.
            NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

            Comment


              #7
              Re: Display Google Map for a new record (before it is submitted/saved)

              Since you already have a map control - you can then/now create an action button and for it, create an action to refresh the map - then - you can actually fire off the button click in the onchange event for the city field like what you want. In the action button builder there is on the lower left a link to help with automation of the button click. I think that would be the easiest method to get what you want. I think the alternate view is as you said drawing the markers once, and you could do a grid refresh after but thats not really what your after here. You want to place a map marker prior to the save event.
              NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

              Comment


                #8
                Re: Display Google Map for a new record (before it is submitted/saved)

                To be as easy as possible - just add a button - create an ActionScript to add a marker to the map. View the javascript code - copy - paste into the onchange event for the CITY field and that should do it. You can hide the button if you want with a client side expression of 1=2
                I think that should do it.
                NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                Comment


                  #9
                  Re: Display Google Map for a new record (before it is submitted/saved)

                  I just tested what I am telling you and it worked as expected, in fact I created two actions. The first action cleared the existing markers and then the second action added a marker using local data (my address field). I placed the javascript (view javascript) from the button in the onchange event of another field and as I said it worked as expected. I hope that helps you figure it out.
                  NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                  Comment

                  Working...
                  X