Alpha Video Training
Results 1 to 5 of 5

Thread: Problems with arguments

  1. #1
    Real Name
    Adam Smith
    Join Date
    Jan 2019

    Default Problems with arguments

    I am currently developing a mobile UX running version

    I have a character argument '_B_TROLLEY' that i set at run time i.e. {dialog.object}.setArgumentValue('_B_TROLLEY', 'TR-12345');

    When i click an embedded button in a list my argument gets reset to '__not_set__'.

    I have also noticed when i try and set an argument in either the onRenderComplete or onInitializeComplete events again i lose the value and it gets set to '__not_set__'.

    If anyone has experienced arguments losing their values please let me know and any suggested solutions would be gratefully received.

    Many thanks

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Unionville, ON

    Default Re: Problems with arguments

    Alpha doesn't include Version #'s in releases. What Build are you using... found right next to the version #?
    Is this a Web Mobile App or a PhoneGap Build Mobile App?
    I've never seen Alpha use '__not_set__'... where is that coming from?
    When you write "When I click an embedded button"... do you mean Alpha is resetting the value... or you are?
    How are you using the Argument? In a List Control?

    You must create a UX Argument, using Set value at runtime, but don't set it's value. You can do this either through the List Control Data Source tab, or UX Properties. Now .setArgumentValue has something to work with.

    If you're using the argument in a List Control... then you're running into a timing issue. The List is getting set up before the argument is set.
    You'd need to "Delay render til explicit refresh", and then .refreshListData() in onRenderComplete.

  3. #3
    Real Name
    Sean OKelly
    Join Date
    Sep 2015
    Charleston, WV

    Default Re: Problems with arguments

    It sounds like you didn't create the argument first to me. Have you been able to succesfully create any argument and get it to work in any capacity?

  4. #4
    Real Name
    Adam Smith
    Join Date
    Jan 2019

    Default Re: Problems with arguments

    I have fixed the problem by recreating the list control from scratch, which sadly does not help me understand why this was happening.

    This is a Web Mobile App, which i will eventually convert to a PhoneGap. The value "__not_set__" appears in chrome tools when debugging (i usually set a watch to see the arguments being set at runtime.

    The buttons i added were just extra fields on the list and they in turn call a JavaScript function client side.

    I always have "Delay render til explicit refresh" and i always set arguments at runtime.

  5. #5
    "Certified" Alphaholic
    Real Name
    Rich Fulham
    Join Date
    May 2011
    Portland, OR

    Default Re: Problems with arguments

    Yes, I saw a similar problem today with Arguments in a UX. A UX that used to work just fine, stopped working when I turned on the "Pre-render component at design time".

    My UX starts a callback to the server during the client-side "afterPrepare" event and today I noticed right before the callback that Alpha was wiping out the argument variables on the client-side. Here's a section of that bad code:

    "__args_c_gPrAboutNM": "__notSet__", 	
    "__args_c_gTeTitle": "__notSet__", 	
    "__args_d_gDoEndDt": "__notSet__", 	
    } );
    I found two solutions:
    1) the obvious one - turn "Pre-render" off, or
    2) delay the callback by wrapping it in a setTimeout of 100 ms.

    I don't know that a 100ms delay will always be enough, though.

    I might just turn off the pre-render if there is not enough performance gain measured from the stress test that I am doing.
    Last edited by RichCPT; 05-06-2019 at 11:31 PM. Reason: BBS truncated my orginal post

Similar Threads

  1. Amyuni Low Level Print problems, why do these problems persist?
    By Fulltimer in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 11-16-2016, 02:14 PM
  2. Arguments
    By njguy in forum Mobile & Browser Applications
    Replies: 3
    Last Post: 04-24-2016, 01:22 PM
  3. sql arguments
    By mvilla25 in forum Application Server Version 11 - Web/Browser Applications
    Replies: 4
    Last Post: 01-04-2013, 08:56 AM
  4. Report Editor Arguments vs Data Source Definition Arguments
    By DaveF in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 10-19-2012, 02:08 PM
  5. SQL and Arguments
    By njguy in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 04-30-2012, 03:48 PM


Posting Permissions

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