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

Dropdownbox ver9 web

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

    Dropdownbox ver9 web

    I have two tables, each have the same field called "ID", I am using the grid to insert a new record in the second table. Everything is working great except for...

    I have a drop down box that is displaying records from the first table field called outcomeid ... I want to filter the dropdownbox so that it only displays the records that the logged in user "ID" is able to see... Right now it displays all records in the table.

    I am sure there is a easy fix, but slowly going crazy!!

    #2
    Re: Dropdownbox ver9 web

    This is a slightly different question than you asked in the PM. Same answer though - you CANNOT filter a dropdown by any variable using the Filter setting. The only way to get a dynamic filter is to build your dropdown in the A5W page and set it to a variable. Then use the variable to define the dropdown selections.

    In your case here, it might look like this?

    myvar=table.external_record_content_get("[PathAlias.ADB_Path]\mytable","MyField","Myfield","id="+quote(session.__protected__ulink))

    Which would give you a crlf delimited list of 'MyField' in order by 'MyField' and filtered by who was logged in, assuming the ID in the source table contained the logged in users 'ulink'.
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: Dropdownbox ver9 web

      So I would set it up on the .a5w page the variable right... then setup the filter in the grid to be as follows..


      ID=myvar

      Comment


        #4
        Re: Dropdownbox ver9 web

        It's kinda hidden -

        Choices > List Type=Dynamic > Data Source Type=variable

        And then insert the var name.
        Steve Wood
        See my profile on IADN

        Comment


          #5
          Re: Dropdownbox ver9 web

          I found the place to put the variable, but when i run the page nothing come up.

          Comment


            #6
            Re: Dropdownbox ver9 web

            Test it first, with myvar="ABC" in the A5W page.

            Then if that works, its the expression. Try building the expression in an Interactive window until it appears correct.
            Steve Wood
            See my profile on IADN

            Comment


              #7
              Re: Dropdownbox ver9 web

              Doesn't work... I know I am missing something.. here is the code...

              <html>
              <head>

              <%a5
              a5w_include("header.a5w")
              myvar=table.external_record_content_get("[PathAlias.ADB_Path]\b_desireoutcome","outcomeid","outcome","id="+quote(session.__protected__ulink))
              'SYSTEM GENERATED COMMENT - PLEASE DO NOT REMOVE - Start Ajax1----------------------------------
              'Test to see if we are in an Ajax callback............................................................
              dim componentAlias as c
              'The componentAlias MUST be UNIQUE for each component on the page.
              'The componentAlias must not have any spaces in the name. Try to keep the componentAlias as short as possible.
              componentAlias = "b_goals_add"
              dim request.variables.__ajax as c = default ""
              dim request.variables.__formID as c = default ""
              'If it is an ajax callback for another component, then don't run this component.
              dim flagMustExecuteComponent as l = .t.
              if request.variables.__ajax = "true" then
              if word(request.variables.__formID,1,".") <> componentAlias then
              flagMustExecuteComponent = .f.
              end if
              end if
              'End test............................................................................................
              if flagMustExecuteComponent = .t. then
              Delete tmpl_GridLinker
              DIM tmpl_GridLinker as P
              tmpl_GridLinker = a5w_load_component("b_goals_add") 'SYSTEM GENERATED COMMENT - PLEASE DO NOT REMOVE (LOAD:b_goals_add)
              '=======================================compute the HTML for the Component=======================================
              delete x_GridLinker
              dim x_GridLinker as p
              x_GridLinker = a5w_run_Component(tmpl_GridLinker) 'SYSTEM GENERATED COMMENT - PLEASE DO NOT REMOVE (RUN:tmpl_GridLinker)
              'SYSTEM GENERATED COMMENT - PLEASE DO NOT REMOVE - Ajax2----------------------------------
              dim x_GridLinker.IsAjaxResponse as l = default .f.
              if x_GridLinker.IsAjaxResponse = .t. then
              'Discard any pending text in the output buffer.
              *output_rewind()
              ?x_GridLinker.Ajaxresponse
              end
              end if
              '=============================================================================================================
              if x_GridLinker.signedinuser.RedirectURL <> "" then
              response.redirect(x_GridLinker.signedinuser.redirectURL)
              end
              end if
              if x_GridLinker.b_goals_adddetail.RedirectURL <> "" then
              response.redirect(x_GridLinker.b_goals_adddetail.redirectURL)
              end
              end if
              end if 'end flagMustExecuteComponent test
              'SYSTEM GENERATED COMMENT - PLEASE DO NOT REMOVE - End Ajax1----------------------------------

              dim request.variables.__ajax as c = default ""
              'Only emit if not in an Ajax callback.
              if request.variables.__ajax = "" then
              ?x_GridLinker.signedinuser.Output.Head.JavaScript
              ?x_GridLinker.b_goals_adddetail.Output.Head.JavaScript
              ?x_GridLinker.signedinuser.Output.Head.CSS_Link
              ?x_GridLinker.b_goals_adddetail.Output.Head.CSS_Link
              end if

              %>
              <!--Alpha Five Temporary Code Start - Will be automatically removed when page is published -->
              <!--CSS for tmpl_GridLinker -->
              <link rel="stylesheet" type="text/css" href="file:///C:/Program Files/a5v9/css/GradientGray/style.css">
              <!--Alpha Five Temporary Code End -->

              <meta name="generator" content="Alpha Five HTML Editor Version 9 Build 2055-3258">
              <title></title>
              </head>
              <body class="GradientGrayPageBODY">

              <p><br>
              <table align=center>
              <tr>
              <td><%A5 ?x_GridLinker.signedinuser.Output.Body.Grid_Echo %></td>
              </tr>
              <tr>
              <td><%A5 ?x_GridLinker.signedinuser.Output.Body.UpdateErrors %></td>
              </tr>
              <tr>
              <td><%A5 ?x_GridLinker.signedinuser.Output.Body.Search_HTML %></td>
              </tr>
              <tr>
              <td><%A5 ?x_GridLinker.signedinuser.Output.Body.Grid_HTML %></td>
              </tr>
              <tr>
              <td><%A5 ?x_GridLinker.signedinuser.Output.Body.DetailView_HTML %></td>
              </tr>
              </table><br>
              <table align=center>
              <tr>
              <td><%A5 ?x_GridLinker.b_goals_adddetail.Output.Body.Grid_Echo %></td>
              </tr>
              <tr>
              <td><%A5 ?x_GridLinker.b_goals_adddetail.Output.Body.UpdateErrors %></td>
              </tr>
              <tr>
              <td><%A5 ?x_GridLinker.b_goals_adddetail.Output.Body.Search_HTML %></td>
              </tr>
              <tr>
              <td><%A5 ?x_GridLinker.b_goals_adddetail.Output.Body.Grid_HTML %></td>
              </tr>
              <tr>
              <td><%A5 ?x_GridLinker.b_goals_adddetail.Output.Body.DetailView_HTML %></td>
              </tr>
              </table><br></p>
              </body></html>

              Comment


                #8
                Re: Dropdownbox ver9 web

                You have to test it first with myvar="ABC" to see if it is the expression that is failing. If your outcomeid is a numeric, then your parameter has to be like this: "str(outcomeid)".

                Message to everyone - never try to 'economize' by putting your own code inside of an Alpha-generated xbasic block (if you can avoid it). The lines in green below should be in their own code block. Reason: when you delete or replace the component in this page you will loose your code when Alpha automatically purges their component code.

                <%a5
                a5w_include("header.a5w")
                myvar=table.external_record_content_get("[PathAlias.ADB_Path]\b_desireoutcome","outcomeid","outcome","id="+quote(session.__protected__ulink))

                'SYSTEM GENERATED COMMENT - PLEASE DO NOT REMOVE - Start Ajax1----------------------------------
                ...
                Steve Wood
                See my profile on IADN

                Comment


                  #9
                  Re: Dropdownbox ver9 web

                  I don't get any errors at all, but nothing happens. under the test it works great..

                  Comment


                    #10
                    Re: Dropdownbox ver9 web

                    Ok steve, the myvar="ABC" works fine in the following interactive
                    myvar="ABC"
                    ?myvar
                    ABC
                    But when I try it in the dropdownbox nothing happens.

                    Comment


                      #11
                      Re: Dropdownbox ver9 web

                      Ron,

                      All debugging starts with isolation. You have to find out what is working, what isn't.

                      A good way is to test your variable right after it is set.

                      Put this on the A5W page right after your table.external... statement (assuming it really is called myvar).

                      ?"MyVar is: " + myvar

                      Then publish and run the page. You should get "MyVar is: ABC", or whatever. If you get "MyVar is: ", then your expression is not returning anything. Normally its the filter argument in the expression.
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #12
                        Re: Dropdownbox ver9 web

                        Ok Steve, I am getting the right answer under MyVar is:xxxxxx but
                        it is not populating the dropdownbox

                        Comment


                          #13
                          Re: Dropdownbox ver9 web

                          And the dropdown definition should look like the attached. With the word Variable for Data Source Type.
                          Steve Wood
                          See my profile on IADN

                          Comment


                            #14
                            Re: Dropdownbox ver9 web

                            My setting is identical to yours.... Still nothing

                            Comment


                              #15
                              Re: Dropdownbox ver9 web

                              My fault. Define it as a session variable in both places.

                              In teh A5W page "Session.myvar=..."

                              and session.myvar in the variable for the dropdown
                              Steve Wood
                              See my profile on IADN

                              Comment

                              Working...
                              X