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

dialog.isLoggedIn issue

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

    dialog.isLoggedIn issue

    I have setup Alpha Security. Now I have a login page, etc pointing to the SQL server tables [all these were automatically created by Alpha when I set the security to SQL Database, etc.] Also added some test accounts (all in administrator group for now.)
    On successful login I have specified to go to another page say my_page.a5w. Also added this page to the page security with the login required option.
    With incorrect login, as expected I get the error message.
    When I successfully login, I get redirected to that above page.
    So far so good.
    The problem is that when I get redirected to that above page, it is not able to access dialog.isLoggedIn value on that page.
    The error message is
    "dialog.isLoggedIn = undefined" or "Error: dialog is not defined"
    What could be the reason? Thanks.

    #2
    Re: dialog.isLoggedIn issue

    Have u set security for components?

    Comment


      #3
      Re: dialog.isLoggedIn issue

      For components I have set no security [Always allowed for my current component] as the wrapper my_page.a5w page has the security set. Just to test after your post - I tried both ways [the Components security for this component off and on], published and restarted the app server. No difference. It is still failing at dialog.isLoggedIn.

      if (dialog.isLoggedIn == true)
      {alert("The value is true"); // plus other custom logic}
      else
      {alert("The value is false"); // plus other custom logic}

      Comment


        #4
        Re: dialog.isLoggedIn issue

        How do I find out within an UX component if I am (or user is) logged on. I have a UX that we need to access using both logged in and when not logged in mode. I need to hide some functionally and use some type of indicator in javascript that I am logged in or not. Since I am not able to use dialog.isLoggedIn - is there any other variable or function available? Kindly let me know, Thanks.

        Comment


          #5
          Re: dialog.isLoggedIn issue

          Any help? I appreciate your time. Thanks!

          Comment


            #6
            Re: dialog.isLoggedIn issue

            Have you tried using {dialog.object}.IsLoggedIn The property is associated with the dialog object the pointer to which is accessed by the {dialog.object} syntax.
            Brad Weaver, President
            ComputerAid International
            Ottawa ON Canada
            Versailles KY USA
            www.compuaid.com

            Comment


              #7
              Re: dialog.isLoggedIn issue

              I do not have version 12 so I do not even know about {dialog.object}.isLogggedIn function.
              the problem I see is in logic, that is what I am pointing out. the methods, as I mentioned are foreign to me.
              The problem is that when I get redirected to that above page, it is not able to access dialog.isLoggedIn value on that page.
              you said you have a login and on successful login you will be directed to another page and then you are trying to find out about the {dialog.object}. isLoggedIn. naturally you will get error since the dialog does not exist any more and all things with the dialog are gone. possible alternative would be to set the a variable loggedin and pass that variable to the new page
              or
              stay in the same dialog and do what ever you are doing in that page and you will have access to that value since the dialog is still open.
              thanks for reading

              gandhi

              version 11 3381 - 4096
              mysql backend
              http://www.alphawebprogramming.blogspot.com
              [email protected]
              Skype:[email protected]
              1 914 924 5171

              Comment


                #8
                Re: dialog.isLoggedIn issue

                Here's what you need to do to accomplish what you're asking: in the Server Side events of each UX component that you need to have special functionality visible for logged in users add the following code in both the OnDialogInitialize and OnDialogSynchronize events. You have to add it to both because if you cache the component then the first time it is called the OnDialogInitialize fires but on subsequent calls the OnDialogSynchronize fires instead.

                Code:
                dim un as c
                un = a5ws_getcurrentuser()
                'If a userID is returned then the user is logged in
                'Set a flag in the dialog State that can be accessed by client side javascript
                if un <> "" then	
                	session.IsLoggedIn = 1
                else
                	session.IsLoggedIn = 0
                end if
                Now on the client side you first need to publish the session variable so it is visible to javascript and client side events. Wrap any control or controls on your component that you want to hide in Containers and then on the container click the event handler for Client Side Show/Hide expression. In the dialog box that pops up click the link on the lower right side to Publish Session Variables. Enter the variable SESSION.ISLOGGEDIN in all caps (case is important) and then click Okay. Now in any of your Show/Hide events for your containers just type in SESSION.ISLOGGEDIN = 1. This will show the controls that are wrapped in the containers only when the component is being used by a logged in user and hide them from all others. When you close the dialog the first time you'll be reminded that you've referenced a session variable and that you must publish it to make it visible. Since you've already done this you can ignore the message.

                This same technique is useful as a substitute for the Server Side security show/hide options which can really take their toll on the time it takes to open a component. Instead I create Session variable flags for the groups that a user belongs to and then use those flags to do client side show/hide events which eliminates having to recalculate the UX component every time it opens based on security.
                Last edited by compuaid; 07-15-2014, 07:57 AM.
                Brad Weaver, President
                ComputerAid International
                Ottawa ON Canada
                Versailles KY USA
                www.compuaid.com

                Comment


                  #9
                  Re: dialog.isLoggedIn issue

                  if you choose to do the same without a session variable when dialog initializes assign a field value( hidden field) and all the controls can be in one frame and frame is hidden if that field is empty.
                  thanks for reading

                  gandhi

                  version 11 3381 - 4096
                  mysql backend
                  http://www.alphawebprogramming.blogspot.com
                  [email protected]
                  Skype:[email protected]
                  1 914 924 5171

                  Comment


                    #10
                    Re: dialog.isLoggedIn issue

                    The problem I ran into with the hidden field method (which I tried initially) is that the dialog will only initialize them in the OnDialogInitialize event. If the status changes and you reopen a cached dialog the hidden fields do not refresh even if you add the same code to the OnDialogSynchronize event so the only way I've found to consistently refresh is the method I described using session variable assignments. The other nice thing about session variable assignments is you don't end up cluttering your form designer with hidden fields so you can focus on the actual fields on the form.
                    Brad Weaver, President
                    ComputerAid International
                    Ottawa ON Canada
                    Versailles KY USA
                    www.compuaid.com

                    Comment


                      #11
                      Re: dialog.isLoggedIn issue

                      Brad/Gandhi, Thank you so much. I will try now.

                      Comment


                        #12
                        Re: dialog.isLoggedIn issue

                        Thanks! Server side a5ws_getcurrentuser() will be helpful in my logic. I will set my required values using that and/or may be update some client side variable using that. Appreciate your help!

                        function serverside_78c653353224bc05947feca2y77d as c (e as p)
                        serverside_78c653353224bc05947feca2y77d = "alert(' Current User is: " + a5ws_getcurrentuser() + "');"
                        end function

                        Comment

                        Working...
                        X