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

Video D_SF_3 is missing a crucial bit of info

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

    Video D_SF_3 is missing a crucial bit of info

    Video D_SF_3 shows how to edit an existing security record however it is missing crucial info that is doing my head in!

    In the server side event "ondialoginitialize" a variable value is hardcoded as dim id as c ="1".

    This variable is used in the "Populate dialog from tables::loaduser" server side action to get the primary key of the security record.

    It's all very well to hardcode the variable in the video, but in reality the variable value will be... umm... variable!

    So admin users of my app can manage security I have a grid that shows security records. On click of a button I am opening a UX to edit the security record exactly as shown in the video.

    The bit I'm struggling with is how would one set the value of the id variable to the value of a record selected in a the grid? I wish that was explained in the video!

    Thanks, Richard.

    #2
    Re: Video D_SF_3 is missing a crucial bit of info

    Yes... I always thought this was so typically Alpha. Between this and the overuse of Static Data... you're always left with a bit of a gap... a "figure it out for yourself" methodology.

    In your Grid... when you select a security record, set a session variable to the value of your websecurityregisteredusers key.

    Then use that session variable in the Security UX for the value id.

    Code:
    dim id as c = session.currSecurityRegUser

    Comment


      #3
      Re: Video D_SF_3 is missing a crucial bit of info

      re:
      Between this and the overuse of Static Data...
      I must agree on this, nothing real world about static data.
      Insanity: doing the same thing over and over again and expecting different results.
      Albert Einstein, (attributed)
      US (German-born) physicist (1879 - 1955)

      Comment


        #4
        Re: Video D_SF_3 is missing a crucial bit of info

        Assuming you are working in Version 12, I would stay away from those old version 11 videos regarding security.

        For compatibility with IIS, and for going forward, you should probably look at using the Context.Security functions: https://www.alphasoftware.com/docume...urity%20object

        No videos show up about this in the video finder, yet, and if there are any on Viddler then they are impossible to find.

        You can create a new UX from "SecurityFramework-AdminDialog-Create_users_and_assign_roles" template, or one of the other "SecurityFramework*" templates to see how alpha uses those context.security functions.

        Let me apologize in advance if I am giving bad advice. I have just started updating my security UX's to use the new methods so the app will run under both IIS and the traditional WAS without code changes.

        Comment


          #5
          Re: Video D_SF_3 is missing a crucial bit of info

          Originally posted by peteconway View Post
          re:

          I must agree on this, nothing real world about static data.
          I find this comment totally baffling. I presume you are referring to the fact that in some of the videos on the List control we use static data rather than a sql data source.
          In these particular videos the data source is irrelevant -- That's why we use static data. Makes it easier for anyone to run the component and the point of the video was to show something unrelated to the data. Ultimately all of the data in a List is JSON and it is irrelevant if this json comes from a static data source or from a sql query.

          In the cases where the data source IS relevant (i.e. we are trying to demonstrate a CRUD action for example), we typically use the a SQL datasource and often use Northwind since everyone has that.

          Comment


            #6
            Re: Video D_SF_3 is missing a crucial bit of info

            Good point. And just loading data from sql database (or other) does not make data dynamic.

            Comment


              #7
              Re: Video D_SF_3 is missing a crucial bit of info

              Thanks David,

              I got it working as you suggested using a session variable. I set the session variable on login.

              However I also noticed the following "help" in the ondialoginitialize

              e.arguments = SQL::Arguments object with values for each of the arguments defined in this component. To read a value from arguments: e.arguments.find("argumentName").data. At first I didn't think it was relevant because of the reference to "SQL" but as you probably know it actually exposes the arguments passed into the UX.

              So the approach I ended up going with was:

              On the Edit User UX I defined an argument called ARGUSERID
              This arg is set to the UserID field in my calling grid.
              Then I set the id variable in the ondialoginitialize event like this: dim id as c = e.arguments.find("ARGUSERID").data

              I also use ARGUSERID in the ExecuteServerSideAction("Load Web Security Values::LoadSecurity") action script "Find by Value Source" parameter.

              Comment


                #8
                Re: Video D_SF_3 is missing a crucial bit of info

                All,
                In post #4, I suggested using the newer context.security properties and methods. However, let me mention these caveats:

                1) When running your app under "Working Preview", the "context" object does NOT exist, but it does exist under "Live Preview" (with security assumed to be off and no access to the defined groups/roles). So, either stick to "Live Preview" for debugging or write your code to check for existence of the "context" object before trying to reference any of its properties or methods.

                2) The a5ws_Get_Groups() function DOES work under Working Preview to return a list of defined roles/groups, which is quite nice since the similar "context.security.GetRoles" method fails under w/p because of (1) above.

                3) The a5ws_Get_Groups() function knows to return the GUID id of the group/role after the name when running under traditional WAS. Under IIS it returns just the group_name because we are not supposed to be concerned with group/role GUIDs under IIS. The unusual thing to be aware of is it also omits the Role GUIDs when running under Working Preview or in the Interactive window. To match what happens when running under traditional WAS, I would have expected the GUIDs to be included under w/p and interactive mode. However, it may have been decided to omit the GUID under w/p and interactive mode because when converting a project to support an IIS publishing profile, all the internal Role GUIDs referenced by your components and pages are replaced with the Role/Group Name.

                4) Both a5ws_Get_Groups() and context.security.GetRoles return a blank string when running under "Live Preview".

                5) context.security.get_groups() does not return the original GUID (or any GUID), so if you are running under traditional WAS and you still need to read/write user role membership using a GUID then you will probably have some difficulty.
                Last edited by RichCPT; 08-02-2018, 04:39 PM. Reason: added # 5

                Comment

                Working...
                X