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

ALPHA EMPLOYEES : Where's OnClick : Can Alpha trap this event for desktop?

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

    #16
    Re: ALPHA EMPLOYEES : Where's OnClick : Can Alpha trap this event for desktop?

    Originally posted by Stan Mathews View Post
    How many entries are there in your listbox? If is a manageable number then possibly a set of radio buttons might be more appropriate. The radio buttons object should respond to the onchange event as they are clicked.

    PS I did respond to your private message, quite lengthily, but I did so through my email notification of the message which means the reply went to never-never land. If Aaron can send it back to me I'll send it to you. Meanwhile, no hard feelings. I just feel that it is impossible to give too much info in a post, but it is easy to leave something out.
    Thank you for being down to earth. It seems that people sometimes take things too personally. I'm not here to flame anyone. I'm just trying to add to my and the collective knowledge of this community. I do agree with you about never giving to much information. I could see the ambiguity in my original post. My apoligies. I will definitely make it a point to be more explicit in future posts.

    Moving forward. :)

    It is a dynamic list. It basically works like this:

    Comment


      #17
      Re: ALPHA EMPLOYEES : Where's OnClick : Can Alpha trap this event for desktop?

      Jeff:

      I think what you need is code placed in the OnChange event for your listboxes.

      Each time you change the focus within the list, the OnChange event will fire for the item you have just clicked.

      F.
      Finian

      Comment


        #18
        Re: ALPHA EMPLOYEES : Where's OnClick : Can Alpha trap this event for desktop?

        The listbox is dynamically populated by the user. The user selects an item from list A, clicks add, and the value from A gets put into a table associated with list B. The OnClick() goes here.
        Jeff,

        It�s a new day� So the �listbox B� is actually a Browse. If you wish for an event to occur when selecting a �choice� from the B Browse, this is equivalent to selecting a record or �Fetching�� a record. What you might then try is to put the update code on the Browse B OnFetch event.

        Mike W
        Mike W
        __________________________
        "I rebel in at least small things to express to the world that I have not completely surrendered"

        Comment


          #19
          Re: ALPHA EMPLOYEES : Where's OnClick : Can Alpha trap this event for desktop?

          Originally posted by Finian Lennon View Post
          Jeff:

          I think what you need is code placed in the OnChange event for your listboxes.

          Each time you change the focus within the list, the OnChange event will fire for the item you have just clicked.

          F.
          Thank you for your response.

          I tried using the OnChange event. Using debug, the variables associated with the fields I'm trying to update all appear to get set with the proper values, but they don't actually show up in the fields until I click on another item.

          In other words, when I click on a record in Listbox B the cooresponding values don't show. If I then click on a different value in Listbox B the values that were supposed to show up for the original record I selected, show up one record record late. Mabye I'm having a refreshing/resynching problem? I will post the script.

          Comment


            #20
            Re: ALPHA EMPLOYEES : Where's OnClick : Can Alpha trap this event for desktop?

            Originally posted by Mike Wilson View Post
            Jeff,

            It’s a new day… So the “listbox B’ is actually a Browse. If you wish for an event to occur when selecting a ‘choice’ from the B Browse, this is equivalent to selecting a record or “Fetching”’ a record. What you might then try is to put the update code on the Browse B OnFetch event.

            Mike W

            Thank you... Moving forward. :) The listbox is a listbox object. Unfortunately, it doesn't have the OnFetch event. Both listboxes have a table associated with them. Listbox A get's dynamically populated from a table, based on a variable set from a selection made in a combo box. Listbox B is populated by a table. This table gets rows added to it when the 'Add' button is clicked.

            Using the OnClick event does seem to populate the variables associated with the fields I'm trying to update, but the fields themselves don't actually show the values until the record in listbox B loses focus.
            Last edited by Jeff@Listbrokers; 11-20-2006, 12:15 PM.

            Comment


              #21
              Re: ALPHA EMPLOYEES : Where's OnClick : Can Alpha trap this event for desktop?

              To anyone that's still following this. :)

              Here's the function that gets called by the OnChange event of Listbox B.

              ' Function takes 3 arguments.
              ' formname is the name of the parentform of Listbox B. (Count_Form)
              ' selected_table is the name of the table associated with Listbox B. (selected_areacodes)
              ' fieldname is the name of the field in the table that matches the value selected in Listbox B. (Areacode)

              ' This function is called in the OnClick Event as follows:

              Code:
              populateCountsSelected("Count_Form", "selected_areacodes", "Areacode")
              Code:
              FUNCTION populateCountsSelected as L (formname as C, selected_table as C, fieldname as C)
               option strict
               DIM tblname as C
               DIM tbl as P
               DIM qry as P
               DIM nrecs as N
               DIM frm as P
               DIM mode as C
               DIM query.filter as C
               DIM query.order as C
               DIM query.options as C
               frm = obj(formname)
               tbl = table.get(selected_table)
               if (tbl.mode_get() <> 0) then
                END
               end if
               
              [COLOR=red]' set the filter = varPicked (this is the value associated with listbox B) + [/COLOR]
              [COLOR=#ff0000]' CountId (a unique ID)[/COLOR]
               query.filter = fieldname +" = "+S_QUOTE(alltrim(VAR->varPicked))+" .and. CountID = "+S_QUOTE(alltrim(parentform.TIF_Count_Form_CountID.text))
               query.options = ""
               
              [COLOR=red]' create the query[/COLOR]
               qry = tbl.query_create()
               
              [COLOR=red]' get the number of records[/COLOR]
               nrecs = qry.records_get()
               
              [COLOR=red]' how many records did we find? should be 1 always.[/COLOR]
               if (nrecs <> 1) then
                [COLOR=red]' if not, clear query, prompt user and end script.[/COLOR]
                qry.drop()
                ui_msg_box("Error","There are "+nrecs+" records. This is an error. Max # recs. = 1")
                query.order = ""
                query.filter = ""
                populateCountsSelected = .f.
               else
                [COLOR=red]' we found 1 record, set the variables associated with the fields [/COLOR]
                VAR->varAgeMin = tbl.Age_Min
                VAR->varAgeMax = tbl.Age_Max
                VAR->varIncomeMin = tbl.Income_Min
                VAR->varIncomeMax = tbl.Income_Max
                VAR->varOmit = tbl.Omit
                VAR->varHousehold = tbl.Household
                VAR->varTempState = CSTATE(tbl.state)
               
                [COLOR=red]' clear the query[/COLOR]
                qry.drop()
                query.order = ""
                query.filter = ""
                [COLOR=red]' resynch the form[/COLOR]
                frm.resynch()
                frm.Activate()
                populateCountsSelected = .t.
               end if 
               [COLOR=red]' manually delete the pointers... why not?[/COLOR]
               delete tbl
               delete qry
               delete frm 
              END FUNCTION

              Comment


                #22
                Re: ALPHA EMPLOYEES : Where's OnClick : Can Alpha trap this event for desktop?

                Ok. Thanks you all for your help. I got it working. The code in red below got it working. I was trying to set the variables that were bound to the fields as opposed to setting the fields themselves. Does anyone have any ideas as to why setting the variables themselves would cause the behavior I described? If the fields are based on the variables and the variables get set, shouldn't that equate to the field being set?

                Code:
                FUNCTION populateCountsSelected as L (formname as C, selected_table as C, fieldname as C)
                 option strict
                 DIM tblname as C
                 DIM tbl as P
                 DIM qry as P
                 DIM nrecs as N
                 DIM frm as P
                 DIM mode as C
                 DIM query.filter as C
                 DIM query.order as C
                 DIM query.options as C
                 frm = obj(formname)
                 tbl = table.get(selected_table)
                 if (tbl.mode_get() <> 0) then
                  END
                 end if
                  
                 query.filter = fieldname +" = "+S_QUOTE(alltrim(VAR->varPicked))+" .and. CountID = "+S_QUOTE(alltrim(parentform.TIF_Count_Form_CountID.text))
                 query.options = ""
                 qry = tbl.query_create()
                 nrecs = qry.records_get()
                 if (nrecs <> 1) then
                  qry.drop()
                  ui_msg_box("Error","There are "+nrecs+" records. This is an error. Max # recs. = 1")
                  query.order = ""
                  query.filter = ""
                  populateCountsSelected = .f.
                 else
                '  VAR->varAgeMin = tbl.Age_Min
                '  VAR->varAgeMax = tbl.Age_Max
                '  VAR->varIncomeMin = tbl.Income_Min
                '  VAR->varIncomeMax = tbl.Income_Max
                '  VAR->varOmit = tbl.Omit
                '  VAR->varHousehold = tbl.Household
                '  VAR->varTempState = CSTATE(tbl.state)
                  [COLOR=red]frm.COMBOBOX_Count_Form_Consumer_AgeMin = tbl.Age_Min
                  frm.COMBOBOX_Count_Form_Consumer_AgeMax = tbl.Age_Max
                  frm.TIF_Count_Form_Consumer_IncomeMin = tbl.Income_Min
                  frm.TIF_Count_Form_Consumer_IncomeMax = tbl.Income_Max
                  frm.CHECKBOX_Count_Form_Omit_Area_Codes = tbl.Omit
                  frm.RADIO_Counts_Form_Households = tbl.Household
                  frm.COMBOBOX_Count_Form_Areacode_SelectState = CSTATE(tbl.state)
                [/COLOR]   
                  qry.drop()
                  query.order = ""
                  query.filter = ""
                  frm.resynch()
                  frm.Activate()
                  populateCountsSelected = .t.
                 end if 
                 delete tbl
                 delete qry
                 delete frm 
                END FUNCTION

                Comment


                  #23
                  Re: ALPHA EMPLOYEES : Where's OnClick : Can Alpha trap this event for desktop?

                  Jeff:

                  You need some code to explicitly refresh the other listbox. Something like
                  topparent:listbox2.refresh()
                  should do it.

                  It's not clear to me where the variables reside. Are they objects on the form? If so you should explicitly refresh those also.

                  F.
                  Finian

                  Comment


                    #24
                    Re: ALPHA EMPLOYEES : Where's OnClick : Can Alpha trap this event for desktop?

                    Originally posted by Finian Lennon View Post
                    Jeff:

                    You need some code to explicitly refresh the other listbox. Something like
                    topparent:listbox2.refresh()
                    should do it.

                    It's not clear to me where the variables reside. Are they objects on the form? If so you should explicitly refresh those also.

                    F.
                    Finian,

                    According to the help files:
                    The <OBJECT>.RESYNCH() method does a new query, re-fetches all data for the form or browse, and then repaints it.
                    That should cover the refreshing of the all of the objects on the form, correct?

                    The variables are session variables, created by the form containing all of the fields and listboxes. Each variable is bound to a field on my form.

                    Comment


                      #25
                      Re: ALPHA EMPLOYEES : Where's OnClick : Can Alpha trap this event for desktop?

                      <That should cover the refreshing of the all of the objects on the form, correct?
                      >

                      Yes it should. I'm still living in V5 where, in the kind of situation you describe and in my experience, it's necessary to explicitly refresh all (changing) objects on a form for the form to immediately display changes correctly in all environments.

                      F.
                      Finian

                      Comment


                        #26
                        Re: ALPHA EMPLOYEES : Where's OnClick : Can Alpha trap this event for desktop?

                        Originally posted by Finian Lennon View Post
                        <That should cover the refreshing of the all of the objects on the form, correct?
                        >

                        Yes it should. I'm still living in V5 where, in the kind of situation you describe and in my experience, it's necessary to explicitly refresh all (changing) objects on a form for the form to immediately display changes correctly in all environments.

                        F.

                        I know how you feel... I'm still trying to get used to the way things are done in V7. I'm traditionally a C/C++/C# programmer. I also had a 5 month crash course in A4 V2. Which, with it's limited feature set, I was able to master quite quickly. Alpha 5 with it's robust features, but not as robust documentation/help, it has been a little more challenging to fully understand. Although, through trial and error, Dr. Wayne's X-Basic for Everyone, and the great people here on this forum, I'm finally starting to see the forest for the trees. :)

                        Comment

                        Working...
                        X