Alpha Video Training
Results 1 to 6 of 6

Thread: Set Repeating Section Row Count During an Ajax Call Back

  1. #1
    Member
    Real Name
    Ian E Stuart
    Join Date
    Sep 2013
    Posts
    70

    Default Set Repeating Section Row Count During an Ajax Call Back

    I am trying to set the repeating section row count based on the results of a SQL COUNT query during an AJAX callback. The debug shows that I am getting the results of the SQL query successfully. My problem is that I have my JS function wrong. Here's what I have written:

    dim count = 3
    dim x as p
    x = e.rtc.A_AjaxResponses
    x[].text = "{dialog.Object}.setRepeatingSectionRowCount('container_55'," + count + ",true,false);"


    I get an error, "Object doesn't support property or method 'setRepeatingSectionRowCount". Does anyone know why this doesn't work or know an alternative. I have been scouting out the a5DialogHelper_JS_PopulateDialog helper function that has a setRepeatingSection property, but changing my code to use it at this point will mean an entire rewrite (videos D57).

    BTW, the dialog is totally unresponsive to the e.javascript method:

    dim count = 3
    dim js as c = "{dialog.Object}.setRepeatingSectionRowCount('container_55'," + count + ",true,false);"
    e.javascript = js


    Any help is appreciated.

  2. #2
    "Certified" Alphaholic
    Real Name
    Andy Gill
    Join Date
    Jul 2011
    Location
    Barbados
    Posts
    1,029

    Default Re: Set Repeating Section Row Count During an Ajax Call Back

    1) Use the e.javascript way
    2) Try {dialog.Object}._setRepeatingSectionRowCount ....
    http://wiki.alphasoftware.com/~alpha...alog+Component

  3. #3
    Member
    Real Name
    Ian E Stuart
    Join Date
    Sep 2013
    Posts
    70

    Default Re: Set Repeating Section Row Count During an Ajax Call Back

    Thanks for showing me the typo, Andy. Unfortunately, it doesn't work still. The number of rows remains as what was declared in the repeating row properties from the control window. Just to test, I tried to bring up a dialog box with the same method:

    dim js as c
    js = "alert('Is this working?');"
    e.javascript = js


    I don't get the alert box, so i'm starting to feel like I'm missing a syntax that executes the Javascript.

    Also, I tried to change the properties directly in the e. object:

    e.repeatingSectionInfo[2].rowCount = 6
    e.repeatingSectionInfo[2].totalRowCount = 6
    e.repeatingSectionInfo[2].visibleRowCount = 6


    This changed the values in the object properties of the debug window, but didn't change the repeating row count on the client side.

  4. #4
    Member
    Real Name
    Steve Kent
    Join Date
    May 2011
    Posts
    139

    Default Re: Set Repeating Section Row Count During an Ajax Call Back

    What I do is

    eval("e._set.rowcount.value")=count 'this sets a hidden field on the report to the number of rows needed

    then on the form i put an on change javascript function that sets the repeating section rowcount to this number

    Not elegant but it works.

    One caution, if you try to populate rows before the rowcount is set (could be a system timing issue) , you may not have enough rows to hold your data. I sometimes hide the repeating section rows until the rowcount is established and set the starting row count high. Then trim it back with the set rowcount

    Steve

  5. #5
    "Certified" Alphaholic
    Real Name
    Andy Gill
    Join Date
    Jul 2011
    Location
    Barbados
    Posts
    1,029

    Default Re: Set Repeating Section Row Count During an Ajax Call Back

    You could take some tips from this....it may help...
    http://www.youtube.com/watch?v=OJMRgxzmzGw

  6. #6
    Member
    Real Name
    Ian E Stuart
    Join Date
    Sep 2013
    Posts
    70

    Default Re: Set Repeating Section Row Count During an Ajax Call Back

    Thanks for this input. I set the Xbasic to write to the hidden field and sets the row number onChange. You're right, Steve, it's not "elegant" but it will do the job for now. Thanks again.

Similar Threads

  1. Set Repeating Section Row active
    By Steve Workings in forum Mobile & Browser Applications
    Replies: 1
    Last Post: 06-26-2013, 08:27 PM
  2. Repeating Section Row Count And Access To The Number
    By Al Buck in forum Application Server Version 11 - Web/Browser Applications
    Replies: 4
    Last Post: 04-26-2013, 02:11 PM
  3. 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
  4. How to Programmatically refresh a row in a LINKED grid as result of an ajax call back
    By cptutrecht in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 11-07-2012, 12:14 PM
  5. How to left-align dialog's repeating section Add Row/Delete Row icons?
    By WindForce in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 01-11-2012, 02:54 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
  •