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

Passing field value from one component to another.

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

    Passing field value from one component to another.

    I have a singular columnar grid on a page that shows data from a singular record.

    I also have a separate Navigational component on the same page.

    I need to have the Nav component (menu) to access a further page using the office_id value from the currently displayed record.

    My problem is I can't figure out how to "expose,access,gather" the value from the grid component's field (office_id) so that it can be used in the menu choice URL.

    BTW the required data is NOT passed as a parameter in the original URL.

    #2
    Re: Passing field value from one component to another.

    I'm not sitting in front of my work computer at the moment, so my answer might have some blatant mistakes or be flat out wrong, but these ideas might help you get a little farther. I'm not too familiar with the workings of the menu component so I can't offer much there.

    Idea 1: Make your custom link part of the record display instead of in the menu. Hopefully, you have a field which isn't being used for data display (like <RowNumber> or <LogicalNumber>) and you can give it some visual icon instead just being underline text. I've done that a bit in my work and it turns out OK for custom URLs (the variable assignment/expansion is pretty well designed). It can look a little funky in columnar format and might need some free form work or other customization.

    Idea 2: Make the value more public. This assumes that you're only showing 1 record:
    1. Create a hidden form and control value in the html of the page.

    e.g.
    <form name="nav_helper">
    <input type="hidden" name="office_id_val">
    </form>

    2. Make office_id a "custom" type and edit the HTML portion to include some javascript or some such code that assigns the Data.office_id to document.nav_helper.office_id_val.value. This really only makes the value more available to the rest of the page. I haven't messed around with menu components enough to say if that'll help you any.

    If you know what the link is going to be, you might even consider expanding the hidden form into a full blown form with a "button" that uses office_id_val to submit an URL.

    Sorry I couldn't be more directly helpful.

    Comment


      #3
      Re: Passing field value from one component to another.

      I was hoping for a "A5" way of doing this through some sort of function call etc.

      Seems to me if I could interject myself inside of the grid's output I should be able to store the values I want to a session variable and then later use that session variable (in the same page) to help complete the URL call from my Menu component.

      I think I've got it in theory but need the help of the more experienced A5 user to point me in the right direction.

      Comment


        #4
        Re: Passing field value from one component to another.

        Just did a quick experiment and you can declare session variables in custom field definitions.

        Here's the meat of the code I used.

        Custom field definition:
        function SER_NUM_render as c (data as p, args as p, PageVars as p) 'do not delete this line
        ..code..

        'Write Xbasic code here that returns the HTML to be displayed by this control
        SER_NUM_render = Data.SER_NUM

        session.testval = Data.SER_NUM

        end 'do not delete this line
        ..code..
        end function 'do not delete this line


        HTML Footer of my Detail View:
        <body class="BlueMoonPageBODY">

        <%a5 ? session.testval %>

        </body>

        And the result is the attached image. Looks like it shouldn't be too hard to get the data actually :)

        Comment


          #5
          Re: Passing field value from one component to another.

          Originally posted by cy_uab2007 View Post
          Just did a quick experiment and you can declare session variables in custom field definitions.
          Andrew,

          I followed your suggestions and have finally solved my problem. thanks.

          I was unaware of the "power" that was inherent in the "Custom Control" definition. Declaring a field as "custom" has soooo many positive implications I am almost speachless.

          My solution was made up of several main parts. First thing I had to do was give up (at this point) on trying to compose my Menu URL out of variable info.

          Instead I assigned my "office_id" value to a session var in the custom part of my field definition.

          I then was able to use that session var at the top of my A5W page that contained the grid which should be filtered.

          with tmpl_addrec_inquiry
          componentName = "addrec_inquiry"
          DBF.filter = "master_office_id = " + quote(session.current_office_id)

          end with

          With this knowledge I have now gone back to my original table or tables and added the following fields.

          special_purpose1 char 20
          special_purpose2 char 20
          special_purpose3 char 20

          The reason. I can use these non essential fields in my field assignments for a grid. Doing so and declaring the fields "custom" I can add all kinds of "behind the scenes" functionality that is reminicent of my normal programming experience.

          The only drawback I've found is that I can't seem to fully "HIDE" the column from the grid's output. When I hide the field, the underlying code does not seem to get executed. Therefore if it's purpose is to assign a session var a value, it won't happen if field is marked hidden.

          Comment


            #6
            Re: Passing field value from one component to another.

            Sounds like the server doesn't process any of the custom code unless a call is made to that field (e.g. {special_purpose1}) somewhere in the output.

            One possible solution I can think of for that is to set ' SPECIAL_PURPOSE1_render = "" ' then call {special_purpose1} in a free form layout for another field. Since the output will be an empty string, the browser should show zero effects. Of course that kind of defeats the purpose of having a pure code field for doing behind the scenes computations and avoiding custom code in a displayed field. Haven't had the chance to test this myself to see if it works or not.

            I'd say try looking into the Events area of a grid for performing some of that, but I know a read-only doesn't allow on-event code for some reason. It'd be nice if there was at least an "Initialize" or "OnDisplay" event or something like that.

            Comment

            Working...
            X