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

Refresh Dialog Box on Field Change?

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

    Refresh Dialog Box on Field Change?

    I have created an xdialog box (not from or related to a form). I have multiple fields which are calculated based on the data entered in the previous field. Currently you need to close and re-open the box for those fields to calculate.

    How do I force them to calculate automatically upon leaving the previous field? I can only seem to find information about refreshing display for forms and browses, but not dialog boxes.

    #2
    Re: Refresh Dialog Box on Field Change?

    I believe you will need to use

    https://www.alphasoftware.com/docume...20Function.xml

    or

    https://www.alphasoftware.com/docume...20Function.xml
    There can be only one.

    Comment


      #3
      Re: Refresh Dialog Box on Field Change?

      Another option you may want to look at is to trap the change event for each field as one enters data.


      https://www.alphasoftware.com/docume...ge%20Event.xmlhttps://www.alphasoftware.com/docume...ge%20Event.xml
      Alpha 5 Version 11
      AA Build 2999, Build 4269, Current Build
      DBF's and MySql
      Desktop, Web on the Desktop and WEB

      Ron Anusiewicz

      Comment


        #4
        Re: Refresh Dialog Box on Field Change?

        Alright, the trap event change works perfectly for the text fields, so thank you for that!

        I am still having trouble however getting the selection of a list box (which is another dialog box embedded into the main dialog box) to post to the appropriate field without closing and then reopening the box.
        I tried using the same method by changing the event of the OK button, however that did not work.

        Comment


          #5
          Re: Refresh Dialog Box on Field Change?

          It may be easier if you could show us your xdialog and even better if you could provide a table with some test data so we could better see what you are trying to do. Nothing fancy, something simple.

          The list can be of static data.
          Alpha 5 Version 11
          AA Build 2999, Build 4269, Current Build
          DBF's and MySql
          Desktop, Web on the Desktop and WEB

          Ron Anusiewicz

          Comment


            #6
            Re: Refresh Dialog Box on Field Change?

            Ok, so here is the code for the dialog box. There is currently no table associated with this. Once we have it functioning properly, we will add the code to verify the data and post it to a table.

            There is a button which opens a list box to select an assembler which then stores the result as the variable "select_assembler". I need this result to populate the "employee" field, which it does, but only once the dialog box is reloaded. This needs to happen upon closing the assembler selection dialog.

            Code:
            'Date Created: 19-Apr-2018 09:36:10 PM
            'Last Updated: 25-Apr-2018 11:07:49 AM
            'Created By  : agoodwin
            'Updated By  : agoodwin
            
            'Create an XDialog dialog box to prompt for parameters.
            'In order to evaluate expressions using the eval() function, in the context of
            'the current form, the "form_name" variable is defined.
            
            DIM form_name as C
            if is_object(topparent.this) then
            	form_name = topparent.name()+".this"
            else
            	form_name = ""
            end if
            DIM SHARED line_number as C
            DIM SHARED part_number as C
            DIM SHARED length as C
            DIM SHARED employee as C
            DIM SHARED select_assembler as C
            DIM SHARED qc_pin as C
            DIM SHARED tester as C
            DIM SHARED test_type as C
            DIM SHARED qty_tested as N
            DIM SHARED paperwork_failed as C
            DIM SHARED qty_open as C
            DIM SHARED qty_miswired as C 
            DIM SHARED qty_short as C
            DIM SHARED qty_inspection as C
            DIM SHARED qty_failed as C
            DIM SHARED timestamp as C
            DIM SHARED comments as C
            DIM SHARED responsibility as C
            DIM SHARED varC_result_qc_test_log as C
            
            line_number = "" 
            'select_assembler = "" 'uncomment once refresh is working to prevent box from saving previous values
            qc_pin = "" 
            tester ="" 
            qty_open ="" 
            qty_miswired ="" 
            qty_short ="" 
            qty_inspection ="" 
            
            DELETE expression_result 'added by gcardow
            
            expression_result = eval("\"No\"",form_name)
            
            paperwork_failed = convert_type(expression_result,"C")
            part_number = table.external_record_content_get("order detail","od_prod_code","","od_line_no="+s_quote(val(line_number)))
            length = table.external_record_content_get("order detail","od_length","","od_line_no="+s_quote(val(line_number)))
            employee = select_assembler
            tester = table.external_record_content_get("qc_tester_pins","tester","","pin="+s_quote(val(qc_pin)))
            'timestamp = dtoc(date())+" "+time()
            timestamp = now()
            
            responsibility = "Assembly"
            DELETE a_test_type
            DIM a_test_type[3] as c
            dim temp_list as c
            temp_list = <<%list%
            First 
            Final
            Other
            %list%
            
            a_test_type.initialize(temp_list)
            
            DELETE a_responsibility
            DIM a_responsibility[7] as c
            dim temp_list as c
            temp_list = <<%list%
            Assembly
            Staging
            Defective Parts
            Engineering
            %list%
            
            a_responsibility.initialize(temp_list)
            
            heading_string = "QC Inspection Log"
            footer_string = "Verify data before submitting..."
            ok_button_label = "&Submit"
            cancel_button_label = "&Cancel"
            Delete XdialogStyle
            dim XDialogStyle as p
            XDialogStyle.AccentColor = "#191+232+190"
            XDialogStyle.Color = "#160+229+158"
            varC_result_qc_test_log = ui_dlg_box("Line Item QC Inspection Log",<<%dlg%
            {Windowstyle=Gradient Horizontal Top}
            {region}
            
            {Region}
            {text=65,1:heading_string};
            {Endregion};
            
            {Region}
            Enter Line #:| [.12line_number!change];
            Part Number:|{Region} {text=25,1:part_number_txt};{Endregion};
            | <%T= Bubble help for button;%Select Assembler!select_assembler_button_click>;
            Assembler:| [.40employee];
            {Region} {text=40,1:employee_txt};{Endregion};
            Enter Tester Pin:| [%p%.8qc_pin!change];
            Tester:|{Region} {text=40,1:tester_txt};{Endregion};;
            Test Type:| [%v%.17test_type^=a_test_type];
            QTY Tested:| [%z%.6qty_tested];
            Paperwork Failed:| {region}(paperwork_failed:Yes) 
            (paperwork_failed:No){endregion};;
            QTY Open:| [.6qty_open!change];
            QTY Miswired:| [.6qty_miswired!change];
            QTY Short:| [.6qty_short!change];
            QTY Inspection Failure:| [.6qty_inspection!change];
            Total Qty Failed:| {Region} {text=25,1:failure_txt};{Endregion};
            Date / Time::| [.28timestamp];
            Comments:| [%mw%.40,5comments];
            Responsibility:| [%v%.37responsibility^=a_responsibility];
            {Endregion}; 
            {Region}
            {text=65,1:footer_string};
            {Endregion};
            
            {line=1,0};
            <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>; 
            {endregion};
            
            %dlg%,<<%code%
            if a_dlg_button = "select_assembler_button_click" then 
            		button_xbasic = <<%code_string%
            		'Create an XDialog dialog box to prompt for parameters.
            DIM SHARED select_assembler as C
            DIM SHARED varC_result as C
            auto_list_select_assembler = table.external_record_content_get("employee_master","Name","name","isblank(\"date_end\")  .and. (department = \"Assembly\"  )")
            
            temp_count = w_count(auto_list_select_assembler,crlf())
            DELETE a_select_assembler
            DIM a_select_assembler[temp_count] as c
            a_select_assembler.initialize(auto_list_select_assembler)
            assembler_button_label = "&Select"
            cancel_button_label = "&Cancel"
            varC_result = ui_dlg_box("Select Assembler",<<%dlg%
            {region}
            Select Assembler:| [.40,50select_assembler^#a_select_assembler];
            {endregion};
            {line=1,0};
            {region}
            <*15=assembler_button_label!OK> <15=cancel_button_label!CANCEL>
            {endregion};
            %dlg%)
            
            %code_string%
            		evaluate_template(button_xbasic)
            		a_dlg_button = ""
            
            	end if
            
            if a_dlg_button = "change" then
                a_dlg_button = ""
                part_number_txt = table.external_record_content_get("order detail","od_prod_code","","od_line_no="+s_quote(val(line_number)))+" "+"|"+" "+table.external_record_content_get("order detail","od_length","","od_line_no="+s_quote(val(line_number)))+" "+"FT"
                tester_txt = table.external_record_content_get("qc_tester_pins","tester","","pin="+s_quote(val(qc_pin)))
                failure_txt = VAL(qty_open)+VAL(qty_miswired)+VAL(qty_short)+VAL(qty_inspection)
            end if
            
            %code%)

            Comment


              #7
              Re: Refresh Dialog Box on Field Change?

              See {Embedded} and {watch} from help.

              The child embedded list box's event will be executed from parent dialog with {watch=...}

              Comment


                #8
                Re: Refresh Dialog Box on Field Change?

                Amanda,

                Is this what you need to do?

                sample for Amanda jpg.jpg

                If it is what you want, there are few way to do
                #1) Open dialog as it shown
                #2) Can be a Pop-up Drop down dialog
                #3) If the list will be simple then simple Drop-down.

                Comment


                  #9
                  Re: Refresh Dialog Box on Field Change?

                  I wish it were that simple. The list is automatically populated from our employee_master table and then filtered to show only the appropriate employees.

                  2018-04-25 17_15_21-Greenshot.png

                  Comment


                    #10
                    Re: Refresh Dialog Box on Field Change?

                    Amanda,

                    I was not sure that you are actually looking for the "employee" (*simple value) because the variable name.

                    I need this result to populate the "employee" field
                    solution:
                    I made an other UDF , Child-dialog at end of your code instead of Block-code.
                    Next call the Child-dialog UDF at event ( if a_dlg_button = "select_assembler_button_click" then )

                    Code:
                    		
                     if a_dlg_button = "select_assembler_button_click" then
                    .....
                    
                    vReturn = Sub_Assembler(local_variables())
                    If vReturn <> ""
                        employee=vReturn      'set the return value to employee variable
                    end if
                    a_dlg_button = ""
                    end if
                    
                    
                    Function Sub_Assembler as c (vars as p)   'It another UDF , Child-dialog
                    	with vars
                    
                    'Insert your Block-codes
                    
                    'write for the event
                    If a_dlg_button="ok" then
                    	Sub_Assembler=select_assembler           '[COLOR="#FF0000"]Passing the value TO Parent dialog[/COLOR]
                    else 'cancel"
                    	Sub_Assembler=""           'Nothing return value at here
                    end if
                    	end with
                    end function
                    Are you gonna scroll down to search one who is located the bottom of records?
                    It is nothing wrong but I mean the better Layout design.

                    If you do not have to show "Select Assembler:| [.40,50select_assembler^#a_select_assembler];"
                    If you add a filter variable, the child box will be shorter and easy to find one person.

                    Code:
                    {region}
                    Search:| [vEmpFilter!vfilter_*];
                    Select Assembler:| [.40,5select_assembler^#a_select_assembler];
                    {endregion};
                    
                    'and event
                    If a_dlg_button ="vfilter_killfocus" then
                    	'refresh with filter condition  - copy of the list with change the filter condition  or
                            'apply with filter_sting_multi() function which you do not have to read table again
                    	a_dlg_button =""
                    end if

                    Comment


                      #11
                      Re: Refresh Dialog Box on Field Change?

                      So I've figured it out and it was so simple that I'm not sure if I'm an idiot for not noticing it sooner, or a genius for finding such a simple solution. All I had to do was change the field from showing the field value to showing the variable.

                      so instead of the text field showing "employee" I changed it to show the variable "select_assembler".

                      Comment

                      Working...
                      X