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

List with detail view set initial values

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

    List with detail view set initial values

    Slowly changing over to lists with detail views, think they are great.

    However several of the fields need to have initial values set (some to argument values). Setting the default value in the field properties works until the new record button is pressed, I am thinking that adding some javascript to the click event for the new record button would be the answer, but cannot find a way of setting a javascript variable to the value of an argument. Anyone know how?

    #2
    Re: List with detail view set initial values

    Got this to work by setting state variables to the argument values in the onDialogInitialize server side event, then used javascript to set the initial value of the control from the new record button.

    Comment


      #3
      Re: List with detail view set initial values

      I came to the same conclusion. The default value setting for the textbox will not compute. It would be wonderful if the function call =api_uuidcreate() would simply work.

      Comment


        #4
        Re: List with detail view set initial values

        Setting values in "default value" in a UX should work for a new record... I do so all over my program...unless list/detail views function differently some how (I have yet to use a list/detail view).
        Mike Brown - Contact Me
        Programmatic Technologies, LLC
        Programmatic-Technologies.com
        Independent Developer & Consultant​​

        Comment


          #5
          Re: List with detail view set initial values

          Mike,

          The list/detail view does function differently simply because it is the list you are adding a new record to not the detail view and it follows the process of new record in the list = only the relevant primary key is updated so all the other fields in the detail view are blanked out (unless it is a child list/detail, then the parent link gets added as well), so you need the javascript to set the required values of certain fields.

          Comment


            #6
            Re: List with detail view set initial values

            Under List builder properties and under the Detail View tab there are Client Side Events and Server Side Events. I have used this with success setting Client Side Events.

            Comment


              #7
              Re: List with detail view set initial values

              So, to get a UUID in the key field for new rows, should I try to do a AJAX callback to an XBASIC that invokes api_uuidcreate()? Is there a simple call in javascript method to do this? I've tried the AJAX call back method but only get a "false."

              Comment


                #8
                Re: List with detail view set initial values

                Woot! Solution Found.
                in version Alpha Anywhere v3.
                This example sets the Client_ID in the detail section of a list control to a UUID.

                1. Create a simple XBasicfunction in the UX component.
                function getUUID as c(e as p)
                dim uuid as c
                uuid = api_uuidcreate()
                e._set.CLIENT_ID.value = uuid
                end function


                2. Edit the list control
                a. Select the list control,
                b. Select List Properties
                b. Select the Fields Tab
                c. Select the column to default to a UUID (CLIENT_ID in this case).
                d. Select Default Value JavaScript.
                e. Insert the call below, making sure you are calling the correct function name.
                {grid.Object}.ajaxCallback('G','{Grid.RowNumber}:all','getUUID','','',{deviceOfflineFunction: function() { }});

                Hint: you may need to create a button to have Alpha build the call for you via action JavaScript.
                Assumption: you built the input controls via the list builder "helper/wizard"
                Last edited by westridge; 12-11-2014, 07:32 AM.

                Comment


                  #9
                  Re: List with detail view set initial values

                  Selwyn has now added some features and flexibility to the setting of initial values for this. See the pre-release notes -- here's the first paragraph:

                  UX Component - Detail View - New Records - Default Values - When you define a List control with a Detail View you can specify Javascript code to return the default value for a field when a new record is created in the Detail View. A new option has been added to the List builder to allow you to automatically use the default value that was defined for the control to which the List field is bound for new record default values.
                  -Steve
                  sigpic

                  Comment


                    #10
                    Re: List with detail view set initial values

                    Thanks,

                    I had not noticed the default value settings for a list detail view in the list builder, works a dream.

                    Comment


                      #11
                      Re: List with detail view set initial values

                      I am trying to set the default value of two controls in the detail view of a list, One of the controls needs the default value to be set to a5ws_getcurrentuser() and the other to a session variable. IN a normal UX I would just put these default values in the properties of the field - in a list it seems impossible, can anyone give me a clue where to put the default value for these two fields?
                      I see a Detail view called
                      "DetailView value Javascript"
                      as well as the onpopulate event - either way nothing seems to work.

                      Help if you can, I need these two fields to submit these two values like PRONTO and I cannot figure out this list control crapola...would be nice if there were some decent documentation on this.

                      I would suggest they stop further development until they hire a guy JUST for documentation or something!
                      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


                        #12
                        Re: List with detail view set initial values

                        I see theres a default setting in the list builder for "Other Properties" that allows you to set the Default policy for new record in Detail View to "None"
                        well played - as None is all I get regardless - aggravated and going to bed...I just want to set the default value to a session variable and or a5ws_getcurrentuser()
                        Jeeeeeeez!
                        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


                          #13
                          Re: List with detail view set initial values

                          Charles in your UX components server side ondialoginitialize event set the value of some dialog object variables like
                          Code:
                          js="{dialog.object}._myvar=a5ws_getcurrentuser();"
                          then emit the the javascript with
                          Code:
                          e.javascript = js
                          Then in your list go to the fields tab under detail view properties edit the default value javascript to read
                          Code:
                          var fn = {dialog.object}._myvar;
                          return fn;
                          for the field you want to have your user name in.

                          You only need to do similar for your session variable by setting another dialog object variable.

                          Comment


                            #14
                            Re: List with detail view set initial values

                            I believe I followed your instructions, but the field did not populate with the variable. The one thing that I do not quite understand about this is where and what to do with the second part of emitting the js.
                            first I tried putting it following the first code snippet in teh on dialog initialize then I tried putting in the lists builders "quickaccess" javascript declarations.

                            This seems really complicated to me to simply set a default value of a field in a list control's detail view (even if it has a parent list) - when it is painfully simple throughout Alpha elsewhere.

                            What can I do to help you guys help me get this part ?
                            Thanks Lance for your help so far - it sounds like you have this working.
                            I really want to get this worked out tonight if possible.
                            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


                              #15
                              Re: List with detail view set initial values

                              Hi Charles,

                              The emit javascript section of code should be in the ondialoginitialize event.

                              If you are running this in live or working preview it will not work because you are not logged in, you need to publish it to your server and login so that the a5ws_getcurrentuser() has something in it.

                              Attached is a simple UX with a list and detail view that is based on the northwind database (change the connection string in the list to point to where ever you have northwinds). I have set the _myvar to ='John' in the ondialoginitialize so that a new record with put that in the first name field in working preview.

                              Hope you get it sorted
                              charles.a5wcmp

                              Comment

                              Working...
                              X