• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. form in form problem

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 144
  • Views 14532
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

form in form problem

Adrian Nistor
Adrian Nistor over 15 years ago

 Hello, I replicated one problem with a smaller test; Please see below:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
procedure
( testforms()
    let( (form)
        form = hiCreateAppForm(
            ?name 'firstForm
            ?formTitle "First Form"
            ?buttonLayout 'OKCancel
            ?fields list( 
               list
(
hiCreateButton(
                       ?name 'theTestButton

                       ?buttonText "Test Button"
                       ?callback "TestButtonCollback()")  230:10 140:30)
                 )

             )
        hiDisplayForm(form)
        printf("First form is finished; Ok button or Cancel button was pressed;")
    )
)

procedure( TestButtonCollback()
    let( (form2)
        form2 = hiCreateAppForm(
            ?name 'IfxERC_SecondForm
            ?formTitle "Second form"
            ?buttonLayout 'OKCancel
            ?fields list(  
                 list(hiCreateButton(
                        ?name 'uselessButton

                        ?buttonText "Useless button"
                        ?callback "UselessButtonCollback()")  10:100 140:30)
                 )

             )
        hiFormCancel(firstForm)
        hiDisplayForm(form2)
        hiDisplayForm(firstForm)
    )
)

procedure( UselessButtonCollback()
    let( ()
        printf("The useless button was pressed;\n");
    )
)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In these example I want to open a form (first form), than , pressing a button in this first form (Test button), I want to hide the first form, and showa second form; When this second form is closed I want to show back the first form; But I have a problem; 

Please teste next 2 cases:

First case (non-problematic) :
1:  run testforms() => the "first form" appears;
2: close the form (Ok or Cancel Button) => the form is closed and in ICFB is printed "First form is finished; Ok button or Cancel button was pressed;" This is ok becasue the hiDisplayForm() is finished after Ok/Cancel was pressed;

Second case (problematic) :
1: run testforms() => the "first form" appears;
2: Press "Test Button" button =>"TestButtonCollback" procedure is called; Second form is created (form2); first form is closed ( "hiFormCancel(firstForm)" ) but the string from first procedure is NOT executed !!! ; Second form is displyed;
3: Close (or Ok) second form => second form is closed and first form is backon the screen;
4: Close (or Ok) the first form => the first form is closed;

 After this second case, in ICFB, doesn't appear: "First form is finished; Ok button or Cancel button was pressed;" string from the printf which is called after the first form is closed;  WHY ? 

Why the "hiFormCancel(firstForm)" from the TestButtonCollback() doesn't end the "hiDisplayForm(form)" from the "testforms()" ?

Where am I wrong ?

How can I hide the first form and than bring back again ?

I don't want to set the second form as modal, and I don't want to let both forms (modaless) on the screen;

 

Thank you,

Adi.

  • Cancel
Parents
  • Prabhu The ICL
    Prabhu The ICL over 15 years ago

     Hi, Adi!
                 I may not an expert to give a conclusion for your problem.
                 With the 'SKILL' I have I tried to solve your problem. This too will have a disadvantage, check it out in the end of this message.
    The answer for " WHY? " in your post is as follows ...
    Since your " printf "  statement is in testforms(And you are calling it only once) this will not be displayed again & again.
    I made few modifications to your code ...
    /******************starts here**************************

    ******************
    procedure( testforms()
        let( (form)
            form = hiCreateAppForm(
                ?name 'firstForm
                ?formTitle "First Form"
                ?buttonLayout 'OKCancel
            ?callback "printf(\"First form is finished; Ok button or Cancel button was pressed;\")"
                ?fields list(
                   list(hiCreateButton(
                           ?name 'theTestButton
                           ?buttonText "Test Button"
                           ?callback "TestButtonCollback()")  230:10 140:30)
                     )
                 )
            hiDisplayForm(form)

        )
    )

    procedure( TestButtonCollback()
        let( (form2)
            form2 = hiCreateAppForm(
                ?name 'IfxERC_SecondForm
                ?formTitle "Second form"
                ?buttonLayout 'OKCancel
                ?fields list( 
                     list(hiCreateButton(
                            ?name 'uselessButton
                            ?buttonText "Useless button"
                            ?callback "UselessButtonCollback()")  10:100 140:30)
                     )
                 )
            hiFormClose(firstForm)
            hiDisplayForm(form2)
            hiDisplayForm(firstForm)

        )
    )

    procedure( UselessButtonCollback()
        let( ()
            printf("The useless button was pressed;\n");
        )
    )
    ****************************ends here*********************************/
    The problem is testforms() procedure is not ending.... means it is not returning anything, this might give a probelm in the future.

    I hope someone will give you best solution on this ....

    Regards.....

    Prabhakar. K --- The ICL Engineer
    SoCtronics
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Prabhu The ICL
    Prabhu The ICL over 15 years ago

     Hi, Adi!
                 I may not an expert to give a conclusion for your problem.
                 With the 'SKILL' I have I tried to solve your problem. This too will have a disadvantage, check it out in the end of this message.
    The answer for " WHY? " in your post is as follows ...
    Since your " printf "  statement is in testforms(And you are calling it only once) this will not be displayed again & again.
    I made few modifications to your code ...
    /******************starts here**************************

    ******************
    procedure( testforms()
        let( (form)
            form = hiCreateAppForm(
                ?name 'firstForm
                ?formTitle "First Form"
                ?buttonLayout 'OKCancel
            ?callback "printf(\"First form is finished; Ok button or Cancel button was pressed;\")"
                ?fields list(
                   list(hiCreateButton(
                           ?name 'theTestButton
                           ?buttonText "Test Button"
                           ?callback "TestButtonCollback()")  230:10 140:30)
                     )
                 )
            hiDisplayForm(form)

        )
    )

    procedure( TestButtonCollback()
        let( (form2)
            form2 = hiCreateAppForm(
                ?name 'IfxERC_SecondForm
                ?formTitle "Second form"
                ?buttonLayout 'OKCancel
                ?fields list( 
                     list(hiCreateButton(
                            ?name 'uselessButton
                            ?buttonText "Useless button"
                            ?callback "UselessButtonCollback()")  10:100 140:30)
                     )
                 )
            hiFormClose(firstForm)
            hiDisplayForm(form2)
            hiDisplayForm(firstForm)

        )
    )

    procedure( UselessButtonCollback()
        let( ()
            printf("The useless button was pressed;\n");
        )
    )
    ****************************ends here*********************************/
    The problem is testforms() procedure is not ending.... means it is not returning anything, this might give a probelm in the future.

    I hope someone will give you best solution on this ....

    Regards.....

    Prabhakar. K --- The ICL Engineer
    SoCtronics
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information