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

XBasic Handling of Repeating Sections

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

    XBasic Handling of Repeating Sections

    We just discovered something about the way XBasic (in particular the AfterDialogValidate server side function) handles repeating section data.

    We are currently trying to construct a SOAP call based on submitted data. One of the sections in the SOAP call contains a repeating section of fields, so we match it with a repeating section on our form. We loop through by using something similar to the following code:

    Code:
    FOR i = 1 TO e.dataSubmitted.field.size()
        xmlVar = xmlVar + <<%xml%
    <xmlField>{e.dataSubmitted.field[i]}</xmlField>
    %xml%
    NEXT
    
    xmlVar = evaluate_string(xmlVar)
    Etc etc. That's just a very slim example of the code we are using, but it describes the issue.

    Our issue is, apparently in the way XBasic handles the e.dataSubmitted for repeating section rows, it takes the physical row number, and therefore takes deleted rows into account.

    For example: Say we have a repeating section with 4 rows, and we delete the 3rd row, so now only 3 rows remain. e.dataSubmitted.field.size() will be 4, and e.dataSubmitted.field[3] will contain the value of the field in the 3rd repeating section row that was deleted, and not the 4th row that became the 3rd row.

    I need to know if there's a simple way to make this loop only get data from the Logical rows, not the physical ones. I don't care about deleted rows, since they are deleted, and obviously I won't be using them.

    Thanks.

    #2
    Re: XBasic Handling of Repeating Sections

    Have you looked at some prototype code for a callback? It has all of what you need. Here's some that is immediately useful, and check out the .deletedRows property.

    '--------------------Repeating Sections ----------------------------------------
    'If your dialog contains repeating sections, data in the repeating sections will be in an array.
    'For example, say that your dialog has a repeating section that includes a field called QTY:
    'e.dataSubmitted.qty[1] - contains data from first repeating section row
    'e.dataSubmitted.qty[2] - contains data from second repeating section row, etc
    'e.dataSubmitted.qty.size() - number of entries in the array.

    'In addition, the e object will contain information about the repeating sections
    'e.repeatingSectionNames - a comma delimited list of the name (container ID) or each repeating section
    'e.repeatingSectionInfo - a property array with one entry for each repeating section.
    'The e.repeatingSectionInfo[] array will have these properties for each entry:
    ' - .activeRow - the row in the repeating section that had focus when the Dialog was submitted
    ' - .deletedRows - a CRLF delimited list of rows that were deleted. e.g. 1 and 3
    ' - .rowCount - a count of the number of non-deleted rows
    ' - .totalRowCount - a count of all rows in the repeating section including rows that were deleted
    ' - .fieldsInRepeating section - a CRLF delimited list of fields in the repeating section
    ' - .dirtyRowsInSection - a CRLF delimited list of rows in the repeating section that were edited. (A row that was edited, then deleted will still appear in this list).
    ' - .dirtyFieldsInSection - a CRLF delimited list of fields in the repeating section that were edited. for example: PARTNO_A5INSTANCE3 is the 'PARTNO' field in row 3.
    '-------------------------------------------------------------------------------------------
    -Steve
    sigpic

    Comment


      #3
      Re: XBasic Handling of Repeating Sections

      Yep, looked at all of that already.

      I considered writing a loop that would be something similar to the following:

      Code:
      FOR i = 1 TO e.repeatingSectionInfo[1].totalRowCount
          if .NOT. word_exists(e.repeatingSectionInfo[1].deletedRows, convert_type(i, "C")) then
              ' Code to handle data in the event that it's not in a deleted row
          end if
      NEXT
      But I wanted to see if there was a simpler way. I assumed there was a simple way to access only the Logical rows, i.e. the rows that actually exist on the repeating section, excluding deleted ones, in a way like the current existing way (e.dataSubmitted.rs_control[1]) that I just didn't know about.

      If there is no other way to ONLY get the data from the rows that were not deleted at the time of submission, then I guess I'll implement the fix that I described.

      I would still like to know if anyone has any other possible solutions.

      Comment


        #4
        Re: XBasic Handling of Repeating Sections

        take a look at video d30 in version 11, there is a method to relate the logical rows to physical rows, you should be able to use that property.
        repeatingSection[1].logicalRowToPhysicalRowMap property.
        that video will give some hints to make use of this property.
        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: XBasic Handling of Repeating Sections

          Hi David

          There is a variable that is created that I make use of in this situation; I use it for all repeating section when I am working with them so the variable is

          e.repeatingSectionInfo[1].visibleRows

          and this is how I use it

          Code:
          LIST1 = e.repeatingSectionInfo[1].visibleRows
          list1 = crlf_to_comma(list1)
          for i = 1 to e.repeatingSectionInfo[1].totalRowCount
          	Vrow = convert_type(i,"C")
          if inlist2(Vrow,list1) = .t. then
          So if vRow (which is the Logical Row Number) is in list1 (which is the visible rows) then I work with the row if not visible just move on to the next row

          Hope it helps

          Andy

          Comment


            #6
            Re: XBasic Handling of Repeating Sections

            Hi Andy,

            Thanks for the response.

            I actually just implemented the code that I listed above:

            Code:
            FOR i = 1 TO e.repeatingSectionInfo[1].totalRowCount
                if .NOT. word_exists(e.repeatingSectionInfo[1].deletedRows, convert_type(i, "C")) then
                    ' Code to handle data in the event that it's not in a deleted row
                end if
            NEXT
            And it seems to have worked perfectly.

            I was hoping there was something like a secondary array of e.dataSubmitted.rs_control_logical[] or something that would make it easier, but it doesn't seem like there is.

            Thanks for all the suggestions.

            Comment

            Working...
            X