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

Way to put item count on menu item, before going to grid

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

    Way to put item count on menu item, before going to grid

    Is there a way to have the item count on menu items?

    Such as:

    Tractors (30)
    Combines (3)
    Tandems (8)

    Once a menu item is selected, I do have the count at the top of the grid page. Just don't know how to get it to the menu page.

    Thanks
    Tony

    #2
    Re: Way to put item count on menu item, before going to grid

    I think you would have to query the tables and get the record count in the a5w page then display the results on the page.
    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


      #3
      Re: Way to put item count on menu item, before going to grid

      the best way would be to introduce lines of xbasic code during the initialization of the Menu Items. The xbasic code will have the code to do a record count for that item list.
      KayBee

      Comment


        #4
        Re: Way to put item count on menu item, before going to grid

        Here is what you can do.

        When you create your Menu item on the Navigation component eg. Item 1, Item 2 etc. In the TEXT property of the item type in something like
        Item 1(_cnt1_)
        .

        The
        _cnt1_
        is a place holder for holding the record count for Item 1. Follow the same for the other Items as well and put placeholders like
        _cnt1_,_cnt2_,cnt3_
        ,etc.

        Insert this NAVIGATION COMPONENT into an A5W page.

        Add a few xbasic script on the top of the page to calculate the record count for each item. Remember that the SQL that you use here MUST be SAME as the one being used by the corresponding Grid component; else there will be difference in the record count.

        Code:
        <%a5
        
        dim conn as SQL::Connection	
        dim rs as SQL::ResultSet
        dim connString as c
        connString = "::name::archon"	'AlphaDAO CONNECTION STRING NAME
        conn.Open(connString)
        dim sqlStr as c
        
        '****get record count**********
        sqlStr = "SELECT COUNT(MATLTRACK_ID) as RecCnt FROM MATLTRACK" ' REPLACE THIS QUERY AS PER YOUR REQUIREMENT
        conn.Execute(sqlStr)
        rs = conn.ResultSet
        dim item1Cnt as c	
        item1Cnt = rs.data("RecCnt")
        '****end block**********
        
        
        %>

        In this A5W page search for the text,
        ?x_menuNav1.Output.Body.navsysTBV
        . This line is inserted by Alpha Five framework and is used to generate the corresponding HTML line of code for the Navigation Control.

        Replace it with this:

        Code:
        dim customNav as C
        customNav =  x_menuNav1.Output.Body.navsysTBV 
        customNav = stritran(customNav,"_cnt1_",item1Cnt)   
        
        'REPEAT STEPS FOR ALL OTHER ITEMS IN MENU
        
        ? customNav
        What happens is that the STRITRAN function will replace the place holder _cnt1_ with the value stored in item1Cnt. We captured the values of item1Cnt just at thee beginning of the page load.

        I have attached the NavControl that I created and the A5W page for the solution. You can try using them.

        This worked for me. Let me know how is goes for you.
        KayBee

        Comment


          #5
          Re: Way to put item count on menu item, before going to grid

          Hi, i read this with great interest. Navigation component does not support localisation tags until now (<a5:r></a5:r>.

          Could i use this technique to create localisation on menu-items.

          Would it mean filling it with only a placeholder _menutext1_ etc? and fill it with the value of a session variable with multiple items per language?
          Ger Kurvers
          Alpha Anywhere / V4.6.1.9- Build 6488 (production) / V4.6.5.1 - 8722-5683(testing)
          Development: Mysql, windows 10 64 Applicationserver: standard on Windows server 2019

          Comment


            #6
            Re: Way to put item count on menu item, before going to grid

            If your objective is to alter the TEXT value on the Menu Item with some Calculated values or Session Values, then this solution of mine should sort out your problem.
            KayBee

            Comment


              #7
              Re: Way to put item count on menu item, before going to grid

              Great, thanks very much, ik will give it a try. It saves me tons of duplicate a5w pages (each for every menuitem per language).

              I'm only afraid that i will lose the highlighting of the active menu-item, i will see....
              Ger Kurvers
              Alpha Anywhere / V4.6.1.9- Build 6488 (production) / V4.6.5.1 - 8722-5683(testing)
              Development: Mysql, windows 10 64 Applicationserver: standard on Windows server 2019

              Comment


                #8
                Re: Way to put item count on menu item, before going to grid

                Originally posted by cptutrecht View Post
                Great, thanks very much, ik will give it a try. It saves me tons of duplicate a5w pages (each for every menuitem per language).

                I'm only afraid that i will lose the highlighting of the active menu-item, i will see....
                No worry mate! The highlighting of the active menu-item still stays. All you change is the Text value being rendered on the HTML. The other attributes of keeping the menu-item active , or hover over,etc remains.
                KayBee

                Comment


                  #9
                  Re: Way to put item count on menu item, before going to grid

                  Great, really worth the effort of rebuilding my own localization solution for navigation components and almost as efficient as Alpha on solution with language tags!
                  Ger Kurvers
                  Alpha Anywhere / V4.6.1.9- Build 6488 (production) / V4.6.5.1 - 8722-5683(testing)
                  Development: Mysql, windows 10 64 Applicationserver: standard on Windows server 2019

                  Comment


                    #10
                    Re: Way to put item count on menu item, before going to grid

                    Very neat KayBee. Now if I can just figure out a use for myself.
                    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


                      #11
                      Re: Way to put item count on menu item, before going to grid

                      Kaybee,

                      Can the same be done using text, with hyperlinks. At this time I am not using the Navigation Component.
                      Also, I am using Alpha database files.
                      Thanks
                      Tony

                      Comment


                        #12
                        Re: Way to put item count on menu item, before going to grid

                        Yes! Most certainly!

                        As a matter of fact, its old school xbasic & html coding.
                        KayBee

                        Comment


                          #13
                          Re: Way to put item count on menu item, before going to grid

                          KayBee
                          If you have time to show me the xbasic and html code, and where to put it, I would really appreciate it. Very unexperienced at both xbasic and html, to say the least.
                          I have a simple table on a a5w page that users can click on a category, that takes them to list for that category, more details.
                          Data is coming from an Alpha Five DBF.
                          Thanks
                          Tony

                          Comment


                            #14
                            Re: Way to put item count on menu item, before going to grid

                            I dont know if you are using SQL but create a view, and than link the view to the other table.
                            This way you can use the view anywhere.

                            Comment


                              #15
                              Re: Way to put item count on menu item, before going to grid

                              No, I'm not using SQL.
                              Thanks

                              Comment

                              Working...
                              X