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

How do I refresh one control on a parent UX

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

    How do I refresh one control on a parent UX

    I have a UX component (1), that has a related child UX component (2). The child can open another UX component (3), used similar to a lookup.

    I say similar as when an item is selected from UX (3), using an ajax callback, the item is added to the end of the existing text in a text area in UX (2).

    What I can't figure out is how to refresh the textarea so when UX (3) closes and UX (2) become visible, UX (2) shows the update textarea with the text I just added.

    If I close UX (2) and reopen UX (2), the new text is there.


    Code:
    {dialog.Object}.validate();A5.msgBox.show('Confirm','<div style=\' padding: 10pt;\'>Insert Selected Phrase into Corrective Action?</div>','yn',function(button) {
    if(button == 'yes'){
    
    {dialog.object}.runAction('Insert_Phrase');
    
    setTimeout(function(){
    		//myvar shows a message which contains the textarea text of the parent
    		//right now it shows the text before the ajax callback has run
    		//I can't figure out how to update the one control on the parent
    		var po = {dialog.object}.getParentObject();
    		myvar = po.getValue('CA')
    		alert(myvar);
    
    		var ele = {dialog.Object}.getPointer('BUTTON_6');
    		{dialog.Object}.closeContainerWindow(ele);
    		}, 500);
    	}
    });
    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: How do I refresh one control on a parent UX

    You're not showing a variable with the added text anywhere... but... assuming you have it... and it's in a javascript variable named newText...

    myvar = myvar + newText;
    po.setValue('CA',myvar[,true|false]);

    where the optional true or false is set depending on what you want to do.

    Comment


      #3
      Re: How do I refresh one control on a parent UX

      I probably should have mentioned that I'm using a DBF table.
      I'm stuck with the DBF as this is a WEB app joined to an already functioning Desktop app.

      The ajax callback is writing to the table the new value for the textarea and that part is working just fine.
      My problem is how do I update the one control in the parent to show the new value written to the textarea.

      Everything I've tried doesn't work. The only thing that works is to close the UX and re-open the UX.
      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: How do I refresh one control on a parent UX

        even if it is DBF, why you need to update the backend when you can update the ux and when satisfied then submit the data to the backend from ux2. you should treat ux3 as "similar" to look up, that is what your plan is. ( i am not sure that will get ux3 dirty or not). what if the customer changes their mind and not save that data?
        thanks for reading

        gandhi

        version 11 3381 - 4096
        mysql backend
        http://www.alphawebprogramming.blogspot.com
        [email protected]
        Skype:[email protected]
        1 914 924 5171

        Comment


          #5
          Re: How do I refresh one control on a parent UX

          This is not your typical lookup. It's more a copy and paste. UX 3 does not get dirty and in no way is connected to UX 2 other than UX 3 is opened by UX 2 in it's own window. After the paste into UX 2, UX 3 is closed.

          Everything is working except I need to refresh one control in UX 2 before/after UX 3 is closed.
          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: How do I refresh one control on a parent UX

            My problem is how do I update the one control in the parent to show the new value written to the textarea.
            is this a different control in the ux other than the textarea?
            thanks for reading

            gandhi

            version 11 3381 - 4096
            mysql backend
            http://www.alphawebprogramming.blogspot.com
            [email protected]
            Skype:[email protected]
            1 914 924 5171

            Comment


              #7
              Re: How do I refresh one control on a parent UX

              The ajax callback is writing to the table the new value for the textarea and that part is working just fine.
              My problem is how do I update the one control in the parent to show the new value written to the textarea.
              Ok... this explains it a bit better.

              Code:
              {dialog.Object}.refreshPrimaryKeyList();
              Will retrieve all the keys and data from the server... and refresh the data shown... but... it navigates you back to the 1st record.

              {dialog.Object}.populateControlsFromTable(primaryKey [,flagShowDebuggingInfo [, onCallbackCompleteCode [,debugInfoLocation]]]);
              Will get just that record's data.

              Or... you could just cheat and use a po.setValue(newText,false); back into the UX... and it will "look" like it's been refreshed but not trigger a dirty flag.

              Also... have a look at
              Code:
              {dialog.Object}._populateSourceComponent();
              Read the inline description on this. You've not described how you're getting to UX 3, so maybe this method could help.
              Last edited by Davidk; 07-08-2017, 07:21 PM.

              Comment


                #8
                Re: How do I refresh one control on a parent UX

                Dave, thanks for your help.

                I didn't understand your first response. But after working with GGandhi, I took a different approach to what I was trying to do.
                This approach is most likely what you thought I was doing.

                GGandhi, thank you very much.

                Code:
                {dialog.Object}.validate();A5.msgBox.show('Confirm','<div style=\' padding: 10pt;\'>Insert Selected Phrase into Corrective Action?</div>','yn',function(button) {
                if(button == 'yes'){
                
                var newVar = {dialog.object}.getValue('Phrase_List');
                	
                var po = {dialog.object}.getParentObject();
                var myvar = po.getValue('CA');
                		
                myvar = myvar + "\n" + newVar;
                po.setValue('CA',myvar);
                
                var ele = {dialog.Object}.getPointer('BUTTON_6');
                {dialog.Object}.closeContainerWindow(ele);
                Again,

                Dave and GGandhi, thank you very much.
                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


                  #9
                  Re: How do I refresh one control on a parent UX

                  Well I'm confused. I thought I'd suggested po.setValue(). No matter... glad it worked out.

                  Comment


                    #10
                    Re: How do I refresh one control on a parent UX

                    My original methodology was to write from UX3 to the backend and then try to update UX2.

                    GGandhi recommended that I change UX2 with the selection from UX3, then save to the backend.

                    Far easier and more logical. Your suggestion but I wasn't thinking along those lines.
                    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

                    Working...
                    X