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

Show works, Hide doesn't

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

    Show works, Hide doesn't

    I have some static text on a UX component that reminds the user to press the submit button after making any changes. The Client side show/hide expression is "dialog.isDirty = true".

    When I press the submit button and save any changes, I guess the dialog is still dirty as the static text remains in view. If I navigate to another record, the static text becomes hidden.

    I guess my approach is wrong. How should I do this?

    Thanks.
    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: Show works, Hide doesn't

    I'm not seeing this behaviour. My StaticText control is initially hidden when the UX is rendered because of the Client Side Show/hide expression... dialog.isDirty = true. I can make a change to data in a Control and the StaticText is displayed and Submit is enabled. I click Submit, which then disables, and my StaticText disappears.

    What else is going on with your UX? Callbacks? Lists? What type of controls are you changing? Is this a Data Bound UX? Or a List Bound UX?

    Comment


      #3
      Re: Show works, Hide doesn't

      David, thanks for asking.

      What else is going on with your UX? Callbacks? Lists? What type of controls are you changing? Is this a Data Bound UX? Or a List Bound UX?
      No callbacks, textbox, textarea, 2 RepeatingSections, data bound ux, no list, DBF Tables.

      Submit button code:

      Code:
      {dialog.object}.submit();
      
      {dialog.object}.fadeOutMessage('{dialog.componentname}.V.R1.MESSAGE','Saved Changes',3000,true);
      afterDialogValidate:

      Code:
      ''change the hdr record
      dim t as p
      t = table.open("[PathAlias.ADB_Path]\po_hdr.dbf")
      idx = t.order("Ptransno")
      t.fetch_find(e.datasubmitted.ptransno)
      t.change_begin()
      t.approve = w_upper(e.datasubmitted.approve)
      t.v1 = w_upper(e.datasubmitted.v1)
      t.v2 = w_upper(e.datasubmitted.v2)
      t.v3 = w_upper(e.datasubmitted.v3)
      t.v4 = w_upper(e.datasubmitted.v4)
      t.s1 = w_upper(e.datasubmitted.s1)
      t.s2 = w_upper(e.datasubmitted.s2)
      t.s3 = w_upper(e.datasubmitted.s3)
      t.s4 = w_upper(e.datasubmitted.s4)
      t.ship_how = w_upper(e.datasubmitted.ship_how)
      t.status = upper(e.datasubmitted.status)
      t.tail_num = upper(e.datasubmitted.tail_num)
      t.terms = w_upper(e.datasubmitted.terms)
      t.notes1 = w_upper(alltrim(e.datasubmitted.notes1))
      t.notes2 = w_upper(alltrim(e.datasubmitted.notes2))
      t.D_ship = e.datasubmitted.d_ship
      t.pDate = e.datasubmitted.pdate
      t.receive_d = e.datasubmitted.receive_d
      t.receive_i = upper(e.datasubmitted.receive_i)
      t.req_by = upper(e.datasubmitted.req_by)
      t.req_for = w_upper(e.datasubmitted.req_for)
      t.written = upper(e.datasubmitted.written)
      t.change_end(.t.)
      t.close()
      
      'debug(1)
      
      '''now fill in the child table, po_parts, [1]
      if isnull(e.repeatingsectioninfo[1].dirtyRowsInSection) then
      	'no dirty rows to process
      else
      	if e.repeatingsectioninfo[1].totalRowCount >= 1 then
      		tc = e.repeatingsectioninfo[1].totalRowCount
      		list1 = e.repeatingsectioninfo[1].deletedRows	'crlf_to_comma()
      		i = 1
      		dim tbl1 as p
      		while i <= tc
      
      			if word_exists(list1,alltrim(str(i)),crlf()) = .F. then
      				' Code to handle data in the event that it's not in a deleted row
      				' get info that makes this record unique
      				scrch = e.olddatasubmitted.po_part_id[i]				
      				tbl1 = table.open("[PathAlias.ADB_Path]\po_parts.dbf")
      				idx = tbl1.order("Po_part_id","ptransno="+s_quote(e.datasubmitted.PTransno))
      				rs = tbl1.fetch_find(val(scrch))
      				
      				if rs < 1 then
      					tbl1.enter_begin()
      					tbl1.ptransno = e.datasubmitted.PTransno
      					tbl1.site = upper(e.datasubmitted.po_loc)
      					tbl1.cost = val(e.datasubmitted.cost[i])
      					tbl1.Item = w_upper(e.datasubmitted.item[i])
      					tbl1.Itemno = e.datasubmitted.itemno[i]
      					tbl1.markup = val(e.datasubmitted.markup[i])
      					tbl1.pn = w_upper(e.datasubmitted.pn[i])
      					tbl1.q_ordered = val(e.datasubmitted.q_ordered[i])
      					tbl1.q_rec = val(e.datasubmitted.q_rec[i])
      					tbl1.status = e.datasubmitted.pt_status[i]
      					tbl1.enter_end(.t.)
      					tbl1.close()
      				else
      					tbl1.change_begin()
      					tbl1.cost = val(e.datasubmitted.cost[i])
      					tbl1.Item = w_upper(e.datasubmitted.item[i])
      					tbl1.Itemno = e.datasubmitted.itemno[i]
      					tbl1.markup = val(e.datasubmitted.markup[i])
      					tbl1.pn = w_upper(e.datasubmitted.pn[i])
      					tbl1.q_ordered = val(e.datasubmitted.q_ordered[i])
      					tbl1.q_rec = val(e.datasubmitted.q_rec[i])
      					tbl1.status = e.datasubmitted.pt_status[i]
      					tbl1.change_end(.t.)
      					tbl1.close()
      				end if
      			end if
      			
      			i = i + 1
      		end while
      	end if
      end if
      
      
      '''now fill in the child table, po_frt, [2]
      if isnull(e.repeatingsectioninfo[2].dirtyRowsInSection) then
      	'no dirty rows to process
      else
      	if e.repeatingsectioninfo[2].totalRowCount >= 1 then
      		tc2 = e.repeatingsectioninfo[2].totalRowCount
      		list2 = e.repeatingsectioninfo[2].deletedRows	'crlf_to_comma()
      		i2 = 1
      		dim tbl2 as p
      		while i2 <= tc2
      			
      			if word_exists(list2,alltrim(str(i2)),crlf()) = .F. then
      				' Code to handle data in the event that it's not in a deleted row
      				' get info that makes this record unique
      				scrch2 = e.olddatasubmitted.po_frt_id[i2]
      				tbl2 = table.open("[PathAlias.ADB_Path]\po_frt.dbf")
      				idx2 = tbl2.order("po_frt_id","ptransno="+s_quote(e.datasubmitted.PTransno))
      				rs2 = tbl2.fetch_find(val(scrch2))
      				
      				if rs2 < 1 then
      					tbl2.enter_begin()
      					tbl2.ptransno = e.datasubmitted.PTransno
      					tbl2.site = upper(e.datasubmitted.po_loc)
      					tbl2.amt = val(e.datasubmitted.amt[i2])
      					tbl2.Frt = w_upper(e.datasubmitted.frt[i2])
      					tbl2.status = e.datasubmitted.f_status[i2]
      					tbl2.enter_end(.t.)
      					tbl2.close()
      				else
      					tbl2.change_begin()
      					tbl2.amt = val(e.datasubmitted.amt[i2])
      					tbl2.Frt = w_upper(e.datasubmitted.frt[i2])
      					tbl2.status = e.datasubmitted.f_status[i2]
      					tbl2.change_end(.t.)
      					tbl2.close()
      				end if
      			end if
      			
      			i2 = i2 + 1
      		end while
      	end if
      end if
      PO_Form.PNG

      I might add, I have the same expression on the submit button Enable which works fine.
      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: Show works, Hide doesn't

        I still can't reproduce this. Under 2999, but with SQL. It's a StaticText control... right? You could try isDataDirty.

        If you want to get around it, use this in your Submit code... just hide it yourself.

        Code:
        {dialog.object}.setControlDisplay('STATICTEXT_1',false,'d',{type: 'fade',duration: 3000});
        After the submit, all the UX flags get reset... and so your StaticText message will appear again after an edit.

        Comment


          #5
          Re: Show works, Hide doesn't

          I'm sorry, I made a mistake. The submit button is responding the same as the static text message.

          So what is happening, I make a change to a field. The form is now dirty. I press the submit button and the change is saved. At this point, the form is now dirty with the static text and the submit button still visible.

          Not sure if this is right, but if I press the reset button, the original value for the field I changed becomes visible. But if I navigate to a different record and then back to the record I changed, the new value that I entered and then saved is in the field I changed.

          So it appears that even though I make a change and it is indeed saved, the form doesn't know the change has been saved.

          Does this make sense?
          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: Show works, Hide doesn't

            If you create a new, simple UX... I think you'll find the correct behaviours for Submit and Reset... and your StaticText control.

            I just created a simple UX, bound to a DBF, and the behaviours are right.

            Something is really messed up for you. After you Submit, you can't click the Reset button... it's disabled. Even if you remove it's disable expression... if you change a record, save it, and click the Reset button, no change is made to the data controls. After you Submit, the original value is now the current value.

            Comment


              #7
              Re: Show works, Hide doesn't

              {dialog.object}.fadeOutMessage('{dialog.componentname}.V.R1.MESSAGE','Saved Changes',3000,true);
              can you remove this line and check to see if the dialog is behaving?
              i think you are setting a control in ux Message to Saved Changes and that is making the dialog dirty again.,
              i looked at the image i don't know where it is.
              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


                #8
                Re: Show works, Hide doesn't

                Gandhi, did you test this?

                .fadeOutMessage(), in this case, acts upon a Placeholder, which shouldn't affect the dirty Status of a UX.

                Does .fadeOutMessag() make your UX dirty?

                Comment


                  #9
                  Re: Show works, Hide doesn't

                  Originally posted by Davidk View Post
                  Gandhi, did you test this?

                  .fadeOutMessage(), in this case, acts upon a Placeholder, which shouldn't affect the dirty Status of a UX.

                  Does .fadeOutMessag() make your UX dirty?
                  my mistake.
                  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


                    #10
                    Re: Show works, Hide doesn't

                    I guess I must of had a brain cramp as this isn't the first UX component I made with this problem. I looked at some of my others and looked at the javascript on other submit buttons. As it turns out, this is a problem I've had with all of my UX components. The following is the javascript I have to run to have the desired results. Maybe this has been fixed in later builds, I don't know.

                    Thanks for your help.

                    Code:
                    function tempfunction_63920708_be5a_4ba9_9664_18b05b5047e3() {
                    {dialog.object}.submit();
                    }
                    
                    function tempfunction_8bc7cadc_0b70_49cc_a139_218f75ad583a() {
                    var data = {dialog.object}.getValue('PTRANSNO');
                    {dialog.object}.populateControlsFromTable(data,false,'','<Default>','<Default>',{"showWaitMessage": false});
                    }
                    
                    function tempfunction_1bb6acf2_9abd_419e_8453_1fd1a829af24() {
                    {dialog.object}.fadeOutMessage('{dialog.componentname}.V.R1.MESSAGE','Saved Changes',3000,true);
                    }
                    
                    A5.executeThisThenThat(tempfunction_63920708_be5a_4ba9_9664_18b05b5047e3,tempfunction_8bc7cadc_0b70_49cc_a139_218f75ad583a,tempfunction_1bb6acf2_9abd_419e_8453_1fd1a829af24);
                    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


                      #11
                      Re: Show works, Hide doesn't

                      Were you always running the .populateControlFromTable() method?

                      Comment


                        #12
                        Re: Show works, Hide doesn't

                        when i looked at your code to save the record, my mind was set to look at the fade out message and i skipped this information.
                        when you have an ux/dialog and want to save the data normally you will just create an actionscript function
                        ExecuteServerSideAction("Save Data::Save_Submitted_Data_to_Table_s")
                        and that's it. but you are not using it, may be that is what gives you desired results in saving the data for you, but if you create a simple data bound dialog and add the
                        ExecuteServerSideAction("Save Data::Save_Submitted_Data_to_Table_s")

                        and place the cursor on that function and convert it to xbasic you will see you will see it sends a whole bunch of commands to the browser. one of them is to fire jsToFireAfterSaveEvent as seen here
                        e.javascript = e.javascript + ";" + crlf() +\
                        jsShowUpdateCommands + crlf() +\
                        jsShowErrors + crlf()+\
                        rtc.javascript.refreshAllControls + crlf() +\
                        rtc.javascript.setPrimaryKeyinStateObject + crlf()+\
                        rtc.javascript.prepareDialog + crlf() +\
                        jsToFireAfterSaveEvent + crlf()+\
                        jsEnterNewRecord + crlf()+\
                        jsConfirmationMessage + crlf()+\
                        rtc.javascript.refreshDependentListControls
                        may be that is the one clearing out the dialog is dirty setting, i do not know.
                        since you are not utilizing alpha generated save function, i think it is better to convert one of your dialog save action to xbasic and study and adjust your code to match what they are doing with their command ( when you use their save command all works as expected, i tested it with static text and place holder message). that should solve all the problems you encounter in your ux/dialogs if you so choose to use your own save function.

                        for all practical purposes your methodology resembles what people normally do in desktop side where you just talk directly to the server and the customer. here on the web side you need to use the browser agent also to keep all synchronized. that is how i think.
                        Last edited by GGandhi; 06-08-2017, 05:34 AM.
                        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


                          #13
                          Re: Show works, Hide doesn't

                          David, Not sure what you are asking but that code is what I found to work.

                          Gandhi, you are correct as my back ground is desktop and my mind is thinking desktop. I'm out most of today, but I will take a look at what you posted.

                          Thanks to both of you.
                          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


                            #14
                            Re: Show works, Hide doesn't

                            normally you will just create an actionscript function
                            ExecuteServerSideAction("Save Data::Save_Submitted_Data_to_Table_s")
                            and that's it.
                            I was under the impression that if I was using DBF tables, I would have to write my own xbasic code to enter or save changes.

                            I took one of my UX components, duplicated it and made the following changes:

                            Submit button: {dialog.object}.submit();
                            OnDialogInitialize: ExecuteServerSideAction("Get Primary Keys for Parent Table::Load_Primary_keys_for_Parent_Table")
                            afterDialogValidate: ExecuteServerSideAction("Save Data::Save_Submitted_Data_to_Table_s_")

                            Well dang if it doesn't work.

                            I then added a New Record Button and Dang if that didn't work too.

                            I then tried the same on a UX component with repeating sections and It seems to work there too.
                            The exception is if I enter a new row, that doesn't work.

                            So I'm guessing that I need to add code to save the new row as soon as I add it. Not quite sure about that.

                            Anyways, I've got to tell you I have spent hours on this. I wish I figured this out sooner.

                            Gandhi, thank you so 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


                              #15
                              Re: Show works, Hide doesn't

                              everything will work.
                              give me 10 minutes will post a simple sample. if you are faster post yours in screencast.
                              Last edited by GGandhi; 06-08-2017, 05:57 PM.
                              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

                              Working...
                              X