Place Cursor in 1st Field on a Form – Slick Version

Updating Value in a Parent Object which is the Total of Child Reference Records
August 9, 2017
2344 New Build Released
August 15, 2017

This solution is compliments of John Talbot who is the steely eyed missile man. Excellent…

  1. Place the Code below in a custom JS file and place the file in your webapps/AwareCustom/JS folder.
  2. In the Init Script of a VP content panel call the set up function. It doesn’t matter which panel, we’re just using it as a place to execute the code before forms are being rendered.

    setupDefaultFocus()

  3. Kick your feet up, drink some vodka …
  • : v7
  • : Advanced Script - Init of VP Content Panel
  • :
    function setupDefaultFocus() {
       
       AwareApp_FormParser.prototype.setFocus = function (sectionName) {
          if (this.m_fields) {
             var firstTabIdx = null,
             focusSet = false;
             for (var i = 0, len = this.m_fields.length; i < len; ++i) {
                var f = this.m_fields[i];
                var tabIndex = f.getTabIndex();
                if (tabIndex && tabIndex == "1") {
                   firstTabIdx = f;
                   if ((!sectionName || sectionName == f.getSectionName()) && f.setFocus())
                      focusSet = true;
                   break;
                }
             }
             if (!focusSet) {
                for (var i = 0, len = this.m_fields.length; i < len; ++i) {
                   var f = this.m_fields[i];
                   if (f != firstTabIdx && (!sectionName || sectionName == f.getSectionName()) && f.setFocus())
                      break;
                }
             }
          }
       }   
       
    }

     

Customaware Systems LLC
Customaware Systems LLC
Customaware Systems LLC is a Mongolian based software development company specialising in custom web based business applications and websites.

Leave a Reply

Your email address will not be published. Required fields are marked *