View previous topic :: View next topic
|
Author |
Message |
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
Hi,
I have a panel where i display a table:
Code: |
)Attr Default(%+_)
/* % type(text ) intens(high) Defaults displayed for */
/* + type(text ) intens(low ) color(blue) information only */
/* _ type( input) intens(high) caps(on ) just(left ) */
! type( output) intens(high) caps(on ) just(left ) pad(' ')
# type( output) intens(low) caps(on ) just(left ) pad('*')
^ type( output) intens(low ) color(red)
)Body Expand(//)
%-/-/- Qik Browse -/-/-
^zfle
%Key ===> _zkey
#zhdr
+-----------------------------------------------------------------------
)MODEL
!zrec
)Init
.Help = tutorpan /* insert name of tutorial panel */
&amt = PAGE
&zw = 80
)Reinit
)Proc
)End
|
but i want to be able to have more than 80 chars in zrec and be able to display on the panel with F11 and F10 functionality.
I am able to display 80 chars and able to do page up/down. But not able to do Page right/left. Tried to change &ZW to more than 80 but doesn't help.
Could you please help. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I'm not aware of any concept of LEFT/RIGHT scrolling for tables. AFAIK you have to write your own scrolling logic, where you will call different panels to represent the LEFT and RIGHT conditions. |
|
Back to top |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
Thanks for your reply Kevin.
I tried to capture the PF11 in my program using
Code: |
do forever
"ispexec tbdispl outdata panel(QIKX)"
if pfkey = "PF11"
then say 'pf11'
lc = rc
if lc ^= 0 then leave
end
|
but not able to capture F11. Could you please say what am i doing wrong. |
|
Back to top |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
alright i got it..
first disabled existing F10, F11 keys
Code: |
zpf10 = ''
zpf11 = ''
address ispexec "VPUT (ZPF10 ZPF11) PROFILE"
|
and then wrote a little code around them
Code: |
if PFKEY = "PF11" & tot_len <= xlen then do
"ispexec tbend" outdata
frame = frame + 1
call get_data
end
if PFKEY = "PF10" & frame > 1 then do
"ispexec tbend" outdata
frame = frame - 1
|
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Note: 'Z' is reserved by ISPF as a variable prefix. You should use different variable names (fixed in this example)
For your situation, the easiest thing is to define your field as a scrollable field, using the )FIELD section in the panel definition.
You have to put the cursor on the field before trying to scroll.
Code: |
)Attr Default(%+_)
% type(text ) color(blue) /* Defaults displayed for */
/* + type(text ) intens(low ) color(blue) information only */
_ type( input) color(turq) caps(on ) just(left )
! type( output) color(white)
# type( output) color(blue)
^ type( output) intens(low ) color(red)
~ type(text ) color(green)
)Body Expand(//) width(&zscreenw)
%-/-/- Qik Browse -/-/-
^qfle
~Key ===>_qkey
#Z#qhdr / /#Z
#qscale
)MODEL
!qrec
)Init
&QREC$LEN = 180 /* length of records */
.Help = tutorpan /* insert name of tutorial panel */
&amt = PAGE
&zw = 80
.zvars = '(QL$REC QR$REC)'
)Reinit
)Proc
)FIELD
FIELD(QREC) LEN(QREC$LEN)
LIND(QL$REC,'<') RIND(QR$REC,'>') SCALE(QSCALE)
)End |
You should notice the scale and scroll indicators ("<", ">") that are produced. |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
Left / right scrolling in tables is probably the most complicated thing to program in ISPF. The 'best' (well, correct, I guess) way to do it is to have multiple panels, one for each view, your own command table that redefines LEFT and RIGHT as aliases of some application defined strings of your choice, and program logic that gets those strings from the table panel command line and then displays the correct panel based on that command.
Conceptually, it isn't too difficult, but it means creating a command table, which means running in your own application id, as well as managing all those panels. Yuck.
If you are going to go to all that trouble, you might want to use a dynamic area, though that is more complex coding, it is more flexible and has only one panel. The program does all the formatting and scrolling work. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
you might want to use a dynamic area, |
I disagree. Ok, for a few fields, a dynamic area might be ok. But as a table display replacement, a dynamic area is incredibly hard to write.
To write several table panels that are related will take you a few hours. And coding your program to display different panels, might take you a hour or so.
To write program that manages a dynamic area, I think would take months to write. Even more time with input fields. |
|
Back to top |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
hi Pedro, sorry didn't get you. does it mean that using the panel definition you have given, i need not write extra logic for F11 and F10 keys and that will be handled automatically ? I tried using the panel you gave, but to me it seems F10, F11 logic still needs to be there, am i correct ?
also - is it possible to pass the &QREC$LEN dynamically through rexx into the panel, because it can be a value which keeps changing with the type of data browsed. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
i need not write extra logic for F11 and F10 keys and that will be handled automatically ? |
It will be handled automatically.
Quote: |
to me it seems F10, F11 logic still needs to be there, am i correct ? |
You are incorrect. You do NOT need to write your own logic for left / right scrolling. (there is an outside chance... do you have a very old system level?. Sorry, I do not know when this was introduced)
Quote: |
is it possible to pass the &QREC$LEN dynamically through rexx into the panel |
I believe it is possible.
I should add that you can read about this in the ISPF Dialog Developer's Guide and Reference. |
|
Back to top |
|
|
|