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

Hiding fields in a List...

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

    Hiding fields in a List...

    Hi All...

    I have a list that I'm having a hard time showing/hiding fields and ideally would like to hide the whole column when they are NULL.

    This is what the list is looking like right now:

    Screenshot from 2017-12-14 16-23-15.png

    If you look at the screenshot you will see that a number fields show $0. The first issue is that they really are not $0 in the table. They are NULL yet the list displays the value as $0. I have no idea why...but here's what I've tried to do to hide the data and it doesn't work (NOTE: These are Client-Side show/expressions):

    Ex: MANAGEMENT_LIAB_LIMIT=0
    Ex: MANAGEMENT_LIAB_LIMIT<>''
    Ex: MANAGEMENT_LIAB_LIMIT>0
    Ex: MANAGEMENT_LIAB_LIMIT>''

    Any ideas/suggestions would be helpful.

    Thank you.
    Joe
    Never take a ride to the edge of your mind unless you've got a ticket back - Jon Oliva - Savatage.

    #2
    Re: Hiding fields in a List...

    What if you use the list server-side display format on the field where it is blank if zero?

    ie) alltrim(str( convert_type(<value>,"N") ,250,2,"$(B"))
    Alpha Anywhere v12.4.6.5.2 Build 8867-5691 IIS v10.0 on Windows Server 2019 Std in Hyper-V

    Comment


      #3
      Re: Hiding fields in a List...

      This is a List Control... is that right?

      And you're showing 1 Row... only 1 Row... no more than 1 Row... is that right?

      I'd guess you have some field formatting somewhere... do you? Otherwise... for a null value... how would a $ get in there?

      Remember that everything in the List is a string.

      If you do have formatting somewhere, which I suspect, and $0 is rendered for a null value... then it may be that the data value in the List is 0... but it's a string... so it's "0".

      Code:
      MANAGEMENT_LIAB_LIMIT<>"0"
      Now... hiding the whole column is a bit different... is that what you want to do?

      Comment


        #4
        Re: Hiding fields in a List...

        Hi Guys...

        Sorry for the long delay in replying.

        I did not realize that all data in the list is a string. Thank you.

        I do have formatting set on the fields in the list. I have it set on the Server-Side Display Format on the fields tab of the List Builder.

        I was able to hide the field data using your code suggestion with one slight change. I had to include the dollar sign for it to work "$0"

        Ideally I would like to hide the columns that have no data as they just clutter up the list. I have option "Hide column if field is hidden" set on the List Layout tab for the field but it doesn't seem to hide.

        Thanks again for your input.
        Never take a ride to the edge of your mind unless you've got a ticket back - Jon Oliva - Savatage.

        Comment


          #5
          Re: Hiding fields in a List...

          Because you have formatted the data server-side, then whatever your format is (in this case $0), is, as you've found, what is literally in the List as data. I don't mind server-side formatting... but it does mean you must live with that format for everything you do on the client-side. Server-side format is probably a bit faster, since the data is delivered formatted... and doesn't need to be formatted and rendered, but I prefer to deliver the data to the List as pure data... no formatting... and then format on the client-side.

          Client-side means you see $0 but the data is in the List as "0" - easier to deal with if you need to do something... like a show/hide.

          You can set a Show/Hide server-side... e.g. >0

          This means you can use the List Layout "Hide column if field is hidden" - which is connected to server-side only. However... it's a bit weird... and wrong... because if ANY row of MANAGEMENT_LIAB_LIMIT is 0, then the column will be hidden. I don't think this is right... but there you go. I feel it should be that if ALL rows are 0, then hide it.
          Also, the List still holds a place for the hidden field... you don't see it... or the column heading... but the List is not resized.

          Overall, server-side is a bit messy to deal with... can be done... but you have to work around stuff.

          Comment


            #6
            Re: Hiding fields in a List...

            I think I'm okay with the server side formatting on this one as it will always be a dollar value in the list. Right now the values are hiding using the show hide you had first mentioned just using "$0" for the value.

            I think I'm still confused though. Since the values are hiding I would think the column would hide but it doesn't. I still see the headings. I'm okay with it not shifting or resizing columns as long as the headings would hide too. I'm pretty sure I can organize that data to still look clean. Right now it is hard to read with all of the headings...see below.

            Screenshot from 2017-12-19 16-12-15.png
            Never take a ride to the edge of your mind unless you've got a ticket back - Jon Oliva - Savatage.

            Comment


              #7
              Re: Hiding fields in a List...

              List Layout "Hide column if field is hidden" only works if you use the List, Fields, Server-side Show/Hide Expression. These 2 options are directly related. The on-screen descriptions for each of these options details their use.

              List Layout "Hide column if field is hidden" is a server-side option.

              Comment


                #8
                Re: Hiding fields in a List...

                Would this be possible? I didn't actually try it.

                For the fields that you may want to hide, check the option to do Client-side compute summary values.
                Then (but not sure at what moment), if the summary total = 0, use something like:

                Code:
                var lObj = {dialog.object}.getControl('list1');
                lObj.setDisplay('column',{column: [2], display: [false]})

                Comment


                  #9
                  Re: Hiding fields in a List...

                  This gets into the area of one property setting, or option, completely messing up another area. You must be fully aware of the effects of your choices. That's what I meant by hiding a whole column is a bit different.

                  Server-side formatting produces a string. You can't produce summary results on a string using Client-side summary. The .total property is always "". So... if you compare the summary total to 0 improperly... your answer will always be true.

                  You must match Server-side formatting with Server-side Summary Values... and Client-side formatting with Client-side Summary Values. You can't mix and match.

                  Further, Client-side Summary Values are numbers. Server-side Summary Values are Strings.

                  Even more... Client-side... the List Event afterRenderComplete (or something similar) must be used used to run the code to hide the column. The code to hide the column cannot be used in the List event afterClientSideSummaryCompute... because afterClientSideSummaryCompute runs before afterRenderComplete.

                  The same cannot be said for afterServerSideSummaryCompute. This event runs AFTER afterRenderComplete. You CAN run the code to hide a column in afterServerSideSummaryCompute.

                  And... the code used to hide a column is a bit different Client-side and Server-side.

                  Client-side:
                  afterClientSideSummaryCompute code will be:
                  Code:
                  {dialog.Object}.__custTotal = csSummary['CUSTAMOUNT'].total;
                  afterRenderComplete code will be:
                  Code:
                  var custTotal = {dialog.Object}.__custTotal;
                  if(custTotal===0){
                  	this.showHideColumn(3,false);
                  }
                  Server-side:
                  afterServerSideSummaryCompute code will be:
                  Code:
                   var custTotal = summary['CUSTAMOUNT'].total;
                  //the test value will depend on your server-side formatting
                  if(custTotal==="$0"){
                  	var lObj= {dialog.Object}.getControl('LISTCUST');
                  	lObj.showHideColumn(3,false);
                  }
                  So... as you can see... you must be a bit careful... because you're easily allowed to dig yourself a nice deep hole.
                  Last edited by Davidk; 12-19-2017, 08:13 PM.

                  Comment


                    #10
                    Re: Hiding fields in a List...

                    David,
                    I'm curious... I haven't seen anything like this before:
                    {dialog.Object}.__custTotal = custTotal = csSummary['CUSTAMOUNT'].total;

                    Is {dialog.Object}.__custTotal some sort of global variable that was just declared there?

                    EDIT: Nevermind, I get now. Never thought of using that approach before. Pretty cool.
                    Last edited by jgrannis; 12-19-2017, 07:56 PM.

                    Comment


                      #11
                      Re: Hiding fields in a List...

                      Copy and paste went wrong... corrected in that post. Should be...

                      Code:
                      {dialog.Object}.__custTotal = csSummary['CUSTAMOUNT'].total;
                      Using the {dialog.Object} namespace... creating a property named __custTotal to hold a value.

                      Comment


                        #12
                        Re: Hiding fields in a List...

                        Joe,
                        In post # 1 you said your show/hide expressions were client-side.
                        Where are you putting these expressions into the LIST builder? When I look at the LIST builder "Fields" tab, I only see a place for server side show/hide expressions. I don't see client-side show/hide on that tab or under the list layout tab either. Are you talking about a Detail section for the LIST ?

                        I use the server-side show/hide expressions property to conditionally hide enitre columns. Unfortunately, that property box has something wrong with it and it only seems to work with session variables. It should work with e.rtc variables but it doesn't! What I do is on the server-side "onDialogInitialize" I set some session variable fields (like SESSION.ShowRV5, SESSION.ShowRV6, SESSION.ShowRV7) to "Y" and then if any columns need to be turned off (which I figure out before the data is even read for the list itself) I set the corresponding flags to "N". In the server-side show/hide expression in the LIST builder "Fields" tab, I put something like: SESSION.ShowRV5 = "Y"

                        In the LIST Builder's, "List Layout" tab, I checkmark the "Hide column if field is hidden" property for the columns that have show/hide expressions.

                        Comment


                          #13
                          Re: Hiding fields in a List...

                          Hi Rich...

                          This is a screenshot of what I have set for the fields in the list.

                          Screenshot from 2017-12-21 10-41-23.png

                          Down bottom I used the Show/Hide Expression that David had suggested.

                          On the List Layout I have it set to "Hide column if field is hidden"

                          Screenshot from 2017-12-21 10-45-18.png

                          Since I have a client side expression I'm pretty sure that is why it doesn't hide. Would be nice if they had the ability to dynamically hide based on client side.

                          I did find this video that I'm going to watch and see if it would work.

                          https://www.youtube.com/watch?v=XQwIkX_nprY

                          Thanks...
                          Joe
                          Never take a ride to the edge of your mind unless you've got a ticket back - Jon Oliva - Savatage.

                          Comment


                            #14
                            Re: Hiding fields in a List...

                            Joe,
                            I see now. My field types are XBasic and RawData and I do not get the client-side show/hide expressions. I can kind of see why they omitted that with the XBasic "field" type, but not why it is omitted with "RawData".

                            Anyway, that is an older video that Selwyn made. He has a much better method now. For a list with only one layout, in ListBuilder / "List Properties", under "Layout Properties", select "Freeform" as the "Layout Type". (If the list has multiple layouts, that property appears on the "Multiple Layouts" tab.) On the "List Layout" tab you will have a bit more work to do to setup a list, but they have some really cool stuff you can do there using what Alpha calls "Client-side" templating. In the "Video finder" you can find three series of videos on using it. Just search for "Client-side template". video #'s ending in 105, 106 and 118 should be in the list. It takes some time to go through them, but that stuff opens the door to many possibilities.

                            Comment


                              #15
                              Re: Hiding fields in a List...

                              Hi Rich...

                              I've been watching the videos on the templating. A good chunk of it is still over my head at this point but definitely has given me some ideas. One thought I had was having two layouts. One for each type of coverage. Then maybe based on the field data default to one template or the other. Will continue to watch but that was one thought so far.

                              Thanks again...
                              Never take a ride to the edge of your mind unless you've got a ticket back - Jon Oliva - Savatage.

                              Comment

                              Working...
                              X