Alpha Video Training
Results 1 to 5 of 5

Thread: Trying to populate hidden control with values from other controls in ux component

  1. #1
    Member
    Real Name
    Josh Cole
    Join Date
    Jun 2012
    Posts
    678

    Default Trying to populate hidden control with values from other controls in ux component

    I have a ux component. I am using it to update information in the Address table inside of my companies DBMS. The user enters their First and Last Name, there is another name field I want to update but it would be redundant to have the user enter their name twice. I want to take the value from e.dataSubmitted.Firstname and e.dataSubmitted.LastName and set the hidden "FullName" control with those concatenated values. I've tried this in the server side dialogValidate event. Does not work.

    e._set.firstname.value = e.dataSubmitted.FirstName + " " + e.dataSubmitted.LastName

    If anyone can help it would be much appreciated.

  2. #2
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Trying to populate hidden control with values from other controls in ux component

    Hi Josh,

    Cant that be done with field rules?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  3. #3
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Trying to populate hidden control with values from other controls in ux component

    Hi Josh,

    Your example is setting the value of the firstname field not the fullname field. Maybe you could try e._set.FullName.value = e.dataSubmitted.FirstName + " " + e.dataSubmitted.LastName

    I do this slightly differently, I use client side properties - calculated field expression - FirstName + " " +Lastname. Although relational database purists say you should never need to store this value, because it is always available as a calculation.

  4. #4
    Member
    Real Name
    Jim Coltz
    Join Date
    Oct 2005
    Location
    Western Pennsylvania
    Posts
    600

    Default Re: Trying to populate hidden control with values from other controls in ux component

    Quote Originally Posted by coleresources View Post
    I have a ux component. I am using it to update information in the Address table inside of my companies DBMS. The user enters their First and Last Name, there is another name field I want to update but it would be redundant to have the user enter their name twice. I want to take the value from e.dataSubmitted.Firstname and e.dataSubmitted.LastName and set the hidden "FullName" control with those concatenated values. I've tried this in the server side dialogValidate event. Does not work.

    e._set.firstname.value = e.dataSubmitted.FirstName + " " + e.dataSubmitted.LastName

    If anyone can help it would be much appreciated.
    Hi Josh,

    If you're setting values in that event you need to tell the component that the control is dirty. From the help for the dialogValidate event:

    '========================================================================================================
    'IMPORTANT: If your event handler modifies a value in the e.dataSubmitted object (and that field has NOT
    'been edited by the user), you MUST explicitly add the field to the e.dirtyColumns value yourself.
    'For example, assume that you want to set the Company field to 'Alpha' and the 'Qty' field in row 1 of a repeating section
    'regardless of whether the user edited the value or not:
    'e.dataSubmitted.COMPANY = "alpha"
    'e.dataSubmitted.QTY_A5INSTANCE2 = "2"
    'e.dirtyColumns = e.dirtyColumns + crlf()+ "COMPANY" + crlf() + "QTY_A5INSTANCE2"
    '========================================================================================================
    Jim Coltz
    Alpha Custom Database Solutions, LLC
    A5CustomSolutions.com
    jimcoltz@a5customsolutions.com

  5. #5
    Member
    Real Name
    Josh Cole
    Join Date
    Jun 2012
    Posts
    678

    Default Re: Trying to populate hidden control with values from other controls in ux component

    I don't really know what I was thinking. I've used calculated side calculation to do this in the past and totally spaced on it. Thank you all for your feedback.

Similar Threads

  1. How to get dialog repeating section row count to populate controls inside.
    By -Jinx- in forum Application Server Version 11 - Web/Browser Applications
    Replies: 5
    Last Post: 12-13-2012, 04:45 PM
  2. How to populate Unbound controls in a dialog?
    By MarionT in forum Application Server Version 11 - Web/Browser Applications
    Replies: 56
    Last Post: 04-26-2012, 11:39 AM
  3. Dailog2 Build 3826 Error using new feature Populate Controls in a Dialog Component
    By michaeldarby in forum Application Server Version 11 - Web/Browser Applications
    Replies: 3
    Last Post: 11-10-2011, 10:54 AM
  4. How to populate DropDownbox from Variable with hidden content
    By Steven P. in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 07-29-2011, 07:08 AM
  5. Dialog Web Component control values
    By Garry Flanigan in forum Application Server Version 8
    Replies: 0
    Last Post: 07-04-2007, 07:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •