View previous topic :: View next topic
|
Author |
Message |
oerdgie
New User
Joined: 22 Nov 2007 Posts: 64 Location: Germany
|
|
|
|
Hi folks,
I like to change an output field to an input field in an ISPF panel.
But it doesn't work. Example see below...
What is wrong in the panel definition ?
Code: |
000001 )ATTR
000002 $ TYPE(INPUT) INTENS(LOW) CAPS(OFF) JUST(LEFT) PAD('_') COLOR(RED)
000003 # TYPE(OUTPUT) INTENS(LOW) CAPS(OFF) JUST(LEFT) COLOR(BLUE)
000004 )BODY
000005 +
000006 %Command ===> _ZCMD %Scroll ===>_AMT +
000007 +
000008 +
000009 +Type : $PTYP +
000010 #Z1 #VAL1 +
000011 +
000012 )INIT
000013 VGET (amt) PROFILE
000014 IF (&amt = &Z)
000015 &amt = CSR
000016 )REINIT
000017 )PROC
000018 IF (&PTYP = 'Person')
000019 &Z1 = 'First Name :'
000020 .ATTR(VAL1) = 'TYPE(INPUT)'
000021
000022 VPUT (amt) PROFILE
000023 )HELP
000024 )END |
Thank in advance for help
|
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Your code needs to be in the )INIT section. This section is processed before the Panel is displayed.
The )PROC section where you have the code is not processed until the enter key is pressed.
Additionally if you want the underscoring and color change, you have to specify in your code as well.
Finally, you are going to have to return to your calling panel and Display it again as well.
The way you have it coded where you do not want the second field as input based on the value of the first leaves you in a bad way. |
|
Back to top |
|
|
oerdgie
New User
Joined: 22 Nov 2007 Posts: 64 Location: Germany
|
|
|
|
Thanks for the answer...
What I aim to do is, enter a string in PTYP. Press Enter.
If PTYP is 'Person' then change VAL1 from output to input field. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
You will have to Display your panel a second time.
Either a second display or loop back around. |
|
Back to top |
|
|
oerdgie
New User
Joined: 22 Nov 2007 Posts: 64 Location: Germany
|
|
|
|
Yes I like to display the panel a second time as a second display. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Sounds like you have a plan:
1) Move this code to )INIT section
Code: |
000018 IF (&PTYP = 'Person')
000019 &Z1 = 'First Name :'
000020 .ATTR(VAL1) = 'TYPE(INPUT)' |
2) Add code to calling Rexx program after the first Display Panel
IF PTYP = 'Person' then Display Panel
This should get you on the right path. |
|
Back to top |
|
|
|