|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
Hello,
I have an edit screen with many fields. Next to each form box I want a button which when clicked takes the person to a web page showing help about that particular field. One way was to place a unique script button next to each field and JScript to link to each page in the help file. For example, function forenames_onClick() { Application.appWindow("http://..."); } where the ... is my link to the page. This works fine. The problem is I have over 80 fields in the edit screen and it is tedious and hard to maintain 80 JScript functions. Does anyone have a simpler solution? Thanks in advance, Paul. |
|||
|
It would be easy to move all of them into a function, however, since all of the buttons are unique, you would not be able to save much typing/code/time this way.
Probably the "simplest" solution I can think of is to create a textbase that contains the button names and the urls (and an id). Then a simple report form that outputs them in the desired format. When you wanted to update the form you could find all records (search>find all records) then write to a plain text file (file>Write Report to file...) You could then open the resultant text file and copy and paste it into the script box of your form, you will have to name all your buttons still, but that is a one time thing. Alternatively you could have your mini textbase report generate the entire report form for the database and import into the original db, but that would be more involved and complex to setup. I tried it out, it took me longer to write this post than to generate the PoC, so you will want to change it! TBB file (place in a new notepad file, save as something.tbb , then create a new textbase based on a backup structure) comment='' LstFldNo=3 BegFld=1 'id' 10 3 0 0 0 6 0 0 1 1 0 1 fExtraANum=3 1 1 0 BegFld=2 'button_name' 1 3 0 0 0 6 0 0 1 1 1 1 fValid= 11 0 0 0 0 0 0 0 1 1 1 0 BegFld=3 'url' 1 3 0 0 0 6 0 0 1 1 1 1 fValid= 11 0 0 0 0 0 0 0 1 1 1 0 maxInstances=25 LeadList a an the StopList a an and by for from in of the to dfltSort=0 0 0 logFile=1 1 0 dfltUpdMode=8 xmlMatchFields=1 1 Report Form (XPF file)
fname=compile
textbase=btnfunccompilr
fdesc=
type=F
usage=RP highlight
h_units=M v_units=M h_grid=13 v_grid=13 rec_sp=38
fonts:
font_ndx=0 font_name=Times New Roman
font_parms=-13,0,0,0,0,0,0,0,0,0,0,0,0
font_ndx=1 font_name=Arial
font_parms=-13,0,0,0,700,0,0,0,0,0,0,0,0
html_options:
wwwFlags=
wBgColor=0
userecsep ruleheight=0 rulewidth=0 rulealign=C
cgi_options:
display_form=
report_form=
margin_boxes:
[1] box_type=P obj_type= class_type=F
anchor=F left=572 top=76 width=1016 min=0 max=0 tab_order=0 tab_skip=0
label_loc=
indent=0 justify=C
(1) item_text=<Report Title Goes Here>
[2] box_type=P obj_type= class_type=F
anchor=F left=953 top=2667 width=254 min=0 max=0 tab_order=0 tab_skip=0
label_loc=
indent=0 justify=C
(1) item_var=P
report_boxes:
[1] box_type=R obj_type= class_type=F
anchor=L left=0 top=0 width=1651 min=0 max=0 tab_order=1 tab_skip=2
label_loc=L label_width=254
nospace indent=0
(1) item_text=function
(2) item_field=button_name
(3) item_text=_onClick()œ{œ Application.appWindow("
(4) item_field=url
(5) item_text=");œ}
page: page_width=2159 page_height=2794 page_top=254 page_bot=254 page_left=254 page_right=254 page_start=1
now generating the script is trivial, and you have all the management features of db/textworks! This process could most likely be streamlined some more, but i can not think of any "simple" way. Luke Stephenson |
||||
|
Thank you for your suggestion. I was wondering if there was a way of determining the text of a script button using JScript. If there was I could have 80 buttons with the same name, hence 1 onClick function. Inside the onClick function I could extract the text of the script button and call the appropriate help page.
Paul. |
||||
|
You can add a text box and put in the http:// address in that. Now you can click on the link and the htm-page comes up. Of cause this can look a bit peculiar, if you have very long addresses, but perhaps it's easier than with scripts.
NEEngstrom |
||||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

