View previous topic :: View next topic
|
Author |
Message |
Cris_70
New User
![](images/gallery/Matrix2/code-02.jpg)
Joined: 09 Feb 2021 Posts: 8 Location: Italy
|
|
|
|
Hi all,
I am adapting some panels of mine so that they adapt to screens wider than 80 columns.
In one particular panel I have input fields that should not exeed 64 chars.
With the standard 80x24 screen I am able to show input fields of about 55 chars (due to the presence of other elements on the same row), so I initially made those fields scrollable, so that the user can insert up to 64 chars.
Now I'd like to be able to make use of the (eventual) additional screen width by making them expand, but when I try to do so they obviosuly expand to the full length of the available screen, and that usually means they get much more long than 64 (e.g. with screens that are 132 or 160 columns wide).
Is there a way to tell ISPF to expand those fields but do not allow them to grow more than 64 columns wide?
Before you ask: I do check the length of the value that the user inputs, but this is checked only after the user presses ENTER. At that point, the user gets an error because the value is too long, but I'd prefer if the input field would be exactly as long as the value can be, so that the user does not have to proceed by guessing.
I hope I explained it well enough to make it understandable :-)
Thank you in advance
Cris |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
Willy Jensen
Active Member
![](images/gallery/LunyTunes/Wile E. Coyote.gif)
Joined: 01 Sep 2015 Posts: 740 Location: Denmark
|
|
|
|
The only solution I can think of off hand is to have 2 panels, one for less than 90 wide and one for 90+ wide. You can use the WIDTH parameter of the )BODY statement to limit the width of the panel. |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
Willy Jensen
Active Member
![](images/gallery/LunyTunes/Wile E. Coyote.gif)
Joined: 01 Sep 2015 Posts: 740 Location: Denmark
|
|
|
|
Actually, you can, by using the )FIELD panel statement.
Sample:
)Field
field(f1 ) scroll(on) len(84) |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
hankoerlemans
New User
Joined: 25 Jan 2018 Posts: 62 Location: Australia
|
|
|
|
Typically you use PQUERY to get the current screen limits and format the panel accordingly.
Fault Analyzer panel IDIPDIRL shows the panel construction required.
SDSF panel ISFPCU41 shows similar complexity.
I suppose it depends on how flexible you want to be. |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
Cris_70
New User
![](images/gallery/Matrix2/code-02.jpg)
Joined: 09 Feb 2021 Posts: 8 Location: Italy
|
|
|
|
Hi Willy
Willy Jensen wrote: |
Actually, you can, by using the )FIELD panel statement.
Sample:
)Field
field(f1 ) scroll(on) len(84) |
Thank you for your help Willy.
Unfortunately, that's not what I see.
Despite having a "FIELD(crtou) LEN(64) SCROLL(ON) IND(I2)" instruction in the )FIELD section, I see the "crtou" field expanding to 133 columns (all the space it has available in a 160 columns screen). |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
Cris_70
New User
![](images/gallery/Matrix2/code-02.jpg)
Joined: 09 Feb 2021 Posts: 8 Location: Italy
|
|
|
|
hankoerlemans wrote: |
Typically you use PQUERY to get the current screen limits and format the panel accordingly.
Fault Analyzer panel IDIPDIRL shows the panel construction required.
SDSF panel ISFPCU41 shows similar complexity.
I suppose it depends on how flexible you want to be. |
Thank you hankoerlemans for your suggestion.
I know that type of construction, having used it in the main panel of the same program.
This one is just a secondary panel and I do not want to manage all that complexity.
I think I'll just settle with what I have i.e. a field that does not expand and remains limited to 55 columns even when the screen allows for more columns.
Thank you!
Cris |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
Pedro
Global Moderator
![](images/avatars/775031293502c2bb66cd44.jpg)
Joined: 01 Sep 2006 Posts: 2598 Location: Silicon Valley
|
|
|
|
Various thoughts:
1. You can use variable ZSCREENW ahead of time to check the width of the screen.
2. PQUERY is used for a dynamic area. You did not say that you were using a dynamic area. It might be feasible to change one or two single fields from a standard entry field to be a dynamic area.
3.
Quote: |
this is checked only after the user presses ENTER |
On such occasions, I have used something like this ahead of time:
Code: |
CONTROL NONDISPL ENTER
DISPLAY PANEL(xyz)
|
so that I can check stuff and make adjustments for when the panel is actually presented to the user.
4. You might be able to limit the length of your field by adding an empty dummy field to the right. Use the )FIELD definition as Willy suggest, but use a variable name in the length field. |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
Cris_70
New User
![](images/gallery/Matrix2/code-02.jpg)
Joined: 09 Feb 2021 Posts: 8 Location: Italy
|
|
|
|
Hi Pedro!
Thank you for your ideas!
I tried out number 4, which I liked very much! Unfortunately it does not work as ISPF does not dimension the field based on the length declared in the )FIELD section; instead, it dimensions the field solely based on the number of characters assigned to it in the )BODY section.
I am going to try out suggestion number 3, I'll get back to you.
Cris |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
Willy Jensen
Active Member
![](images/gallery/LunyTunes/Wile E. Coyote.gif)
Joined: 01 Sep 2015 Posts: 740 Location: Denmark
|
|
|
|
The only solution I can think of then is an ISPF panel exit. I have one ISPDPX01, which is an ISPF panel exit to insert records into an ISPF panel. It can replace the entire panel or one or more sections with data in REXX stem variables. It is found here: harders-jensen.com
I also seem to remember an IBM exit to add conditional sections to a panel, but I can't remember what it is called or where it is found. I could not find it in neither ISPF nor system SAMPLIB.
But installing an exit is a bit extreme for this case. |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
Cris_70
New User
![](images/gallery/Matrix2/code-02.jpg)
Joined: 09 Feb 2021 Posts: 8 Location: Italy
|
|
|
|
Hi Willy.
You made me think of something I used in the past: it's the "deimbed" function from Frank Clarke (see www.rexxla.org/freerepo/REXX/).
I ended up using it and it works quite nicely, with the added benefit that now all my panels are self-contained in the rexx source.
I had to modify it a little, to allow on-the-fly changes to the source of the panels when they are retrieved from source and before they're written to the temporary library.
So now, when the program is started, it retrieves width and depth of the terminal screen and then changes the panel(s) accordingly.
Thank you!
Cris |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
|