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

Refrsh List in first xDialog when changes are made in a second xDialog

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

    Refrsh List in first xDialog when changes are made in a second xDialog

    I have xDialog 1 which contains 3 external_record_content_get lists with 'owner draw' formatting.

    When I double click on list 3 in Dialog 1, a function is called which opens Dialog 2. Changes made in Dialog 2 alters the formating of list 3 in Dialog 1.

    Right now, after closing Dialog 2, I have to press a button on Dialog 1 called Refresh for the changes to take effect.

    I was wondering if anyone had any ideas as how to somehow push the refresh button when closing the second Dialog so list 3 will be refreshed.

    This is the function which formats the #3 list:

    Code:
    FUNCTION CA_List as C ( vTrans as C )
    	image1 = "{I:'A5_ball_green'}"
    	image2 = "{I:'A5_ball_white'}"
    	
    	image3 = "{I:'$$generic.checked.off'}"
    	image4 = "{I:'$$generic.checked.on'}"
    	
    	'image5 = "{I:'A5_ball_blue'}"
    	image5 = "{I:'$$generic.view'}"
    	image6 = "{I:'A5_ball_white'}"
    	
    	auto_list_vcCA = table.external_record_content_get("wodesclabor_m_ca",\
    	"\" \"+If(TechInsp=.T.,"+quote(var->image4)+","+quote(var->image3)+")+\"|\"+If(SignOff=.T.,"+quote(var->image5)+","+quote(var->image6)+")+\"|\"+If(Posted=.t.,"+quote(var->image1)+","+quote(var->image2)+")+'|'+ 'Item: ' + Itemno + '|' + ' ' + left(Descrep,100) + '|' + '*&' + transno + swkno + '&*&' ",\
    	"Itemnorpt",\
    	"Transno="+s_quote(vTrans))
    	
    	ca_list=auto_list_vcCA
    END FUNCTION
    As you can see, I have images in list 3. After making changes in Dialog 2, the images change in Dialog 1, list 3.
    Alpha 5 Version 11
    AA Build 2999, Build 4269, Current Build
    DBF's and MySql
    Desktop, Web on the Desktop and WEB

    Ron Anusiewicz

    #2
    Re: Refrsh List in first xDialog when changes are made in a second xDialog

    Hi Ron,
    Have you seen ui_modeless_dlg_button; there is also a function to reset the button value after it is pressed.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

    Comment


      #3
      Re: Refrsh List in first xDialog when changes are made in a second xDialog

      Have a look at UI_DLG_EVENT

      Using this you can send from dialog2 the name of the event in dialog1 that runs the refresh code.
      Tim Kiebert
      Eagle Creek Citrus
      A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

      Comment


        #4
        Re: Refrsh List in first xDialog when changes are made in a second xDialog

        And, if you haven't already tried it, look at UI_DLG_REFRESH_TARGETED.
        Finian

        Comment


          #5
          Re: Refrsh List in first xDialog when changes are made in a second xDialog

          Thanks for the suggestions. Not sure but Finian's suggestion looks good and may probably be the easiest to implement. I'll let you know. Been tied up with WEB development.

          Good to hear from you Tim. I talk to Tom pretty regular. We're both doing well.
          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: Refrsh List in first xDialog when changes are made in a second xDialog

            I have not been able to solve this problem.

            I put together a working example of the problem I’m having.
            I’ve attached a zipped copy of the work space.

            1. run the script Parent.
            2. Mouse click on the owner named Maziarz.
            3. Double click on the aircraft Cessna 172.
            4. Uncheck column 3 and save.
            5. Close the checkbox dialog.
            6. Note that the images in the aircraft list have not changed.
            7. Press the refresh button and the images will redraw.

            My problem is when I close the checkbox dialog, it would be very nice if
            the images in the aircraft list would update without my needing to press the
            refresh button.

            Ron Anusiewicz
            Attached Files
            Last edited by Ronald Anusiewicz; 08-20-2017, 10:18 PM. Reason: Text was omitted.
            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


              #7
              Re: Refrsh List in first xDialog when changes are made in a second xDialog

              Solved: My friend Nigel figured it out. His changes are in green.
              Thanks Nigel.

              Code:
              'Date Created: 19-Aug-2017 01:22:27 PM
              'Last Updated: 21-Aug-2017 07:44:07 AM
              'Created By  : Ron
              'Updated By  : Ron
              
              DIM SHARED vcHead as C = ""
              dim shared vcHeadTransno as C
              DIM SHARED vcCA as C
              DIM SHARED varC_result as C
              
              ''build header list
              BUILD_LIST:
              auto_list_vcHead = table.external_record_content_get("ca",\
              "transno+\"|\"+Detail",\
              "detail",\
              "")
              
              Dim format as p
              Format.tab_stops=".75"
              Format.odd_row_color="White"
              Format.even_row_color="White"
              Format.odd_selected_color="Dark Blue"
              Format.even_selected_color="Dark Blue"
              Format.font="calibri,11"
              Format.font_color_unselected="Black"
              Format.font_color_selected="White"
              Format.lastbutton="OK"
              Format.group_size=1
              Format.number_rows=.f.
              Format.alternating_bands=.f.
              
              'Apply 'owner draw' formatting information to the list
              auto_list_vcHead = a5_owner_draw_list_fmt(auto_list_vcHead,Format)
              
              temp_count = w_count(auto_list_vcHead,crlf())
              DELETE a_vcHead
              DIM a_vcHead[temp_count] as c
              a_vcHead.initialize(auto_list_vcHead)
              
              
              'build the child list
              auto_list_vcCA = table.external_record_content_get("ca_child",\
              "\"  \"+C1+\"|\"+C2+\"|\"+C3+\"|\"+Detail+\"|\"+swkno",\
              "detail",\
              "Transno="+s_quote(vcHeadTransno))
              
              auto_list_vcCA = CA_List(vcHeadTransno)
              Dim SHARED format3 as p 
              Format3.tab_stops=".5,1,1.75,6"
              Format3.odd_row_color="White"
              Format3.even_row_color="White"
              Format3.odd_selected_color="Dark Blue"
              Format3.even_selected_color="Dark Blue"
              Format3.font="Calibri,11"
              Format3.font_color_unselected="Black"
              Format3.font_color_selected="White"
              Format3.lastbutton="OK"
              Format3.group_size=1
              Format3.number_rows=.f.
              Format3.alternating_bands=.f.
              
              'Apply 'owner draw' formatting information to the list
              auto_list_vcCA = a5_owner_draw_list_fmt(auto_list_vcCA,Format3)
              
              temp_count = w_count(auto_list_vcCA,crlf())
              DELETE a_vcCA
              DIM a_vcCA[temp_count] as c
              a_vcCA.initialize(auto_list_vcCA)
              
              ok_button_label = "&OK"
              cancel_button_label = "&Close"
              
              vTitle = "Test Dialog"
              '
              ' <*10=ok_button_label!OK>{sp=8}<%T=Refresh Aircraft List%10Refresh!refresh_view>
              '
              varC_result = ui_modeless_dlg_box(vTitle,<<%dlg%
              {units=F}{font=Calibri,12}{xmargin=4,4}{ysize=.3}
              {can_exit=close}
              {on_activate=refresh_view}
              
              {region}
              Select an owner to see the aircraft they own.;;
              Owner:  [%d;O={@@}%.40,8vcHead^#a_vcHead!NewHead];
              {endregion};
              
              {region}
              Double click on an Aircraft to change a column image.;;
              Aircraft: {sp=.3}[%d;O={@@}%.40,4vcCA^#a_vcCA!Edit_*];
              {endregion};;;
              
              
              {region}
              {sp=20}<10=cancel_button_label!CLOSE> 
              {endregion};
              %dlg%,<<%code%
              
              IF a_dlg_button = "close" THEN		'Close
              	ui_modeless_dlg_close(vTitle)
              	end
              	
              ELSEif a_dlg_button = "newhead" THEN
              
              	vcHeadTransno=left(vcHead,7)
              	auto_list_vcCA=CA_List(vcHeadTransno)
              	
              	'Apply 'owner draw' formatting information to the list
              	auto_list_vcCA = a5_owner_draw_list_fmt(auto_list_vcCA,Format3)
              	a_vcCA.initialize(auto_list_vcCA)
              	
              	a_dlg_button = ""
              
              ELSEif a_dlg_button = "Edit_dblclick" THEN
              	vcHeadTransno=left(vcHead,7)
              	vcCAKey = Right(vcCA,7)
              	ChgEntry( vcCAKey)
              
              	[B][COLOR="#008000"]goto BUILD_LIST[/COLOR][/B]
              '	if ChgEntry( vcCAKey) = .T. then
              '		auto_list_vcCA=CA_List(vcHeadTransno)
              '	end if
              
              	a_dlg_button = ""
              
              ELSEif a_dlg_button = "Refresh_View" THEN
              [B][COLOR="#008000"]BUILD_LIST:[/COLOR][/B]
              	'rebuild the corrective action list	
              	auto_list_vcCA=CA_List(vcHeadTransno)
              	
              	''Apply 'owner draw' formatting information to the list
              	auto_list_vcCA = a5_owner_draw_list_fmt(auto_list_vcCA,Format3)
              	a_vcCA.initialize(auto_list_vcCA)
              	
              	a_dlg_button = ""
              		
              end if
              	
              %code%	)
              
              END
              
              
              FUNCTION CA_List as C ( vTrans as C )
              
              	image1 = "{I:'a5_condition_green'}"
              	image2 = "{I:'A5_ball_white'}"
              	
              	image3 = "{I:'$$generic.checked.off'}"
              	image4 = "{I:'$$generic.checked.on'}"
              	
              	image5 = "{I:'A5_ball_green'}"
              	image6 = "{I:'A5_ball_white'}"
              	
              	auto_list_vcCA = table.external_record_content_get("ca_child",\
              	"\"  \"+If(c1=.T.,"+quote(var->image4)+","+quote(var->image3)+")+\"|\"+If(c2=.T.,"+quote(var->image5)+","+quote(var->image6)+")+\"|\" + If(c3=.t.,"+quote(var->image1)+","+quote(var->image2)+")+'|'+ Detail+\"|\"+swkno",\
              	"detail",\
              	"transno="+s_quote(vtrans))
              	
              	ca_list=auto_list_vcCA
              END FUNCTION
              
              
              FUNCTION ChgEntry as L ( caKey as C )
              	ChgEntry = .F.
              	dim shared t as P
              	dim shared vnRec as n = 0
              	
              	startover:
              	t = table.open("ca_child")
              	i = t.order("swkno")
              	vnRec = t.fetch_find(caKey)
              	
              	vca_transno = t.transno
              	vca_swkno = t.swkno
              	vca_C1 = t.c1
              	vca_C2 = t.C2
              	vca_C3 = t.C3
              	vca_Detail = t.detail
              	t.close()
              	
              	DIM SHARED XDialogStyle as P
              	XDialogStyle.AccentColor = "Off White"
              	XDialogStyle.Color = "Blue White"
              	
              	dim Shared c1 as L = vca_c1
              	dim shared c2 as L = vca_c2
              	dim shared c3 as L = vca_c3
              	DIM SHARED vca_Detail as C = vca_Detail
              	
              	DIM SHARED varC_result as C
              	ok_button_label = "&Save"
              	cancel_button_label = "&Close"
              	vTitle2 = "Edit Column Images"
              	
              	dlg_text = <<%dlg%
              {Windowstyle=Gradient Horizontal}
              {font=calibri,11}{units=F}{xmargin=4,4}{ysize=.3}
              
              {region}
              {font=calibri,11,b}
              Aircraft:{font=calibri,11} {text=15:vca_Detail};;;
              
              {region}
               Column 1: (c1) ;;
               Column 2: (c2) ;;
               Column 3: (c3) 
              {endregion};;;
              
              {sp=3}<%T=Save Changes%10=ok_button_label!OK>
              
              %dlg%
              	
              varC_result = ui_dlg_box(vTitle2, dlg_text, <<%code%
              
              'if a_dlg_button = "Close" then
              '	'the dialog will close
              	
              	
              'elseif a_dlg_button = "OK" THEN			'save
              if a_dlg_button = "OK" THEN			'save
              
              	dim shared tp as p
              	tp = table.open("ca_child")			'open another instance of the table
              	tp.fetch_goto(vnRec)					'go to the current record
              	tp.change_begin(.t.)					' put
              	
              	tp.c1 = c1
              	tp.c2 = c2
              	tp.c3 = c3
              	tp.change_end(.t.)
              	tp.close()
              	ChgEntry = .T.	
              
              '	''Apply 'owner draw' formatting information to the list
              '	ui_modeless_dlg_close(vTitle2)  ' Added
              '	
              	a_dlg_button = ""
              else
              	a_dlg_button = ""
              	
              END IF
              
              %code%)
              
              END FUNCTION
              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


                #8
                Re: Refrsh List in first xDialog when changes are made in a second xDialog

                Ron,

                You have the refresh problem and Try this modify code

                Code:
                ELSEif a_dlg_button = "Edit_dblclick" THEN
                	vcHeadTransno=left(vcHead,7)
                	vcCAKey = Right(vcCA,7)
                	ChgEntry( vcCAKey)
                '	if ChgEntry( vcCAKey) = .T. then
                '		auto_list_vcCA=CA_List(vcHeadTransno)
                '	end if
                
                '=================== Refresh list after close the dlg 	==========================================
                	'My test messages
                	msgbox("checking, Am i here before closed the dlg?")
                	'msgbox("what is the parent? "+vcHead)
                	'Filter again with the vcHead
                	
                	'Refresh list after close the dlg 
                	'You have called the Array list and it did not refreshed by it self(*automatic after closed the dlg)
                	'There is a simple way to get/recall(this action is called the "redim" ) the list with an array
                	'- I have to copied and pasted the create the list because i am still confusing to using an array.
                	'- Maybe other user can explain how to apply the "redim" and get a return value.
                	 
                'build the child list
                auto_list_vcCA = table.external_record_content_get("ca_child",\
                "\"  \"+C1+\"|\"+C2+\"|\"+C3+\"|\"+Detail+\"|\"+swkno",\
                "detail","Transno="+s_quote(vcHeadTransno))
                
                	'rebuild the corrective action list	
                	auto_list_vcCA=CA_List(vcHeadTransno)
                	
                	''Apply 'owner draw' formatting information to the list
                	auto_list_vcCA = a5_owner_draw_list_fmt(auto_list_vcCA,Format3)
                	a_vcCA.initialize(auto_list_vcCA)
                
                '===============================================================
                
                	a_dlg_button = ""
                
                ELSEif a_dlg_button = "Refresh_View" THEN

                Comment

                Working...
                X