Alpha Video Training
Results 1 to 5 of 5

Thread: Watched Controls

  1. #1
    Member
    Real Name
    Neville Dearham
    Join Date
    Jul 2015
    Location
    Cape Town South Africa
    Posts
    91

    Default Watched Controls

    Done this in a Grid, but where do I set the "watched" function in a UX control in the detail view?
    Regards

  2. #2
    Member
    Real Name
    Neville Dearham
    Join Date
    Jul 2015
    Location
    Cape Town South Africa
    Posts
    91

    Default Re: Watched Controls

    To add to this question, I have a Function library with functions. I would like to call this function to calculate the value of a control(detailview) by the change if fields(watched) on the detailview.
    Ideal is to set these values just before the record is written away. At which event will this be done. The fields I want to update are hidden on the detailview.
    Regards

  3. #3
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,572

    Default Re: Watched Controls

    The UX Watch Events has not been implemented like the Grid Watch Events. Information on Watch Events is very tough to find. The dialog.Object property you're looking for is .dialogWatches. .dialogWatch doesn't exist in the documentation. I'm shaking my head right now. Alpha is really bad at this stuff.

    You'll only find a reference to .dialogWatches in the release notes... http://aadocuments.s3.amazonaws.com/...easeNotes.Html. Search for dialogWatches. The example is poorly implemented and badly explained.

    I'm not sure dialogWatches will help you with a List Detail View. Implemented as suggested in the notes... in the Client-side Event beforePrepare, what you get is the watch firing every time you select a row in the List and the Detail View gets populated. This is probably not what you want. Here is the code posted in the notes...

    Code:
    {dialog.Object}.dialogWatches['MY_WATCH_EVENT'] = {
        watch: ['TEXTBOX2'],
        variables: [],
        updateColumn: 'TEXTBOX1',
        onChange: function(data) {
            var dialog = {};
            var summary = {};
            {dialog.Object}._getDialogVariables(dialog,summary,data);
            var txt2 = {dialog.object}.getValue('textbox2');
            {dialog.Object}.setValue('TEXTBOX1', {dialog.object}._functions.myFunc2(txt2) );
        }
    }
    In your Javascript Function section, add this...

    Code:
    {dialog.Object}._functions.myFunc2 = function(inData){
    
    	return inData + "4444";
    
    }
    Finally, for some reason, Alpha left in a console message... so that for every row in the List, when the target field gets updated, a console message is pushed out. I'm shaking my head again.

    Anyway... maybe some of this will get you started.

  4. #4
    Member
    Real Name
    Neville Dearham
    Join Date
    Jul 2015
    Location
    Cape Town South Africa
    Posts
    91

    Default Re: Watched Controls

    Many thanks,

    Just got back from a trip so took long to acknowledge your help.
    Will check it out.
    Regards

  5. #5
    Member
    Real Name
    Sean OKelly
    Join Date
    Sep 2015
    Location
    Charleston, WV
    Posts
    205

    Default Re: Watched Controls

    It would seem to me that you can set this up a different way. Have an action triggered based on when the user wants to exit the form, or when the form is "dirty", and each time it calculates what you want. You could create an array of form fields to collect intial state and end state, find variances, then apply some formula to do what you want. Further, you could store the panel, fields, and expressions in a database so that it could all be done dynamcally.

    Anyway, I think there are more ways to do what you want, although what David mentions will probably work fine and be the easist to impliment.

Similar Threads

  1. Controls under Tab do not appear
    By RhinoSmith in forum Mobile & Browser Applications
    Replies: 4
    Last Post: 05-30-2014, 06:29 AM
  2. How to set an Image Controls(Other Controls Tab) URL from JavaScript onClick event???
    By markmoss in forum Application Server Version 11 - Web/Browser Applications
    Replies: 10
    Last Post: 03-07-2013, 10:02 PM
  3. Tabbed Controls
    By Howard G. Cornett in forum Web Application Server v6
    Replies: 2
    Last Post: 02-24-2005, 09:41 AM
  4. Tree Controls
    By David Pierce in forum Alpha Five Version 6
    Replies: 6
    Last Post: 12-30-2004, 04:30 AM
  5. A5 controls error
    By Bill@TrackerSystems.com in forum Alpha Five Version 6
    Replies: 2
    Last Post: 11-27-2004, 03:19 PM

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
  •