A Little More Than a Tool Tip
-
- Experienced User
- Posts: 116
- Joined: Wed Sep 05, 2012 11:14 am
- First Name: Eric
- Last Name: Hill
- Company Name: Integrated Corporate Solutions
- Phone: 256-760-8239
- Address 1: 501 S Wood Avenue
- City: Florence
- State / Province: Alabama
- Zip / Postal Code: 35630
- Country: United States
- Contact:
A Little More Than a Tool Tip
I would like to place a "?" button by a dropdown to allow the user to press and get a better explanation of the dropdown options. I know about the tool tip property but I want something that will stay on the screen until the user closes it. Is there anything other than just using a regular window type format to accomplish this?
I see the dialogs widgets and think that might be the ticket. The data should all be static inside the dialog. Is there a function in PUI that will allow me to click on a button and show the dialog box without passing control back to my program? If not, how do I define the button so my program will recognize it? As a function key? If so, all my function keys are in use.
Any suggestions will be appreciated!!!
Thanks!
I see the dialogs widgets and think that might be the ticket. The data should all be static inside the dialog. Is there a function in PUI that will allow me to click on a button and show the dialog box without passing control back to my program? If not, how do I define the button so my program will recognize it? As a function key? If so, all my function keys are in use.
Any suggestions will be appreciated!!!
Thanks!
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: A Little More Than a Tool Tip
There's no need to use a function key, unless you're trying to emulate 5250 behavior for some reason? I would typically use a function key if I'm trying to keep existing RPG code intact without changes -- otherwise, I'd use a named indicator.
Here's what I'm thinking, about adding the "button":
But, the way I outlined above will work nicely, too... and some RPGers aren't comfortable with JavaScript. If you'd rather do it via JavaScript and would like some tips with that, let me know.
Let me know if this is a useful solution for you, or if you were looking for something different.
Here's what I'm thinking, about adding the "button":
- For something like this, I like to use an image as a button. (Though, an actual button widget would work, too.)
- Set the image source to /profoundui/proddata/images/icons/information.png (you can set it to any image you like -- but this is a nice one for information about something.)
- Bind the 'response' property of the image to a named indicator. Something like btnInfo might be a good name.
- Now, when someone clicks the image you just added, control will be sent back to the RPG program, and the btnInfo indicator will be set to *ON. You can check for it, and display a dialog record format.
- Create a new record format. (Click New / Record Format)
- Drag a dialog widget to the new format. I like the "Professional Dialog", personally.
- Add a label label, or maybe a wrapping text widget to the dialog with the info you want to say. I like wrapping text, because you can use HTML tags to do stuff like bolding, underlining, etc, plus of course, it's an easy way to type text that wraps to multiple lines.
- Add a button to the dialog. Something like "Close". or "Ok" Bind it to an indicator like "btnClose"
- Set the dialog title to something appropriate
- I also like to add a "close button" (the little 'x' in the upper-right corner) to my dialogs. You can find these under the "Dialogs" section of widgets in the designer. You should also bind that to btnClose (or a different indicator if you want your RPG code to distinguish it from other stuff.)
- Save & compile the display file.
- After displaying the screen with the information button, check for the btnInfo indicator to be pressed.
- If btnInfo is pressed, EXFMT the dialog record format.
- When the user clicks the close button, return will come back to your RPG
- Go back to displaying the original screen at this point.
But, the way I outlined above will work nicely, too... and some RPGers aren't comfortable with JavaScript. If you'd rather do it via JavaScript and would like some tips with that, let me know.
Let me know if this is a useful solution for you, or if you were looking for something different.
-
- Experienced User
- Posts: 116
- Joined: Wed Sep 05, 2012 11:14 am
- First Name: Eric
- Last Name: Hill
- Company Name: Integrated Corporate Solutions
- Phone: 256-760-8239
- Address 1: 501 S Wood Avenue
- City: Florence
- State / Province: Alabama
- Zip / Postal Code: 35630
- Country: United States
- Contact:
Re: A Little More Than a Tool Tip
Thanks Scott...I actually got around to doing almost that exact thing. After more thought I created a completely new program and display file with the dialog box as the only screen format. This way I can use it from multiple programs by passing the help text I want displayed to it. I may even create an external database to hold the title and text of the dialog box so we will not have to go into the program every time we need to tweak the help text.
Thanks so much. Some times I have to put this old noggin through the ringer to get it to work correctly!!!
Thanks so much. Some times I have to put this old noggin through the ringer to get it to work correctly!!!
-
- Experienced User
- Posts: 116
- Joined: Wed Sep 05, 2012 11:14 am
- First Name: Eric
- Last Name: Hill
- Company Name: Integrated Corporate Solutions
- Phone: 256-760-8239
- Address 1: 501 S Wood Avenue
- City: Florence
- State / Province: Alabama
- Zip / Postal Code: 35630
- Country: United States
- Contact:
Re: A Little More Than a Tool Tip
I'm having a little problem using the image as a button. I think I am missing a property but don't know which one. What I have set now is this:
ID = HLP_SELTYP
Field Type = image
Response = HLP_SELTYP (defined as an indicator)
Image source = where I get the image
Cursor = default
onclick = pui.click("btnSubmit");
Any help on this? Do I need to set the CSS class?
Thanks!!!!
ID = HLP_SELTYP
Field Type = image
Response = HLP_SELTYP (defined as an indicator)
Image source = where I get the image
Cursor = default
onclick = pui.click("btnSubmit");
Any help on this? Do I need to set the CSS class?
Thanks!!!!
-
- Profound User
- Posts: 64
- Joined: Thu Aug 04, 2011 4:53 am
- First Name: Karl
- Last Name: Fritz
- Company Name: Logic IT Services
- Address 1: Fluhgasse 141
- City: Laufenburg
- Zip / Postal Code: 5080
- Country: Switzerland
- Location: Switzerland
- Contact:
Re: A Little More Than a Tool Tip
Hi Eric
You can add a ShotCut Key at the Field Settings of the picture:
Like this (similar a button):
shortcut key = Enter
You can add a ShotCut Key at the Field Settings of the picture:
Like this (similar a button):
shortcut key = Enter
-
- Experienced User
- Posts: 116
- Joined: Wed Sep 05, 2012 11:14 am
- First Name: Eric
- Last Name: Hill
- Company Name: Integrated Corporate Solutions
- Phone: 256-760-8239
- Address 1: 501 S Wood Avenue
- City: Florence
- State / Province: Alabama
- Zip / Postal Code: 35630
- Country: United States
- Contact:
Re: A Little More Than a Tool Tip
The control is passed back to the program when I click the image but the response indicator I defined is never getting turned on. I put it in the IBM graphical debugger and stepped through it but the indicator never turns on.
-
- Experienced User
- Posts: 116
- Joined: Wed Sep 05, 2012 11:14 am
- First Name: Eric
- Last Name: Hill
- Company Name: Integrated Corporate Solutions
- Phone: 256-760-8239
- Address 1: 501 S Wood Avenue
- City: Florence
- State / Province: Alabama
- Zip / Postal Code: 35630
- Country: United States
- Contact:
Re: A Little More Than a Tool Tip
Never mind. I found it. Was a typo that I looked at I know 100 times. Someone looked over my shoulder and pointed it out it 2 seconds. :-)
Thanks for all the help!!!!!
Thanks for all the help!!!!!
-
- Experienced User
- Posts: 116
- Joined: Wed Sep 05, 2012 11:14 am
- First Name: Eric
- Last Name: Hill
- Company Name: Integrated Corporate Solutions
- Phone: 256-760-8239
- Address 1: 501 S Wood Avenue
- City: Florence
- State / Province: Alabama
- Zip / Postal Code: 35630
- Country: United States
- Contact:
Re: A Little More Than a Tool Tip
Not so fast!!! :-)
Now whenever I press ENTER or click SUBMIT on the screen, it sets on the response indicator attached to the help image. I removed the shortcut key = ENTER and reset the onclick property to pui.click("btnSubmit"); but the indicator is never being set on when the image is clicked.
Any more suggestions?
Thanks!
Now whenever I press ENTER or click SUBMIT on the screen, it sets on the response indicator attached to the help image. I removed the shortcut key = ENTER and reset the onclick property to pui.click("btnSubmit"); but the indicator is never being set on when the image is clicked.
Any more suggestions?
Thanks!
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: A Little More Than a Tool Tip
Hi Eric,
I do not recommend specifying both the "onclick" and "response" properties of the same image (or button for that matter.) Even if you can get it working, Profound Logic does not support it, so it might break in a future release. It's intended that you only use one or the other -- onclick or response.
If you specify the response property, then when the button is clicked, control will be returned to the program, and the indicator will be turned on. There is no need to specify "onclick" for this to happen. As far as I can tell, this is what you want, isn't it?
If you want the image to peform some client-side logic, and then submit with a different button on the screen (I don't understand why you would in this scenario, but maybe I don't fully understand the scenario) then I would not specify the response indicator on the image. Instead, I'd specify the onclick property, and have it run some JavaScript code, followed by pui.click("otherButton") (i.e., "btnSubmit", fi that the other button you wanted it to click). But, I'm wondering why you need that functionality, here. Can you clarify?
I do not recommend specifying both the "onclick" and "response" properties of the same image (or button for that matter.) Even if you can get it working, Profound Logic does not support it, so it might break in a future release. It's intended that you only use one or the other -- onclick or response.
If you specify the response property, then when the button is clicked, control will be returned to the program, and the indicator will be turned on. There is no need to specify "onclick" for this to happen. As far as I can tell, this is what you want, isn't it?
If you want the image to peform some client-side logic, and then submit with a different button on the screen (I don't understand why you would in this scenario, but maybe I don't fully understand the scenario) then I would not specify the response indicator on the image. Instead, I'd specify the onclick property, and have it run some JavaScript code, followed by pui.click("otherButton") (i.e., "btnSubmit", fi that the other button you wanted it to click). But, I'm wondering why you need that functionality, here. Can you clarify?
-
- Experienced User
- Posts: 116
- Joined: Wed Sep 05, 2012 11:14 am
- First Name: Eric
- Last Name: Hill
- Company Name: Integrated Corporate Solutions
- Phone: 256-760-8239
- Address 1: 501 S Wood Avenue
- City: Florence
- State / Province: Alabama
- Zip / Postal Code: 35630
- Country: United States
- Contact:
Re: A Little More Than a Tool Tip
Scott...you are exactly right. I had it working yesterday without any trouble but for some silly reason started adding properties that I didn't need. Just having a response indicator is all I need and it is now working correctly.
Thanks to you and kfritz for your help on this!!!!!!
Thanks to you and kfritz for your help on this!!!!!!
Who is online
Users browsing this forum: No registered users and 3 guests