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

set default value of repeating section column to parent field value

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

    set default value of repeating section column to parent field value

    does anyone know how?

    From the description in the default value I can only use literal value, argument, or session variable.

    I hope I don't have to make a callback to set a session variable. Is there a better way?
    Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

    #2
    Re: set default value of repeating section column to parent field value

    I am assuming this is in a dialog/ux with repeating section (since you are in version 12, I do not know what other controls have repeating section in that version, I don't have version 12)
    instead of default value if you define the value of the repeating section field as calculated field referring back to the parent field it will populate once the parent field is filled in. I am sure.
    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


      #3
      Re: set default value of repeating section column to parent field value

      You don't say where, when, etc. you want to do this... but... if you want to click the add row button for a repeating section and have a value from the "parent" section fill a control in that new row, you could do this.

      In the Client-side event, afterRptSectionRowAdd

      Code:
      var cmpy = {dialog.Object}.getValue('COMPANY'); //parent control
      
      {dialog.object}.setValue('SystemType:-1',cmpy);
      SystemType is a control within a repeating section. -1 targets that new row.

      Comment


        #4
        Re: set default value of repeating section column to parent field value

        Thanks gandhi, that is one way of doing it. The issue for me is that I would like to be able to modify the value in each row if necessary.

        David, Thanks for the tip. Sometimes I don't know what I am really looking for until I experiment with what I think I need.

        So what I was actually trying to achieve is have a column in the repeating section set to a literal value. Very easy in the Initial Value property. I have a field in the parent section that holds the same initial value. When I change that value I needed the values in the repeating section column to reflect the change.
        Ultimately I would like the value in the repeating section to reflect the parent value at the time the ux is built and as each new row is added so that I would not have to hard code those numbers. I could just change it in the parent table.

        This is how I accomplished it.

        In the parent fields onChange event:

        I do a callback to this xbasic function: xbSetMarkup

        This id the code in the function
        Code:
        	dim mu as n
        	dim rc as n
        	dim str as c
        	mu = e.dataSubmitted.markup
        	rc = e.repeatingSectionInfo[1].rowCount
        	
        	for r = 1 to rc
        		str = 	"e._set.eliMarkup_a5instance"+alltrim(str(r))+".value"
        		eval(str) = mu
        	next
        When I change the value in the default markup field in the parent section it loops through the rows in the repeating section updating the markup column for the line items.
        It is a 'c a l l b a c k'. Ii seems like there should be a way to get it done client side but I can't see how.
        Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

        Comment


          #5
          Re: set default value of repeating section column to parent field value

          Ok... this is a very different question.

          You want to set the default value of a repeating section control based on a parent control value... and... you want to be able to change that parent control value and reflect that change in a repeating section control - for all existing rows. You know now how to set the default value based on a parent value. Now, let's change those existing values.

          If you have source data at the client level, then I don't think you ever need to go back to the server to get something done.

          Code:
          var currCmpy = {dialog.Object}.getValue('COMPANY');
          var rptSect = {dialog.Object}._findRepeatingSection('SystemType');
          var rptSectRows = eval("{dialog.Object}.repeatingSections." + rptSect + ".rows");
          for(i=0;i<=rptSectRows;i++){
          	{dialog.Object}.setValue('SystemType:'+i,currCmpy);
          }
          First, we grab the parent control value... in this case 'COMPANY'.
          Then, using the control we want to change, let's find out which Repeating Section it's in.
          We now know the Section, so let's go get the number of rows in that section.
          Then, in a loop, .setValue() each row.

          Comment


            #6
            Re: set default value of repeating section column to parent field value

            David thank you for your help.

            This line is giving me some trouble though
            var rptSectRows = eval("{dialog.Object}.repeatingSections." + rptSect + ".rows");

            In firebug I get this error:
            WO_BR_UX_103753OSXQ_EST_BR_UX_UTFC_DlgObj.repeatingSections..rows

            It looks like there are 2 dots between repeatingSections and rows.

            I tried this
            var rptSectRows = eval("{dialog.Object}.repeatingSections." + rptSect + "rows");

            But I get nothing. I am not sure of what is wrong with this line.

            var rptSectRows = 5 yields the desired result. I am very close.
            Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

            Comment


              #7
              Re: set default value of repeating section column to parent field value

              http://screencast.com/t/ULhKezop

              http://screencast.com/t/S7osiFEB

              take a look at these screencasts.
              I did this with three javascript events, I don't think you can do it in one.
              this is my assumption after reading your reply in post #4.
              1> you want to set the default value in a control in repeating section to the value from the head section.
              2> you want to be able to change the value in the repeating section control on the fly.
              3> when a new row in the repeating section is added the value from the head section is to be copied as default value.
              4> and not the least, when you change the value in the head section all the rows in the repeating section should change to reflect the new value.
              if these assumptions are correct, the above screencasts will show you how.
              hope this helps.
              Last edited by GGandhi; 10-01-2015, 08:12 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


                #8
                Re: set default value of repeating section column to parent field value

                Frank, it looks like your UX is sitting inside something... or being opened by something. Try this instead...

                Code:
                var currCmpy = {dialog.Object}.getValue('COMPANY');
                var rptSectRows = {dialog.Object}._getRepeatingSectionRowCount("REPEATINGSECTION_1");
                for(i=0;i<=rptSectRows;i++){
                	{dialog.Object}.setValue('SystemType:'+i,currCmpy);
                }
                Swapping out your own info for .getValue, the repeating section, and .setValue.

                Comment


                  #9
                  Re: set default value of repeating section column to parent field value

                  Thank you gentlemen for your generous assistance.
                  I am using gandhi's method for the default value and I have used a combination of both David and gandhi's methods in the onChange event and it works perfectly.
                  Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                  Comment

                  Working...
                  X