Home > Community > Forums > Custom IC SKILL > Form locked when callback fails

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Form locked when callback fails 

Last post Mon, Jan 21 2013 6:36 AM by Andrew Beckett. 3 replies.
Started by Danilo P 21 Jan 2013 05:50 AM. Topic has 3 replies and 586 views
Page 1 of 1 (4 items)
Sort Posts:
  • Mon, Jan 21 2013 5:50 AM

    • Danilo P
    • Not Ranked
    • Joined on Mon, Nov 22 2010
    • Padova, Padova
    • Posts 15
    • Points 240
    Form locked when callback fails Reply

     Hi,

    The skill below is used to create a simple form containing a string field with a modifyCallback.

    Eveything goes fine writing in the string field, but when the callback generates an error  (artificially reproduced typing "abc")  the form is locked and "OK"/"Cancel" buttons can't be used anymore. Once this happens, even if the form is invoked again or it is set to 'unbound in the CIW, the issue persists.

    Could someone be so kind and explain me why this wrong behaviour?

    Thank you

    procedure(testMyForm()

     

    let(()

        hiCreateAppForm(

                ?name 'test_form

                ?formTitle "TEST"

                ?fields list(

                      list( hiCreateStringField(?name 'myString ?prompt "->" ?modifyCallback "matchCB" ?editable t) 10:10 200:20 100 ))

                ?buttonLayout list( 'OKCancelDef)

                ?callback list(   "printf(\"OK\")" "printf(\"CANCEL\")")

          )

          hiDisplayForm('test_form)

    ))

     

    procedure(matchCB( @rest arg)

    let(( )

          stringItem = test_form->myString->value

          if( equal(stringItem "abc") then

                printf("ERROR %s \n" )              ;;;; ERROR HERE, it locks the form

          else

                printf("Hello world %s \n" stringItem)

          )

          t     ;any value is allowed in the string field

    ))

     

     

    • Post Points: 20
  • Mon, Jan 21 2013 6:01 AM

    Re: Form locked when callback fails Reply

    It looks like a bug. I'll create a service request and a CCR for this (I think I know which "Danilo P" you are).

    Regards,

    Andrew.

    • Post Points: 20
  • Mon, Jan 21 2013 6:22 AM

    • Danilo P
    • Not Ranked
    • Joined on Mon, Nov 22 2010
    • Padova, Padova
    • Posts 15
    • Points 240
    Re: Form locked when callback fails Reply

    Hi Andrew,

    any way to unbound via skill the form from the CIW when this happens? Something like test_form = nil.

    Just not to close dfII and start again to un-lock the form

    Thank you

    Danilo

    • Post Points: 20
  • Mon, Jan 21 2013 6:36 AM

    Re: Form locked when callback fails Reply

    Danilo,

    hiFormDelete doesn't help, and setting it to 'unbound doesn't help. I also tried hiFormUnmap.

    You could use a new symbol for the form each time (which is a bit inconvenient). For example:

    procedure(testMyForm()
     
    let(()
       test_form=hiCreateAppForm(
                ?name gensym('test_form)
                ?formTitle "TEST"
                ?fields list(
                      list(hiCreateStringField(?name 'myString ?prompt "->" ?modifyCallback "matchCB" ?editable t) 10:10 200:20 100 ))
                ?buttonLayout list( 'OKCancelDef)
                ?callback list(   "printf(\"OK\")" "printf(\"CANCEL\")")
          )
          hiDisplayForm('test_form)
    ))

    That way the global variable test_form contains a handle to the form, but it's stored in a unique symbol each time it is created.

    Regards,

    Andrew.

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by Danilo P at 21 Jan 2013 05:50 AM. Topic has 3 replies.