Alpha Video Training
Results 1 to 4 of 4

Thread: Force Show/Hide Expression Evaluation

  1. #1
    Member
    Real Name
    Donna Frederick
    Join Date
    Jun 2011
    Posts
    198

    Default Force Show/Hide Expression Evaluation

    I just updated my grid to use default values as shown in V11 video M8 - Default Value for New Records when doing data entry in the Grid Part. It works great. However, several of my fields have client-side show/hide expressions. It is obvious that these expressions are not reevaluated after the afterRowPopulate event. How do I force that evaluation? I thought I needed to force an ajax callback, but I can't figure out the javascript syntax to try it. Should it be put in the afterRowPopulate event?

  2. #2
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,298

    Default Re: Force Show/Hide Expression Evaluation

    if you create a really simple grid based on the customer.dbf table in alphasports that demoes what you want to do and send it to me, i will show you what grid method you can call for force a recalc of the client side watch events.

  3. #3
    Member
    Real Name
    Donna Frederick
    Join Date
    Jun 2011
    Posts
    198

    Default Re: Force Show/Hide Expression Evaluation

    I have attached a zip file with one grid component that uses the customer table from AlphaSports. When you enter the firstname, you will see a textbox for the phone pop up. After you submit, the initial values (defaults) for the firstname and lastname will be the values you just submitted. However, you will see the phone prompt disappear. I'm looking for a way to keep that from happening.

    Thank you.
    Attached Files Attached Files

  4. #4
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,298

    Default Re: Force Show/Hide Expression Evaluation

    add the ._fireWatches() method to your code.

    for example:

    Code:
    if (e.rowNumber == -1 )  {
        var newvalue = this.stateInfo.defaultValue_Firstname;
        var ele = $('{Grid.ComponentName}.V.R'+e.rowNumber+'.FIRSTNAME')
        ele.value = newvalue;
        var newvalue = this.stateInfo.defaultValue_Lastname;
        var ele = $('{Grid.ComponentName}.V.R'+e.rowNumber+'.LASTNAME')
        ele.value = newvalue;
     {grid.object}._fireWatches('all');   
     }
    the ._fireWatches() method was really only intended for internal use because generally they fire automatically when needed. you never have to manually fire watches. but this is an unusual situation.

Similar Threads

  1. client side show/hide expression to show object when row is dirty
    By Selwyn Rabins in forum Application Server Version 10 - Web/Browser Applications
    Replies: 3
    Last Post: 10-22-2012, 01:41 PM
  2. Hide Help Icon when expression is entered in show/hide property.
    By leetv in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 05-31-2011, 01:26 PM
  3. Show/hide expression
    By Kzin in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 01-17-2011, 10:56 AM
  4. Show Hide Expression help?
    By bhaub in forum Application Server Version 10 - Web/Browser Applications
    Replies: 9
    Last Post: 04-07-2010, 07:52 PM
  5. Show/Hide Expression
    By cavj1 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 16
    Last Post: 01-18-2010, 05:03 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
  •