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

No xdialog killfocus event for combo box

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

    No xdialog killfocus event for combo box

    I wouldn't have thought that I would spend all day trying to make the xdialog event killfocus work, but I did. I would still be here except that I FINALLY, through a bizillion trials and errors, discovered that it does not and will not fire on a comb box field. Who would have thunk. It works on text and list fields. I haven't yet run out of 4 letter explicatives about this one!!!

    Code:
    ' field variables
    	dim vdoc_no as C
    	dim vdoc_scope as C
    	dim vLDS as C="Institution"+crlf()+"Department"
    	dim vclass as C
    	dim vLnums as C=comma_to_crlf("one,two,three,four,five,six")
    
    ' dialog variables
    	dim vresult as C 
    	dim dlg_title as C="Document Entry"
    	dim dlg_body as C
    	dim dlg_code as C
    
    ' build the dialog
    	dlg_body = <<%dlg%
    	{region}
    	{lf};
    	Doc Class: | {initial_focus} [.20vclass!fdcev_*];
    	Document Scope: | [.14vdoc_scope^+vLDS!fdsev_*];
    	List: | [.16,6vdoc_no^#vLnums!lnuev_*];
    	Document Number: | [.10vdoc_no];
    	{endregion};
    	{lf};
    	{lf};
    	{justify=center}<15OK> <15Cancel>
    	%dlg%
    
    	dlg_code=<<%code%
    ' DOCUMENT SCOPE
    	IF left(a_dlg_button,6)="fdcev_"
    		if a_dlg_button = "fdcev_killfocus"
    			vclass="Class Autofill"
    			msgbox("Class kill")
    		end if
    	a_dlg_button=""
    	END IF
    
    	IF left(a_dlg_button,6)="fdsev_"
    		if a_dlg_button = "fdsev_killfocus"
    			msgbox("Scope kill")
    		end if
    	a_dlg_button=""
    	END IF
    	
    	IF left(a_dlg_button,6)="lnuev_"
    		if a_dlg_button = "lnuev_change"
    			msgbox("List Selection Made")
    		end if
    		
    		if a_dlg_button = "lnuev_killfocus"
    			msgbox("list kill")
    		end if
    	a_dlg_button=""
    	END IF
    	
    	if a_dlg_button="OK"
    		end
    	end if
    	%code%
    	
    vresult=ui_dlg_box(dlg_title, dlg_body,dlg_code)
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

    #2
    Re: No xdialog killfocus event for combo box

    It does fire.
    Make a choice in the combo field, then move the focus.
    You might say: but that is not what I was told in Fifth grade. I was told, when you move the mouse or tab out of the control, you killed the focus? And you might be correct, then again you might not. It's more of a philosophical question only Pee Wee Herman could answer: When is the focused killed?

    Some might say: once you move out of the control. Others might say, to kill the focus you have to gain focus first and if you didn't make a choice there was no focus.
    Some might say, it's a bug.. who says you have to make a choice?
    And some might answer that saying if you don't have to make a choice you have no business being there in the first place, giving focus to something that you wouldn't do anything with then trigger an event for doing nothing?
    Do you see how this could end up in the Supreme Court?

    But from a practical point of view, say you tab in a certain order and have to stop by this control, then add another event that will fire if you do not make any choices.

    Comment


      #3
      Re: No xdialog killfocus event for combo box

      Just curious Mike... what do you want to have happen... or not... in this dialog?

      Comment


        #4
        Re: No xdialog killfocus event for combo box

        Sorry G but you are wrong on this one. Play with the example, would ya? The combo field OnKill event is behaving like a 'change' event not a killfocus event. I think this is either a bug, or a psudo-bug!

        David,
        I wish to have field value integrity checks to assure the values are legit for what should be entered in the field.
        Mike W
        __________________________
        "I rebel in at least small things to express to the world that I have not completely surrendered"

        Comment


          #5
          Re: No xdialog killfocus event for combo box

          Mike_W, I see the same behavior here, and with vers 9, also. Suggest you send in the example with a formal bug report. In the meantime, you could run your validation code in the onchange event, right? Or, possibly even better, validate all the inputs when the user clicks ok. I often prefer this approach since it saves doing any validation work if the user cancels.

          Comment


            #6
            Re: No xdialog killfocus event for combo box

            Mike:
            I am not wrong and I am not right, I am simply agnostic on the issue. I thought I made that clear enough suggesting that only Pee Wee knows the answer.
            I would submit a "possible bug" report. I didn't rule out that it is a bug. I believe it is. I simply don't know where alpha stands on when the focus is killed in a drop down. Only one way to find out: submit a bug report.
            No, it is not behaving like OnChange either. If you simply make the drop down choices appear(click the down arrow icon) without even making any choice, it will fire. Again, alpha might be of the opinion that for a focus to be gained, at minimum the drop down itself has to gain focus. Ask alpha or ask Pee Wee, don't ask me.

            Comment


              #7
              Re: No xdialog killfocus event for combo box

              Submitted a "possible Bug" report to Selwyn, here is his responses.
              I haven't had a chance to read nor watch the video as I am multi-tasking right now, but here it is:
              Code:
              At 02:15 PM 3/29/2010, you wrote:
              > Selwyn:
              > If you have a drop down control in an xdlg and if you tab or mouse to the blank area of the control then tab/mouse out the,
              > the killfocus event does not fire. On the other hand, if you click the down arrow icon to show the choices or if you make a choice then tab/mouse out, the killfocus event fires.
              > Is this an intended behavior? or a bug?
              > Thanks
              > G. Gabriel
              Code:
              i was able to repeat the problem with an edit-combo.
              
              combo was ok (xdialog type ^=)
              edit combo failed (xdialog type ^+)
              Code:
              thanks
              
              
              please watch video
              
              http://screencast.com/t/YzA5MTkxN
              
              dim color as c
              dim colors as c
              colors = a5.Color_Enum()
              dim events as c = ""
              
              ui_dlg_box("test",<<%dlg%
              <dummy>;
              [.100color^=colors!ch_*];
              [%M%.100,20events];
              <clear>
              %dlg%,<<%code%
              if a_dlg_button ="dummy" then
                      a_dlg_button = ""
              end if
              if a_dlg_button = "clear" then
                      a_dlg_button = ""
                      events = ""
              end if
              if atc("ch_",a_dlg_button ) = 1 then
                      events = a_dlg_button + crlf() + events
                      events = remove_blank_lines(events)
                      a_dlg_button = ""
              end if
              %code%)
              Last edited by G Gabriel; 03-29-2010, 06:08 PM.

              Comment


                #8
                Re: No xdialog killfocus event for combo box

                Is it that "killfocus" needs to be defined - maybe there's confusion about what it's supposed to be.

                It seems that killfocus fires when a control loses focus... e.g. you tab out of a control and it's focus is killed - it no longer has focus. Selwyn's video indicates that when you leave a control killfocus fires... makes sense.

                David

                Comment


                  #9
                  Re: No xdialog killfocus event for combo box

                  The example that Selwyn gave is an excellent presentation that the combo (^=) worked and change event works well.... and the edit combo (^+) fails and the change action generates a kill event.

                  I need an edit combo box. So what's the outcome... is it considered a bug??
                  Mike W
                  __________________________
                  "I rebel in at least small things to express to the world that I have not completely surrendered"

                  Comment


                    #10
                    Re: No xdialog killfocus event for combo box

                    Bug, it is.

                    Comment


                      #11
                      Re: No xdialog killfocus event for combo box

                      Same outcome here... ^= fires the killfocus event... ^+ does not... but only when you leave the control.

                      Since it's an Edit Combo box... try typing into the box. After each keystroke the killfocus event fires.

                      So... why? Is this a problem or just us not understanding what's going on?

                      Comment


                        #12
                        Re: No xdialog killfocus event for combo box

                        David,
                        It is that the killfocus event is behaving as the change event for the edit combo box (^+), and there is no change event for the edit combo box. That is the problem that took me many, many hairs lost before discovering.

                        OK, here is another one..............

                        Why is the code for the combo box (^=) change event firing twice. I have the combo box selection (change) code opening a table and getting table values. I DO NOT wish to have it open the table twice needlessly!! Another bug???

                        Code:
                        ' field variables
                        	dim vdlg_f1 as C=""
                        	dim vdlg_f2 as C=""
                        	dim vF1_list as C=comma_to_crlf("Arabic,Greek")
                        	dim vLArabic as C=comma_to_crlf("one,two,three,four,five,six")
                        	dim vLGreek as C=comma_to_crlf("alpha,beta,gamma,delta,epsilon")
                        	dim vF2_list as C=""
                        
                        ' dialog variables
                        	dim vresult as C 
                        	dim dlg_title as C="Document Entry"
                        	dim dlg_body as C
                        	dim dlg_code as C
                        
                        ' build the dialog
                        	dlg_body = <<%dlg%
                        	{region}
                        	{lf};
                        	Dialog Field 1: | {initial_focus} [.20dlg_f1^=vF1_list!f1ev_*];
                        	Dialog Field 2: | [.20,10dlg_f2^#vF2_list];
                        	{endregion};
                        	{lf};
                        	{lf};
                        	{justify=center}<15OK> <15Cancel>
                        	%dlg%
                        
                        	dlg_code=<<%code%
                        'FIELD 1
                        	IF left(a_dlg_button,5)="f1ev_"
                        	  IF a_dlg_button="f1ev_change"
                        
                        		if dlg_f1="Arabic"
                        			vF2_list=vLArabic
                        		else
                        			vF2_list=vLGreek
                        		end if
                        	
                        		msgbox("The table is being accessed ")
                        
                        	  END IF
                        	  a_dlg_button=""
                        	END IF
                        	%code%
                        	
                        vresult=ui_dlg_box(dlg_title, dlg_body,dlg_code)
                        Mike W
                        __________________________
                        "I rebel in at least small things to express to the world that I have not completely surrendered"

                        Comment


                          #13
                          Re: No xdialog killfocus event for combo box

                          Hi Mike,

                          I can understand your frustrations, but remember, only code that is used, is code that has been tested. It's very possible that no one, including Alpha, ever needed the events you are looking for to work, so no issue was ever reported.

                          However, there are ways using {WATCH} with UI_DLG_CTL_CURRENT() and the field's previous and current values to ascertain it's change event and focus change. It may be more work than you want to do, but it will definitely work.

                          Also, I posted an event watcher here for testing XDialog event code, that you could easily modify for displaying the events, rather than wasting hours trying to figure out what's happening.
                          Regards,

                          Ira J. Perlow
                          Computer Systems Design


                          CSDA A5 Products
                          New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                          CSDA Barcode Functions

                          CSDA Code Utility
                          CSDA Screen Capture


                          Comment


                            #14
                            Re: No xdialog killfocus event for combo box

                            I have to admit that I don't deal with xdialog very much... it really is a bit foreign to me. I almost get it, but then again, not really.

                            Your message is displaying for each event firing. Put a message into Selwyn's example - where the listbox gets filled with the event firing and you get a message for each event. It looks like that is just the way xdialog works. The code gets executed for every event.

                            what about this... test for the table...

                            Code:
                            	dim vdlg_f1 as C=""
                            	dim vdlg_f2 as C=""
                            	dim vF1_list as C=comma_to_crlf("Arabic,Greek")
                            	dim vLArabic as C=comma_to_crlf("one,two,three,four,five,six")
                            	dim vLGreek as C=comma_to_crlf("alpha,beta,gamma,delta,epsilon")
                            	dim vF2_list as C=""
                            
                            ' dialog variables
                            	dim vresult as C 
                            	dim dlg_title as C="Document Entry"
                            	dim dlg_body as C
                            	dim dlg_code as C
                            	dim is_table_open as L
                            	is_table_open = .f.
                            
                            ' build the dialog
                            	dlg_body = <<%dlg%
                            	{region}
                            	{lf};
                            	Dialog Field 1: | {initial_focus} [.20dlg_f1^=vF1_list!f1ev_*];
                            	Dialog Field 2: | [.20,10dlg_f2^#vF2_list];
                            	{endregion};
                            	{lf};
                            	{lf};
                            	{justify=center}<15OK> <15Cancel>
                            	%dlg%
                            
                            	dlg_code=<<%code%
                            'FIELD 1
                            	IF left(a_dlg_button,5)="f1ev_"
                            	  IF a_dlg_button="f1ev_change"
                            
                            		if dlg_f1="Arabic"
                            			vF2_list=vLArabic
                            		else
                            			vF2_list=vLGreek
                            		end if
                            		
                            		if is_table_open = .f. then
                            			msgbox("The table is being accessed ")
                            			is_table_open = .t.
                            		end if
                            
                            	  END IF
                            	  a_dlg_button=""
                            	END IF
                            	%code%
                            	
                            vresult=ui_dlg_box(dlg_title, dlg_body,dlg_code)

                            Comment


                              #15
                              Re: No xdialog killfocus event for combo box

                              Originally posted by Mike Wilson View Post
                              David,
                              It is that the killfocus event is behaving as the change event [/CODE]
                              As I explained earlier, it is not behaving like the change event, far from it.
                              My finding is in line with Selwyn's. The edit-combo does not gain focus unless the choices are brought into focus first as opposed to a combo where they are in focus right away. And since alpha is of the opinion (and so am I) that a control should be considered in focus if you click anywhere in it, then it's a bug and I am sure it's something they could fix.
                              Originally posted by Mike Wilson View Post
                              OK, here is another one..............

                              Why is the code for the combo box (^=) change event firing twice.
                              This might surprise you but no it is not firing twice. The explanation for this is going to take a little time (which I don't have now, but later). Suffices to say, consider yourself lucky you don't live in the Salem witchcraft era since this sure looks like witchcraft, something that seems for sure to fire twice but in reality it only fires once and you would have been put to the fire by the stake!
                              That will take a little bit of explaining... later

                              Comment

                              Working...
                              X