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

xdialog - one works, the other don't

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

    xdialog - one works, the other don't

    This works:
    Code:
    xBox = ui_dlg_box("Employees",<<%dlg%
    [%dk%.96,41 index^"Emp ID:13|Last Name:25|First Name:20|Badge No:18|Status:17"vEmps!empSelect_*];
    {text=25:vName};
    %dlg%)
    This doesn't work:
    Code:
    xBox = ui_dlg_box("Employees",<<%dlg%
    {text=25:vName};
    [%dk%.96,41 index^"Emp ID:13|Last Name:25|First Name:20|Badge No:18|Status:17"vEmps!empSelect_*];
    %dlg%)
    ???
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com



    #2
    Re: xdialog - one works, the other don't

    Looks to me like there's nothing to keep the second xdialog open? I think the second example works/runs but closes immediately.

    This stays open.


    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    xBox = ui_dlg_box("Employees",<<%dlg%
    <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
    {text=25:vName};
    [%dk%.96,41 index^"Emp ID:13|Last Name:25|First Name:20|Badge No:18|Status:17"vEmps!empSelect_*];
    %dlg%)
    There can be only one.

    Comment


      #3
      Re: xdialog - one works, the other don't

      I guess I don't understand what you mean by "there's nothing to keep the second xdialog open"?

      Why does this stay open?

      Code:
      xBox = ui_dlg_box("Employees",<<%dlg%
      {text=25:vName};
      %dlg%)
      And, yes, the other examples does open and immediately closes.
      Peter
      AlphaBase Solutions, LLC

      [email protected]
      https://www.alphabasesolutions.com


      Comment


        #4
        Re: xdialog - one works, the other don't

        I don't know enough xdialog to discern what

        [%dk%.96,41

        does so I can't say for sure but it appears that Alpha knows to wait for the red x to close the xdialog when the text control immediately preceeds the end of the dialog code. When the dk control is last Alpha doesn't.
        There can be only one.

        Comment


          #5
          Re: xdialog - one works, the other don't

          This seems to work. Don't know why the a_dlg_button variable was acquiring a value without the code section.

          Code:
          xBox = ui_dlg_box("Employees",<<%dlg%
          {text=25:vName};
          [%dk%.96,41 index^"Emp ID:13|Last Name:25|First Name:20|Badge No:18|Status:17"vEmps!empSelect_*];
          %dlg%,<<%code%
          a_dlg_button = ""
          %code%)
          There can be only one.

          Comment


            #6
            Re: xdialog - one works, the other don't

            Interesting. Thx
            Peter
            AlphaBase Solutions, LLC

            [email protected]
            https://www.alphabasesolutions.com


            Comment


              #7
              Re: xdialog - one works, the other don't

              But on second thought, that's not a solution since no events will then fire.
              Peter
              AlphaBase Solutions, LLC

              [email protected]
              https://www.alphabasesolutions.com


              Comment


                #8
                Re: xdialog - one works, the other don't

                Okay, so lets go to the real world example.

                This works:
                Code:
                [COLOR="#FF0000"]ui_modeless_dlg_box[/COLOR]("Employees",<<%dlg%
                {Xmargin=2}
                {background=pale_blue_1}
                {Can_Exit=Close}
                {lf};
                
                {region1}
                	{region2}
                		{font=arial, 12, b}
                		Employee: {sp=2} {text=75:vName};
                		{font=arial, 11}
                		[%dk%.96,41 index^"Emp ID:13|Last Name:25|First Name:20|Badge No:18|Status:17"vEmps!empSelect_*] ;;;
                		
                		{font=arial, 10, B}
                		{sp=1} (vStatus:Active!status_change) {sp=2} (vStatus:Inactive!status_change) 
                	{endregion2}
                	 | 
                	{font=arial, 12, b}
                	{Ysize=1.5}
                	{font=arial, 10, b}
                
                 | 
                
                {frame=1,1}
                {region}
                {Ysize=2}
                	{region}{lf};
                		Emp_Id: | {text=10:vEmp_Id} |{sp=5} Badge #: | [.15vBadge_No] ;
                		Payroll #  | [.15vvPayroll_No] |{sp=5} Status: | [%v%.20vEmpStatus^=StatList];
                	{Ysize=1}
                	{endregion};;
                
                {Ysize=2}	
                	{region}
                		| First Name: {sp=13} Middle Name: {sp=7} Last Name:;
                		| [.25vFirst_Name]  [.25vMiddle_Name] [.25vLast_Name];
                		Suffix: | [.25vSuffix] Initials: [.10vInitials];
                		Title: | [.50vTitle]
                		{lf};
                		Home Address 1: | [.75vHome_Add1];
                		Home Address 2: | [.75vHome_Add2];
                		City: | [.25vCity] State: [.6vState] Zip: [.12vZip];
                	{lf};
                		
                	Home Phone: | [.20vHome_Phone];
                	Mobile Phone: | [.20vMobile_Phone];
                	Email: | [.75vEmail];
                	{lf};
                	
                	DOH: | {text=14:vDOH} ;
                	Terminated: | {text=14:vTerminated];
                	{endregion};
                {endregion};
                
                {lf};
                
                {color=Black on White} 
                
                	{lf=13} ;
                	{justify=top,right}
                	{color=Red on White} 
                	{font=arial, 10, B}
                	<%I=$a5_close;O={I=1}  {J+C}Close; %15,1.1Close>
                {endregion1}
                
                %dlg%)
                This doesn't work:
                Code:
                [COLOR="#FF0000"]ui_dlg_box[/COLOR]("Employees",<<%dlg%
                {Xmargin=2}
                {background=pale_blue_1}
                {Can_Exit=Close}
                {lf};
                
                {region1}
                	{region2}
                		{font=arial, 12, b}
                		Employee: {sp=2} {text=75:vName};
                		{font=arial, 11}
                		[%dk%.96,41 index^"Emp ID:13|Last Name:25|First Name:20|Badge No:18|Status:17"vEmps!empSelect_*] ;;;
                		
                		{font=arial, 10, B}
                		{sp=1} (vStatus:Active!status_change) {sp=2} (vStatus:Inactive!status_change) 
                	{endregion2}
                	 | 
                	{font=arial, 12, b}
                	{Ysize=1.5}
                	{font=arial, 10, b}
                
                 | 
                
                {frame=1,1}
                {region}
                {Ysize=2}
                	{region}{lf};
                		Emp_Id: | {text=10:vEmp_Id} |{sp=5} Badge #: | [.15vBadge_No] ;
                		Payroll #  | [.15vvPayroll_No] |{sp=5} Status: | [%v%.20vEmpStatus^=StatList];
                	{Ysize=1}
                	{endregion};;
                
                {Ysize=2}	
                	{region}
                		| First Name: {sp=13} Middle Name: {sp=7} Last Name:;
                		| [.25vFirst_Name]  [.25vMiddle_Name] [.25vLast_Name];
                		Suffix: | [.25vSuffix] Initials: [.10vInitials];
                		Title: | [.50vTitle]
                		{lf};
                		Home Address 1: | [.75vHome_Add1];
                		Home Address 2: | [.75vHome_Add2];
                		City: | [.25vCity] State: [.6vState] Zip: [.12vZip];
                	{lf};
                		
                	Home Phone: | [.20vHome_Phone];
                	Mobile Phone: | [.20vMobile_Phone];
                	Email: | [.75vEmail];
                	{lf};
                	
                	DOH: | {text=14:vDOH} ;
                	Terminated: | {text=14:vTerminated];
                	{endregion};
                {endregion};
                
                {lf};
                
                {color=Black on White} 
                
                	{lf=13} ;
                	{justify=top,right}
                	{color=Red on White} 
                	{font=arial, 10, B}
                	<%I=$a5_close;O={I=1}  {J+C}Close; %15,1.1Close>
                {endregion1}
                
                %dlg%)
                Peter
                AlphaBase Solutions, LLC

                [email protected]
                https://www.alphabasesolutions.com


                Comment


                  #9
                  Re: xdialog - one works, the other don't

                  And tacking this on the end makes it work. I have a feeling you'rd rather know why than just find a fix.

                  Code:
                  ,<<%code%
                  if a_dlg_button = "Close" then
                      'do nothing - the dialog will close
                  else
                      a_dlg_button = ""
                  end if
                  %code%)
                  There can be only one.

                  Comment


                    #10
                    Re: xdialog - one works, the other don't

                    Well, yes, that solves it. And yes, why?
                    Peter
                    AlphaBase Solutions, LLC

                    [email protected]
                    https://www.alphabasesolutions.com


                    Comment


                      #11
                      Re: xdialog - one works, the other don't

                      Ok, answer is, I think, you have an event defined for the vemps variable.

                      [%dk%.96,41 index^"Emp ID:13|Last Name:25|First Name:20|Badge No:18|Status:17"vEmps!empSelect_*] ;;;

                      In a normal modal xdialog anything that sets a_dlg_button to a value other than "" closes the xdialog. As soon as the vemps variable receives focus the empselect_setfocus event fires and that is placed in a_dlg_button. Since the event is not handled that closes the xdialog.

                      Change to

                      Code:
                      ,<<%code%
                      if a_dlg_button = "Close" then
                          'do nothing - the dialog will close
                      else
                          msgbox(a_dlg_button)
                          a_dlg_button = ""
                      end if
                      %code%)
                      to observe.
                      There can be only one.

                      Comment


                        #12
                        Re: xdialog - one works, the other don't

                        Originally posted by Peter.Greulich View Post
                        Well, yes, that solves it. And yes, why?
                        Because the field (vEmps) has the

                        !empSelect_*

                        which generates the events for the field making a_dlg_button <> "" thereby closing a ui_dlg_box.

                        But that leaves open a ui_modeless_dlg_box by definition is modeless and needs to be forced to close.

                        Use debug(1) at the start of Stan's event code to follow the execution.

                        Using the * to generate events may generate more events than needed and then need to be defined so they can be handled or filtered out if not needed.

                        (edit: I have to type faster and test less.. ;) at least to get ahead of Stan.)
                        Al Buchholz
                        Bookwood Systems, LTD
                        Weekly QReportBuilder Webinars Thursday 1 pm CST

                        Occam's Razor - KISS
                        Normalize till it hurts - De-normalize till it works.
                        Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                        When we triage a problem it is much easier to read sample systems than to read a mind.
                        "Make it as simple as possible, but not simpler."
                        Albert Einstein

                        http://www.iadn.com/images/media/iadn_member.png

                        Comment


                          #13
                          Re: xdialog - one works, the other don't

                          Thanks for the clarification on the modeless xdialog, Al.

                          One could also

                          Code:
                          ,<<%code%
                          if a_dlg_button = "Close" then
                              'do nothing - the dialog will close
                          else if left(a_dlg_button,10) = "empSelect_"
                                 'code here to process the possible events in a select...case...end select structure
                          else
                              msgbox(a_dlg_button)
                              a_dlg_button = ""
                          end if
                          %code%)
                          There can be only one.

                          Comment


                            #14
                            Re: xdialog - one works, the other don't

                            Sometimes it's like a bad penny, it just won't go away....

                            On the other hand generating events especially the killfocus one creates another caveat that is easy to become circular. And a ton of fun.
                            Al Buchholz
                            Bookwood Systems, LTD
                            Weekly QReportBuilder Webinars Thursday 1 pm CST

                            Occam's Razor - KISS
                            Normalize till it hurts - De-normalize till it works.
                            Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                            When we triage a problem it is much easier to read sample systems than to read a mind.
                            "Make it as simple as possible, but not simpler."
                            Albert Einstein

                            http://www.iadn.com/images/media/iadn_member.png

                            Comment


                              #15
                              Re: xdialog - one works, the other don't

                              So you're saying the killfocus event is a killjoy?
                              There can be only one.

                              Comment

                              Working...
                              X