Multiple rules at the same time - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Multiple rules at the same time

Last post 08-14-2011 01:32 AM by TedCa. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 08-05-2011 01:16 AM

    • eliasen
    • Top 500 Contributor
      Male
    • Joined on 10-07-2010
    • Aalborg, Denmark
    • Posts 33

    Multiple rules at the same time

    Hi all

    I have an InfoPath 2007 form that is web enabled and running under SharePoint 2007 using Forms Services.

    The form has a textbox on it with a rule that updates the value of the field to be "translate(.; "abcdefghijklmnopqrstuvwxyz"; "ABCDEFGHIJKLMNOPQRSTUVWXYZ")" - in other words, I convert the string into uppercase. This works fine.

    But I also have a button, which has a code behind which does lots of stuff. If the user enters a text in the textbox and does NOT leave the textbox, and then clicks on the button, then only the rule for the textbox (the uppercase) is fired. The code behind for the button is not fired. If I have a button that does not have a code behind, but only rules, the same happens - only the rule for the textbox is fired and not the rules for the button.

    I need the not have to force the user to leave the textbox before he can click on the button - what can I do?

    Thanks.

    eliasen, representing himself and not the company he works for.
    Microsoft BizTalk MVP
    Blog: http://blogs.eliasen.dk/technical/
  • 08-05-2011 08:47 AM In reply to

    Re: Multiple rules at the same time

    Wow - that's kind of interesting. What are the postback settings on the controls concerned? Have you tried adjusting those? I mean, because in order for the rule to fire on the textbox, the text has to have changed (which means, to the best of my understanding, the selected control will no longer be the textbox, but, in this scenario, the button...)

    Hilary Stoupa

  • 08-08-2011 12:58 AM In reply to

    • eliasen
    • Top 500 Contributor
      Male
    • Joined on 10-07-2010
    • Aalborg, Denmark
    • Posts 33

    Re: Multiple rules at the same time

    Hi. Sorry about the late answer - I am in Denmark (Central European Time) so my weekend had begun when you answered :-)

    Anyway, both are set to "Only when necessary for correct rendering of the form (recommended)".

    I suppose I can play around with the values and see if anything changes. I'll keep you posted.

    eliasen, representing himself and not the company he works for.
    Microsoft BizTalk MVP
    Blog: http://blogs.eliasen.dk/technical/
  • 08-11-2011 02:34 AM In reply to

    • eliasen
    • Top 500 Contributor
      Male
    • Joined on 10-07-2010
    • Aalborg, Denmark
    • Posts 33

    Re: Multiple rules at the same time

    Hi

    Nothing changes, it seems, no matter what I use for the settings about post back.

    Any ideas?

     

    eliasen, representing himself and not the company he works for.
    Microsoft BizTalk MVP
    Blog: http://blogs.eliasen.dk/technical/
  • 08-11-2011 08:20 AM In reply to

    Re: Multiple rules at the same time

    I'm pretty stumped on this one. I take it if the user clicks outside of the box someplace (into another field, for example) and clicks the button, the code does run?

    Hilary Stoupa

  • 08-12-2011 12:39 AM In reply to

    • eliasen
    • Top 500 Contributor
      Male
    • Joined on 10-07-2010
    • Aalborg, Denmark
    • Posts 33

    Re: Multiple rules at the same time

    Yes, it does.

    It appears that the event for the changed textbox is fired whenever the focus leaves the textbox. Unfortunately, if that includes a button that is clicked, then the event for the buttonclick seems to be ignored.

    Can you reproduce this or is it just me? In other words; Is there any hope that it can be fixed or not?

    Thanks

     

    eliasen, representing himself and not the company he works for.
    Microsoft BizTalk MVP
    Blog: http://blogs.eliasen.dk/technical/
  • 08-14-2011 01:32 AM In reply to

    • TedCa
    • Not Ranked
    • Joined on 08-13-2011
    • Posts 4

    Re: Multiple rules at the same time

     I have found (with browser forms), that on_changed events can get generated (with the data at the time that the event was kicked off), but the event does not actually run until later  e.g. a button click.  I think your code may be conflicting with the rule execution.

     As a result of the above, my conclusion is that the safe way to program browser forms is to put anything that changes data into code and attach the code to button clicks only - not rules. So if you change the rule that converts to uppercase into code, that should solve your problem.

Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.