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

In Place Editing - filtering one Dropdown based on the value of another...

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

    In Place Editing - filtering one Dropdown based on the value of another...

    Hi Brains Trust,

    I am populating the Drop-Downs in an InlineEdit Based on data from a DataCache this works OK for populating the first dropdown... but now I want a cascade filter the 2nd dropdown, as-in, when I select a value in CCode I want the choices in ChargeRate filtered by what I just picked in CCode ... Remembering all this is in InLineEdit.

    NOTE I can do this easily with 2 normal Drop-Down boxes on a UX But I can't figure out how on earth to do this in InplaceEditing in a list.


    Now Populating CCode is done like this

    Code:
    var _onSuccess = function(data) {
    		//create an array from the cache data and re-populate the edit-combo
    		var arrData = data.map(x => Object.values(x));
    		
    		//alert(arrData);
    		var lObj = {dialog.Object}.getControl('lstCHARGES');
    		lObj._inplaceEditing.choices.CCode =  arrData;
    	};
    			
    	
    	var _onFail = function() {};
    	var _filter = '';
    	var _order = {'ChargeCode' : 1};
    	
    	//only get distinct 'ChargeCode' field
    	var obj = {columns: ['ChargeCode'], distinct: true, distinctColumn: 'ChargeCode'};
    	{dialog.object}.getFromDataCache('CdataRates',_onSuccess,_onFail,_filter,_order,obj);

    All good so far.
    Now I select one of the values and I fire the onChange Event,
    The notes say this
    /*
    TIP: This is a system comment that is added automatically every time you edit this code.
    To suppress this system comment, add this comment to your code: //nosystemcomment

    Your code can reference these variables:
    rowNumber - the zero based row number for the event
    newData - the edited data in the List row
    oldData - the data in the List row
    listObj - reference to the List object
    */
    But if I have just selected a choice from the CCode Drop-Down then what is the syntax to get what I just selected
    I thought it would have been newData.CCode... But if I alert() that I get undefined.
    I can't find any documentation on this.
    Please If anyone know how to get the value from an Inline Edit control I would be very grateful.


    Thanks in advance.
    Last edited by kiwibruce; 12-07-2019, 06:46 PM.

    #2
    Re: In Place Editing - filtering one Dropdown based on the value of another...

    Here is the crux of my problem, Selwyn shows in this video
    https://www.ajaxvideotutorials.com/V...Runtimeswf.swf
    var lObj = {dialog.object}.getControl('list1');
    if (lObj) {
    lObj._inplaceEditing.choices.Country = ['','alpha','beta',['gamma','g']];
    }
    I can create an array to replace ['','alpha','beta',['gamma','g']]; But how can I retrieve a value from another InplaceEdit control If I want to filter that array?
    Last edited by kiwibruce; 12-07-2019, 08:56 PM.

    Comment


      #3
      Re: In Place Editing - filtering one Dropdown based on the value of another...

      It's probably that CCode has been upper cased. Try CCODE.

      However, you may be out of luck in trying to do this... although it does make sense that you should be able to. Alpha doesn't think these things all the way through... they rush stuff... and do not test... and so miss opportunities. It's a feature that is not implemented... in Alpha speak.

      I don't think you can dynamically change values for an inPlace Dropdown control... while the row is being edited... which I believe is what you're trying to do. There is no code that refreshes the DropDown control items.

      If you change the CCODE value... then your onChange code runs. If you then save that row, and then re-edit it, you will see your new ChargeRate items.

      You'll have to get Alpha to review this... and add code to do an inPlace edit refresh. Right now it's only Dynamic at the row edit level... not at the field edit level.
      Last edited by Davidk; 12-08-2019, 01:04 AM.

      Comment


        #4
        Re: In Place Editing - filtering one Dropdown based on the value of another...

        Hi David,

        Thanks for your reply. I will try the Uppercase suggestion otherwise I will Send a request to Alpha.

        Comment


          #5
          Re: In Place Editing - filtering one Dropdown based on the value of another...

          If you don't get anywhere with Alpha, let me know. The DropDown is a standard HTML Select. You can modify the values yourself.

          Comment


            #6
            Re: In Place Editing - filtering one Dropdown based on the value of another...

            Thanks David, The Uppercase thing didn't work so I will create a simple demo for Alpha and send it through and see what happens.

            Comment


              #7
              Re: In Place Editing - filtering one Dropdown based on the value of another...

              Post your sample here as well. The process works for me in as far as I'm not getting any errors.

              Comment


                #8
                Re: In Place Editing - filtering one Dropdown based on the value of another...

                OK I will do that tonight, Thanks David

                Comment


                  #9
                  Re: In Place Editing - filtering one Dropdown based on the value of another...

                  Originally posted by Davidk View Post
                  Post your sample here as well. The process works for me in as far as I'm not getting any errors.
                  Hi David,

                  Thanks for taking a look. Here is the sample UX using static data for the List as well as the Data cache UX_InplaceEdit_Test.zip

                  Also here is a video walk through https://www.screencast.com/t/zE79ILVO
                  Note: I am using the current Release 6315 - 5397

                  Please let me know If I am begin dumb and missing something obvious or it is a case as you suggested, Alpha may have not intended for anyone to do this with Inplace Editing... which is a shame.
                  Let me know if you think this is makes sense enough to send through to Selwyn.

                  Thanks in advance

                  Comment


                    #10
                    Re: In Place Editing - filtering one Dropdown based on the value of another...

                    The main issue is that Alpha is terrible at documentation... and having other eyes review their work before it's released. I think I'll stop complaining about it though, since everyone seems to be quite happy with the situation.

                    There is a problem with your code. In your populateCCodeList function, you are populating your DropdownBox with 1 column... but... you need 2. You need a DisplayValue and a StoredValue.

                    Use this code... and you will no longer get an undefined error.

                    Code:
                    var obj = {columns: ['ChargeCode','ChargeRate'], distinct: true, distinctColumn: 'ChargeCode'};
                    In your List Properties, In-place Editing Settings, Before edit start event... you are getting your List control. You don't need to do this... you already have the List Object in 'this'.
                    All you need in this event is...

                    Code:
                    this.populateCCodeList();

                    Comment


                      #11
                      Re: In Place Editing - filtering one Dropdown based on the value of another...

                      Originally posted by Davidk View Post
                      The main issue is that Alpha is terrible at documentation... and having other eyes review their work before it's released. I think I'll stop complaining about it though, since everyone seems to be quite happy with the situation.

                      There is a problem with your code. In your populateCCodeList function, you are populating your DropdownBox with 1 column... but... you need 2. You need a DisplayValue and a StoredValue.

                      Use this code... and you will no longer get an undefined error.

                      Code:
                      var obj = {columns: ['ChargeCode','ChargeRate'], distinct: true, distinctColumn: 'ChargeCode'};
                      In your List Properties, In-place Editing Settings, Before edit start event... you are getting your List control. You don't need to do this... you already have the List Object in 'this'.
                      All you need in this event is...

                      Code:
                      this.populateCCodeList();
                      Hi David,

                      Thanks for the tip about using the this pointer.

                      Back to the 2 columns of the drop down I thought you could use just one as all I want is the ChargeCode column, Can I define it as both the stored value as well as the display?

                      Comment


                        #12
                        Re: In Place Editing - filtering one Dropdown based on the value of another...

                        No... there must be 2 distinct columns. I'd call it sloppy programming on Alpha's side. Why should it matter if it's the same column.

                        It's a SQL statement so just select the same column twice and give the second one a different field name.

                        Also, I forgot to include that you must set up some dummy data in the List In-Place Edit DropdownBox fields. E.g. for ChargeCode, simply put in SP|SP or XX|XX... whatever data you want.

                        Comment


                          #13
                          Re: In Place Editing - filtering one Dropdown based on the value of another...

                          Originally posted by Davidk View Post
                          No... there must be 2 distinct columns. I'd call it sloppy programming on Alpha's side. Why should it matter if it's the same column.

                          It's a SQL statement so just select the same column twice and give the second one a different field name.

                          Also, I forgot to include that you must set up some dummy data in the List In-Place Edit DropdownBox fields. E.g. for ChargeCode, simply put in SP|SP or XX|XX... whatever data you want.
                          Thanks David, Not sure what we would do without you :)

                          I will be sending a request to Alpha for the filtering functionality.

                          Comment

                          Working...
                          X