How to limit the maximum rows in Repeating Table - InfoPath Dev
in

InfoPath Dev

How to limit the maximum rows in Repeating Table

Last post 01-05-2006 12:20 PM by Matt Faus. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-05-2006 02:32 AM

    • nobel
    • Not Ranked
    • Joined on 01-03-2006
    • Posts 3

    How to limit the maximum rows in Repeating Table

    Hi,

    Can anyone guide me How to limit the maximum rows in Repeating Table(Dynamically).

    I use to try to limit by Conditional Formatting ,but InfoPath will disable both Insert and Delete function from the repeating table.

    I still need the delete function T_T

    I try to delete the last row out (use JavaScript function) when user add the new row and the row-count is >= maximumrow

    that function wokrs when I call it from Button, but when I call that function from Repeating Table::OnAfterChange it delete all the rows out. (Seem like each row call this function)

    Does any one have any suggestion.
    <Or need more information>


    Thank you ^^"

  • 01-05-2006 09:40 AM In reply to

    Re: How to limit the maximum rows in Repeating Table

    I have an idea but i don't know if it works: you can create an eventhandler on the node bound to the row: when the operarion is Insert, the event handler counts the number of nodes: if number < maximum, ok, otherwise warning message and the last row is deleted by code (or you can use a global variable to avoid the countings).

    I haven't tried it.
    Hope this helps :)
  • 01-05-2006 12:20 PM In reply to

    Re: How to limit the maximum rows in Repeating Table

    I think the reason all of your rows are being deleted when you put your functionality into the onAfterChange event is due to bubbling. Check out this tutorial and I think you should be able to get it to work:

    http://infopathdev.com/howto/tips/default.aspx?i=3551199a23ac41f3a155b3a2ffc412c5

    If it works how you want it to when running underneath a button, then I don't think it will take much for it to run automatically within the OnAfterChange event.

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.