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

Help with Editor Date Spinlist

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

    Help with Editor Date Spinlist

    Hi,

    I'm trying to get the Editor Date Spinlist control to work. So far, not having much success.

    I have a List control with a Formview control. One of the fields in the formview is called "rego_expiry". This is from a table in MySQL and is defined as a date field (standard date formats in MySQL are yyyy-MM-dd).

    I have setup the date format in the properties tab in Alpha as dd/MM/yyyy. In the formview control, I have configured a display format for the rego_expiry field using date string with server-side format as input and dd/MM/yyyy as output. This displays the date in the format I want. I have also configured the editor for this field to use the Editor Date spinlist.

    Now the problem is when ever I click on this field in the formview, nothing happens. When I do an Inspect in the browser, I can see the following error:

    TypeError: es.editors[editor] is undefined
    a5-43464889.js: if(typeof settings.autoCommit=='undefined')settings.autoCommit=es.autoCommit;es._s=settings;$(this.dialogId+'.'+editorSet+'.'+editor).style.display='';es.editors[editor].edit.call(this,settings.state.value,settings);es.show.call(this,settings.state.value,settings);if(typeof es.editors[editor].show!='undefined'){es.editors[editor].show.call(this,settings.state.value,settings);}},editorSetFromEditor:function(editorName){var edObj=this._EDITOR_EDITORSET[editorName];var es='';if(typeof edObj!='undefined')es=edObj.editorSet;if(typeof es=='undefined')es='';return es;},editorFromControl:function(editorSet,editor,control){editor=editor.toUpperCase();var settings=typeof arguments[3]!='undefined'?arguments[3]:{};if(control.constructor==Array){var value=[];for(var i=0;i<control.length;i++)value.push(this.getValue(control[i]));}else{var value=this.getValue(control);}

    The error is pointing to column 152 in the above line, which seems to be the part: es.editors[editor].edit.call(this,settings.state.value,settings).

    Originally I was thinking that it was some kind of type mismatch with the date formats. However, I am now thinking the editor has not been properly defined based on the above.

    This is how I have setup the editors:
    Editor Date Spin issue.PNG


    As you can see, I am using two other editors (text and list) which are both working fine.

    Help much appreciated.

    Cheers,
    Greg

    #2
    Re: Help with Editor Date Spinlist

    What build of Alpha are you using... both 4 digit numbers.

    What Format, specifically, do you have in the Server-side "Display Format" property of your Date field? And... in MySQL... is it specifically Date... not DateTime... right?

    I don't think you need to use the List, Fields, Server-side Display Format. In fact, in the Display Format dialog, Alpha recommends that you don't use it. I rarely use it because it changes the way the date is delivered to the component. I prefer the date coming through in it's natural format and then using the List, Fields, Client-side Date/time display format to change how it's displayed.

    I've been working with the FormView Date, Date/Time, and Time editors a lot. I'm not seeing any errors. Is it possible that you created these editors in the past, but have updated your build of Alpha?

    Copy the Date Editor to the clipboard - should be 13 controls - and paste them into a new UX... and then post that UX here. I'll compare the code to what I have.

    It's possible there was an issue and it was corrected... but... the code generate for the Editors doesn't get re-generated. I'm not sure if there is a way to re-gen that code. You'd have to delete the Editor and then add it back in again.

    Comment


      #3
      Re: Help with Editor Date Spinlist

      Hi David,

      Its Version 12.4.4.4, build 4346 with system addins Build 4889.

      In the server side date format I have the following selected for the rego_expiry filed:
      Display Format
      Display format type Date
      Date format
      Input type String
      Date input format Server-side Date Format
      Date output format dd/MM/yyyy

      Confirming the filed is setup as "date" type in MySQL (not datetime). Also I'm not using the Client side transform data type configuration in the List - it is blank. (should I be setting it to "ToDate and specify a format ??).

      I've got 11 controls in the Date Editor control set, 13 if you include the opening and closing Editor Set tags. Is this correct ? I've attached the UX to this reply (I've also included the text and list editors which are part of my editor set).

      The only other thing I can think of - when I initially added the date editor to the set, I accepted the default name which included ....Editor_3. However, I deleted it and readded it with the name ......Editor_Date. Not sure if that is significant ?

      Cheers,
      Greg
      Attached Files

      Comment


        #4
        Re: Help with Editor Date Spinlist

        Hi David,

        Its Version 12.4.4.4, build 4346 with system addins Build 4889.

        In the server side date format I have the following selected for the rego_expiry filed:
        Display Format
        Display format type Date
        Date format
        Input type String
        Date input format Server-side Date Format
        Date output format dd/MM/yyyy

        Confirming the filed is setup as "date" type in MySQL (not datetime). Also I'm not using the Client side transform data type configuration in the List - it is blank. (should I be setting it to "ToDate and specify a format ??).

        I've got 11 controls in the Date Editor control set, 13 if you include the opening and closing Editor Set tags. Is this correct ? I've attached the UX to this reply (I've also included the text and list editors which are part of my editor set).

        The only other thing I can think of - when I initially added the date editor to the set, I accepted the default name which included ....Editor_3. However, I deleted it and re-added it with the name ......Editor_Date. Not sure if that is significant ?

        Cheers,
        Greg
        Attached Files

        Comment


          #5
          Re: Help with Editor Date Spinlist

          Here it is with just the date editor included.
          Attached Files

          Comment


            #6
            Re: Help with Editor Date Spinlist

            Here is the other information:

            Its Version 12.4.4.4, build 4346 with system addins Build 4889.

            In the server side date format I have the following selected for the rego_expiry filed:
            Display Format
            Display format type Date
            Date format
            Input type String
            Date input format Server-side Date Format
            Date output format dd/MM/yyyy

            Confirming the field is setup as "date" type in MySQL (not datetime). Also I'm not using the Client side transform data type configuration in the List - it is blank. (should I be setting it to "ToDate and specify a format ??).

            I've got 11 controls in the Date Editor control set, 13 if you include the opening and closing Editor Set tags. Is this correct ? I've attached the UX to this reply (I've also included the text and list editors which are part of my editor set).

            The only other thing I can think of - when I initially added the date editor to the set, I accepted the default name which included ....Editor_3. However, I deleted it and readded it with the name ......Editor_Date. Not sure if that is significant ?

            Cheers,
            Greg

            Comment


              #7
              Re: Help with Editor Date Spinlist

              Try this. Get into your FormView, Fields tab... to your date field. Open the "Editor configuration genie"... and then close it. See if that clears the error.

              What's throwing me off is your use of the term "Server-side". You write...

              In the server side date format I have the following selected for the rego_expiry filed:
              But the area you're working in is FormView, Fields. It's not "Server-side". There is a "Server-side" section in the List control, Fields area... which shouldn't be set for Display format.

              The only other thing I can think of - when I initially added the date editor to the set, I accepted the default name which included ....Editor_3. However, I deleted it and readded it with the name ......Editor_Date. Not sure if that is significant ?
              I believe the only time this will cause you trouble is if you don't update the Editor in the FormView, Fields tab.

              In the FormView, Fields tab, in the Display Format dialog, you can enter "clientsidedateformat" (no quotes) for "Date output format". This will then use the date format setting set up for the UX. Have a read of the on-screen dialog note for this property.
              Last edited by Davidk; 07-19-2017, 10:30 AM.

              Comment


                #8
                Re: Help with Editor Date Spinlist

                "in the server side date format I have the following selected for the rego_expiry filed:"
                -> sorry, my typo, I should have said display format. This is in the formview control in the fields tab.

                So basically I have removed all the display format and date format config. Dates seem to be displayed in both the list control and formview control based on the date format setup in the UX Properties screen.

                Also I have found a work around to the problem by placing the 11 date list spin controls in a separate editor set. (EDITORSET_2). Seems to be working ok, only issue is the date spin list is transposing the month and date when I hit save. (instead of dd/MM/yyyy which is being displayed in the field, I'm getting MM/dd/yyyy when I hit save from the spin list. Still need to figure out how to solve this ?

                Thanks a lot for your help.

                Cheers,
                greg

                Comment


                  #9
                  Re: Help with Editor Date Spinlist

                  Did you open the "Editor configuration genie"... and then click "OK"? The FormView Display Format settings do work... here are my settings...

                  FVDate.PNG

                  Comment


                    #10
                    Re: Help with Editor Date Spinlist

                    Did you open the "Editor configuration genie"... and then click "OK"?
                    -> I don't get a configuration genie for the Date Editor? (it is not configured by default). Have you added a custom genie ?

                    I just can't seem to get the right combination of display and date format settings. I get get the dates to display ok (dd/MM/yyyy) and the date spinlist reads then ok when opened, but when I save them back, the day and month are always swapped. Any ideas ?

                    Greg

                    Comment


                      #11
                      Re: Help with Editor Date Spinlist

                      Ok... sorry... the Editor configuration genie stuff is in a later pre-release. Doesn't matter though. Using 4346 it doesn't apply.

                      I just created a new UX, dropped in a List, FormView, and Editor... and I changed my system date format to dd/MM/yyyy. This causes an issue with the date Editor. Your version of the Date Editor "Get value from editor" code return is this...

                      Code:
                      return sMonth.value+'/'+sDate.value+'/'+sYear.value;
                      You can see the issue. However, changes have been made in the pre-release code in this area... and I've made a few more changes. This code allows for the default UX date format to be what you want it to be.


                      Code:
                      var sDate = {dialog.object}.getControl("EDITOR_3_S_DAY");
                      var sMonth = {dialog.object}.getControl("EDITOR_3_S_MONTH");
                      var sYear = {dialog.object}.getControl("EDITOR_3_S_YEAR");
                      
                      var val = sMonth.value+'/'+sDate.value+'/'+sYear.value;
                      
                      //get the date format of the data in the form (must be the format in which the data is stored - not displayed)
                      var dfmt = A5.serverSideDateFormat;
                      
                      if(val == '0/0/0'){
                      	val = '';
                      }else{
                      	var _d = new Date();
                      	_d.fromFormat(val,"MM/dd/yyyy");
                      	val = _d.toFormat(dfmt);
                      }
                      
                      return val;
                      1. This code gets the date values from the SpinList controls and puts them together in "MM/dd/yyyy" format... as a string.
                      2. Then we get the default UX date format... using A5.serverSideDateFormat... in this case "dd/MM/yyyy"
                      3. Then we convert the our new string into a date object using .fromFormat... and supplying the format as "MM/dd/yyyy" which is what the string from #1 is.
                      4. Then we convert our date object back into a string again... but this time we're using the default UX date format of "dd/MM/yyyy" which we got from #2.
                      5. Then we return that string.
                      Last edited by Davidk; 07-20-2017, 11:21 AM.

                      Comment


                        #12
                        Re: Help with Editor Date Spinlist

                        David,

                        That did it !! (with a couple of minor corrections). Can't thank you enough.


                        var sDate = {dialog.object}.getControl("EDITOR_DATE_S_DAY");
                        var sMonth = {dialog.object}.getControl("EDITOR_DATE_S_MONTH");
                        var sYear = {dialog.object}.getControl("EDITOR_DATE_S_YEAR");

                        var val =
                        sMonth.value
                        +'/'+
                        sDate.value
                        +'/'+sYear.value;

                        //get the date format of the data in the form (must be the format in which the data is stored - not displayed)
                        var dfmt = A5.serverSideDateFormat;

                        if(val == '0/0/0'){
                        val = '';
                        }else{
                        var _d = new Date();
                        _d.fromFormat(val,"MM/dd/yyyy");
                        val = _d.toFormat(dfmt);
                        }

                        return val;

                        Comment


                          #13
                          Re: Help with Editor Date Spinlist

                          Sorry... never post code... then change it... just doesn't work out... I always mess it up. Thanks... I've re-posted my running code... your corrections are right on. Glad it worked out.

                          Comment


                            #14
                            Re: Help with Editor Date Spinlist

                            I had similar problems with both date and time editors. I removed the "Display Format" in the respective fields in the Form View builder and both now work fine (dd/MM/yyyy) even though the Editor property shows MM/dd/yyyy.

                            Comment

                            Working...
                            X