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

Row Expander with custom xbasic object

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

    Row Expander with custom xbasic object

    I am trying to use the row expander with a custom xbasic object. Right now, I can fill it with a session variable that get's filled on the client side event CanRowExpand , but I can't get the info fast enough, so first it loads old info then refreshes to add new.

    My question is does anyone know how to use the following recommended feature:

    Code:
    e.primaryKeyValuesArray = Array containing values for all columns in the primary key for the current row

    This is what I've tried (I don't know if it's correct)

    Code:
    dim session.Comments as c = e.primaryKeyValuesArray.comments

    And this is the crazy error I get (things like function are misspelled, maybe it's an error :-/ I normally don't say that but it's so strange)

    Screen Shot 2013-08-29 at 7.40.47 PM.png

    #2
    Re: Row Expander with custom xbasic object

    Bump, I really need this working, anyone know how to use it properly?

    Comment


      #3
      Re: Row Expander with custom xbasic object

      I don't have time to study you code but CanRowExpand is JavaScript. Your using xbasic. Maybe the server side xbasic OnExpandRow would work for you?
      Peter
      AlphaBase Solutions, LLC

      [email protected]
      https://www.alphabasesolutions.com


      Comment


        #4
        Re: Row Expander with custom xbasic object

        I don't know enough about javascript in order to convert it over to xbasic

        This is the code I'm using on client side events (which I've tried a few different events canRowExpand, onRowSelect, afterRowExpand, BeforeAjaxCallback)

        Code:
        var rowNum = {Grid.Object}._selectedRow;
        var ele = {grid.object}.getValue('G','COMMENTS',rowNum);
        var pstring = '__comments=' + ele
        
        {grid.Object}.ajaxCallback('G',rowNum,'OnRowExpand', '', pstring
        So I attempted to convert this over to the server side (and this is where my lack of javascript skills comes in)

        Code:
        dim rowNum as n = "{Grid.Object}._selectedRow;"
        dim ele as c = "{grid.object}.getValue('G','COMMENTS',rowNum);"
        dim pstring as c = "'__comments=' + ele"
        	
        e.javascipt = "{grid.Object}.ajaxCallback('G',rowNum,'OnRowExpand', '', pstring);"

        I ended up with an empty value

        The function I am calling from that code sets the session variable like this:

        Code:
        dim session.Comments as c = ""
        session.Comments = e.__comments
        Then I use that session variable in another function to add the value to the row expander

        I feel like there are ways to do less steps and get better results but I really don't know how.

        Comment


          #5
          Re: Row Expander with custom xbasic object

          {grid.Object}.ajaxCallback('G',rowNum,'OnRowExpand', '', pstring)

          I assume that "OnRowExpand" is the name of your xbasic function? if so that's probably not a good name to use. You can't call the event if that's what you are trying to do?
          Peter
          AlphaBase Solutions, LLC

          [email protected]
          https://www.alphabasesolutions.com


          Comment


            #6
            Re: Row Expander with custom xbasic object

            Yes, that is the name of my function, I can change that.

            Comment


              #7
              Re: Row Expander with custom xbasic object

              I did change the name of the function and that didn't make a difference, I don't think my javascript code was correct.

              Does anyone know how to use this: e.primaryKeyValuesArray

              correctly?

              Thanks so much!!! :-)

              Comment


                #8
                Re: Row Expander with custom xbasic object

                Lily,

                Your explanation for what you are trying to do is a little confusing. It might help if you tell us what you are trying to do?

                e.primaryKeyValuesArray = Array containing values for all columns in the primary key for the current row
                According to the inline documentation:
                'e.primaryKeyValuesArray - an array of the primary key values for the row that was expanded.
                This contradicts your quote above.

                Remember too, you can only use e.primaryKeyValuesArray server side, not client side.
                Peter
                AlphaBase Solutions, LLC

                [email protected]
                https://www.alphabasesolutions.com


                Comment


                  #9
                  Re: Row Expander with custom xbasic object

                  That is an exact quote from the commented section of the function prototype in the row expander function. So I really don't know what the correct explanation is.

                  Properties>Row Expander >Row Expander Linked Content >Add Object > Add Custom XBasic Object >Show xBasic Function Prototype

                  Code:
                  function SupplementDetails as c (e as p)
                  'Request - The Request object. Includes Request.Variables, which should be used instead of the older e.rv construct
                  'Session - The Session object. Should be used instead of the older e.session construct
                  
                  'The 'e' object that is passed in contains:
                  
                  'e.tmpl - Grid definition
                  'e.rtc - A pointer variable that is passed to all server-side events allowing you to pass data from one event handler to another
                  'e.__si = Saved state information
                  'e.rowNumber = Row number of the current Grid row
                  'e.primaryKeyValuesArray = Array containing values for all columns in the primary key for the current row
                  'e.request = Request object
                  'e.componentName = Grid alias
                  
                  
                  'Your function must return the HTML that will be displayed.
                  'If you want your function to also return some Javascript then set the e.javascript property
                  
                  SupplementDetails = "Return HTML to display"
                  
                  end function

                  Do you think it is the wrong explanation?

                  Comment


                    #10
                    Re: Row Expander with custom xbasic object

                    Lily - Basically, e.primaryKeyValuesArray returns the primary key of the parent row that is being expanded.
                    -Steve
                    sigpic

                    Comment


                      #11
                      Re: Row Expander with custom xbasic object

                      Okay, then that description is wrong :-(

                      Comment


                        #12
                        Re: Row Expander with custom xbasic object

                        Originally posted by RankFirstPro View Post
                        Okay, then that description is wrong :-(
                        "'e.primaryKeyValuesArray = Array containing values for all columns in the primary key for the current row "

                        If the primary key consists of more then one column/field then I can very well understand why it is being described as it is :)
                        So if the key is a single field you will have a single value in the array.
                        If the key consists of two fields you will have two values in the array.

                        hth

                        Pieter

                        Comment


                          #13
                          Re: Row Expander with custom xbasic object

                          That makes sense, I didn't slow down to think about it I guess. I was just focused on all columns for the row and skipping over the rest of the description. Thanks Pieter.

                          Comment


                            #14
                            Re: Row Expander with custom xbasic object

                            Originally posted by RankFirstPro View Post
                            That makes sense, I didn't slow down to think about it I guess. I was just focused on all columns for the row and skipping over the rest of the description. Thanks Pieter.
                            The best way to see what's going on in situations like this is to simply use the debugger. Then you can inspect the contents of e.primaryKeyValuesArray directly.
                            Peter
                            AlphaBase Solutions, LLC

                            [email protected]
                            https://www.alphabasesolutions.com


                            Comment


                              #15
                              Re: Row Expander with custom xbasic object

                              Tables with 1 Primary Key:
                              dim person_id as N=convert_type(e.primaryKeyValues[1],"N")
                              OR
                              dim item_code as C=e.primaryKeyValues[1]


                              Tables with a composite key:
                              dim compositeKeyPart1 as C=e.primaryKeyValues[1]
                              dim compositeKeyPart2 as C=e.primaryKeyValues[2]

                              SO if you want to test
                              dim pkVal as C=e.primaryKeyValues[1]
                              e.javascript="alert('"+pkVal+"');"
                              Scott Moniz - Computer Programmer/Analyst
                              REA Inc.
                              http://reainc.net
                              (416)-533-3777
                              [email protected]

                              REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
                              If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
                              contact us to discuss options.

                              Comment

                              Working...
                              X