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

Show field on grid if session.__protected__ulink = '' (or null)

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

    Show field on grid if session.__protected__ulink = '' (or null)

    Hi,

    I'm trying to only show a column to a user if the user is not signed in i.e. if session.__protected__ulink is null/or ''

    I have tried the following in the show/hide expression, but either way it still shows the column once the user signs in:

    1) session.__protected__ulink = ''
    2) isnull(session.__protected__ulink) = .t.
    3) (session.__protected__ulink + '') = ''


    Please help

    Lee

    #2
    Re: Show field on grid if session.__protected__ulink = '' (or null)

    Are you doing server-side expressions? If not, you'll have to look into "publishing" the session variable to Javascript for client-side Show/Hide. If so, I *think* you could do this: convert_type(session.__protected__ulink,"C") = ""

    Comment


      #3
      Re: Show field on grid if session.__protected__ulink = '' (or null)

      Hi Chris,

      Thanks for replying... I'm doing client side. The standard grid doesn't have an option like the UX component for Server side.

      I did try the example you posted above, convert_type(session.__protected__ulink,"C") = "" , and it still shows the column when signed in... this has me very perplexed!

      Comment


        #4
        Re: Show field on grid if session.__protected__ulink = '' (or null)

        update: i tried to use (in the show/hide expression field of the client side properties of the grid) eval_valid("session.__protected__ulink") = .f. still didnt work.
        Why is it that I read prior posts that this works in other settings, but not in this box?

        Comment


          #5
          Re: Show field on grid if session.__protected__ulink = '' (or null)

          figured it out... (well i'm sure it is not a true way to do it but it works).
          I did it by manipulating the SQL statement. ie.

          SELECT *, :whatuser AS ulink FROM tbl etc...

          the field that i want to show only while logged in is then shown if the arguemnt "ulink" field is = '' -- works like a charm. although i'm sure i'm about to find out that there is some flaw about to come and slap my in the face..

          Regardless I'd like to know how I should have accomplished this...

          Comment


            #6
            Re: Show field on grid if session.__protected__ulink = '' (or null)

            That'll work as far as I know.

            Did you try looking up publishing session variables per my previous post? If I'm understanding correctly that you're trying to put this in the Client-Side Show/Hide expressions, you can't use XBasic or session variables because they are server-side. Use the show/hide expression smart button--the functions available to you there are the only ones available with the exception of writing your own javascript functions. This info as well as the info about publishing session variables is all there in the smart field links.

            There's Xbasic running on the server, pure Javascript running on the browser, and then there's these expressions that allow simpler-than-javascript entries that get converted by Alpha Five into pure Javascript functions when the component is saved and published.

            Comment


              #7
              Re: Show field on grid if session.__protected__ulink = '' (or null)

              Is there a reference on what are xbasic functions and which ones are not (i.e. js)?

              I see under the expression builder for the show/hide properties there are some functions listed. Is this an all inclusive list? or can we use the many other functions available to a5?

              I guess I simply forget that XB is not processed on the client and only html/js.

              I did attempt to publish the session variable on the client, but i didn't work when i tried to reference it. Likely because I declared it incorrectly.

              Comment


                #8
                Re: Show field on grid if session.__protected__ulink = '' (or null)

                That's the key--if it's client-side it has to be Javascript because any browser can process that, albeit slightly different on occasion. Only the server can process XBasic through an a5w page being loaded or some sort of Ajax callback to the server, many of which are built-in as validation checks, data submission, refreshing, etc.

                When you use A5's Javascript methods, it uses placeholders like {grid.object} and {row.number}, but those are simply placeholders in Javascript strings.

                I *think* the only place where there is client-side settings in A5 that doesn't use actual Javascript in the development is the client-side Show/Hide and Enable expressions. You have to read the information in that smart button dialog to see what's allowed there. The list there is all-inclusive unless you write your own Javascript function as referenced there.

                Comment


                  #9
                  Re: Show field on grid if session.__protected__ulink = '' (or null)

                  Thanks a ton for that explanation. This whole issue enticed me to take a 40 module basic JS course over the weekend. Although I feel a little more versed with JS I find i need to learn how to apply the JS with regards to A5 (i.e. where to write the function, how to call it, etc..).

                  Comment


                    #10
                    Re: Show field on grid if session.__protected__ulink = '' (or null)

                    I probably need to take that course too. Took me a while to get it too. At this point, I've added a lot of basic Javascript to our application for further user-friendliness/robustness, but I understand just enough to get it working and often add Javascript that works some places but not in others. And, Google and returned-search programming forums are your friend. Use them.

                    Comment


                      #11
                      Re: Show field on grid if session.__protected__ulink = '' (or null)

                      IMO - learn javascript SEPERATE from alpha.
                      A simple html page (in notepad) and <script> tags are all you need

                      Code:
                      <!doctype html>
                      <html>
                      <head>
                      <script>
                      function myJSFunction(){ 
                              alert('Hi im javascript');
                      }
                      </script>
                      </head>
                      <body>
                      <a href="#" onclick="myJSFunction(); return false;">Test</a>
                      </body>
                      </html>
                      WHen youre comfortable with this: create a javascript.js page.
                      Move your script to that page
                      and link to it from the html like this
                      <script src="javascript.js"></script> or <script src="js/javascript.js"></script> (It is better to put your files in a folder - keep it organized)
                      Scott Moniz - Computer Programmer/Analyst
                      REA Inc.
                      http://reainc.net
                      (416)-533-3777
                      [email protected]

                      REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
                      If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
                      contact us to discuss options.

                      Comment

                      Working...
                      X