My Ellucian's Colleague playground with all tips and tricks I learned as a programmer.
Showing posts with label code. Show all posts
Showing posts with label code. Show all posts
Thursday, September 26, 2013
Thursday, May 9, 2013
Submit the form when a drop down menu item is selected in Webadvisor
In field output of a VAR variable, enter the following:
OUTPUT.DATA := '<script type="text/javascript">'
OUTPUT.DATA := "document.getElementById('VAR1').onchange = submit;"
OUTPUT.DATA := 'function submit() {document.datatelform.submit();}'
OUTPUT.DATA := '</script>'
In this case, VAR1 field contains the drop down menu. This code needs to be parsed after VAR1. For instance, if you insert the above code in VAR2 output field, VAR2 needs to be below VAR1 in UI Form Field Sequence.
Note that this has only been tested with standalone webadvisor. I am not sure if this will work with webadvisor webpart inside colleague portal. If it does, the document and field name may need to change accordingly.
Labels:
code,
Colleague,
datatel,
dropdown menu,
envision,
form,
javascript,
portal,
script,
submit,
unibasic,
unidata,
webadvisor
Tuesday, May 7, 2013
Delete record from a table
V.DYNAMIC.VALCODES.ID = A.DYNAMIC.VALCDS.ID
FOR_THIS DYNAMIC.VALCODES.ID DELETING
END_THIS DYNAMIC.VALCODES.ID
We need to have one element from the table in the demand element window for this to work.
Bargraph in web UI 4
* Input: GRAPH.NUM.SELECTED Used to calculate scaling factor.
* GRAPH.IDX Used to compare with scaling factor.
* GRAPH.TITLE Used to print a title at the top of the page.
* GRAPH.CLEAR Used to clear the part of the screen you
* want cleared.
* 1. Must use following inserts:
*
* $INSERT I_COMMON FROM UT.INSERTS
* $INSERT I_GRAPHIC_CHAR FROM UT.INSERTS
* $INSERT I_BAR.GRAPH FROM CORE.INSERTS
*
* 2. GRAPH.NUM.SELECTED must be set to the total number of items
* that the bar graph is being run for.
*
* 3. GRAPH.TITLE must be set. (name of the Progress Bar)
*
* 4. GRAPH.CLEAR must be set. This should be set to how much
* of the screen you wish to clear. i.e. @(-1) for the screen
* to be completely clear at the start.
*
* 4. Must use GOSUB INIT.BAR.GRAPH before the loop
*
* 5. GRAPH.IDX must be set somewhere in the process loop and should
* be set before GOSUB UPDT.BAR.GRAPH.
*
* 6. GOSUB UPDT.BAR.GRAPH should be somewhere in the main process loop.
*
* 7. There are two ways to finish the bar graph.
*
* a) GOSUB FINI.BAR.GRAPH
* (The program controls whether or not to leave the
* final statistics on the screen.)
*
* b) GOSUB FINI.BAR.GRAPH.PAUSE
* (This routine will pause after printing the final statistics.)
*
* You have to turn off "USE BAR GRAPH" on the BGP (batch global parameters) screen to manually create bargraphs
* Sub graphs are done the same way as above just with slightly different commands as illustrated below
* Note: graphs will not update correctly if HUSH is turned on when update to graph is called!
Example:
* Inserts: required
$INSERT I_COMMON FROM UT.INSERTS
$INSERT I_GRAPHIC_CHAR FROM UT.INSERTS
$INSERT I_BAR.GRAPH FROM CORE.INSERTS
$INSERT I_SUB.GRAPH FROM CORE.INSERTS
* Set or calculate max size of the graph here:
X.GRAPH.SIZE = 30
* Required, Main progress bar
* I do not believe you can change the Title/num selected without creating a new graph, clearing the correct stuff,
* re-initing a graph, etc. Probably not worth doing. Use subgraphs and graphs if you have need of a mutable graph.
GRAPH.TITLE="Progress Bar Title"
GRAPH.NUM.SELECTED=X.GRAPH.SIZE
GRAPH.IDX=0
GRAPH.CLEAR=@(-1)
GOSUB INIT.BAR.GRAPH
*Required IF you are using sub bar
SUB.GRAPH.NUM.SELECTED=@SYSTEM.RETURN.CODE
SUB.GRAPH.TITLE = "Subgraph Title"
SUB.GRAPH.IDX=0
GOSUB INIT.SUB.GRAPH
* Insert your code here.
* when you want to update the Bar count, do the following two lines:
* (note: I haven't tried counting down/backwards, I would suggest not doing so just from a design perspective)
GRAPH.IDX=*your number here
GOSUB UPDT.BAR.GRAPH
*If you want to update the sub-bar:
SUB.GRAPH.IDX=*Your number here
GOSUB UPDT.SUB.GRAPH
* finish subgraph after you are done processing the subunit (don't wait until entire process is done,
* I believe you need to call FINI.SUB.GRAPH or FINI.SUB.GRAPH.PAUSE every time you use the subgraph)
GOSUB FINI.SUB.GRAPH
* finish main graph, can use FINI.BAR.GRAPH or FINI.BAR.GRAPH.PAUSE, see documentation above
GOSUB FINI.BAR.GRAPH
Monday, May 6, 2013
Prompt user to download a file in web UI 4
Insert the following inserts:
$INSERT I_RIA_COMMON FROM UT.INSERTS
$INSERT I_RIA_TRANSFER_TYPES FROM UT.INSERTS
$INSERT I_COMMON FROM UT.INSERTS
Insert this code:
* ------------------------------------------------------------------------------------*
X.TRANS.TYPE = 'S'
X.DIRECTORY.FILE = "HOLD_SHARED_TESTDIR"
X.SOURCE.RECORD = "testFile.txt"
X.TARGET.RECORD = "testFile.txt"
X.FILE.ACTION = RIA.XFER.SAVE
X.NOTIFY.CLIENT = 1
X.ERROR.OCCURRED = ""
XL.ERROR.MSGS = ""
CALL S_RIA_TRANSFER(X.TRANS.TYPE, X.DIRECTORY.FILE, X.SOURCE.RECORD, X.TARGET.RECORD, X.FILE.ACTION, X.NOTIFY.CLIENT, X.ERROR.OCCURRED, XL.ERROR.MSGS)
IF (X.ERROR.OCCURRED) THEN
CALL S_RIA_MESSAGES("", "Save failed. Please contact admin.")
END
* ------------------------------------------------------------------------------------*
User will be prompted to save file "testFile.txt" to his/her computer. For the above code to work, directory TESTDIR must be public, or whoever runs the program needs to have write access to the folder. Directory path for HOLD_SHARED_TESTDIR is "apphome/_HOLD_/SHARED/TESTDIR"
$INSERT I_RIA_COMMON FROM UT.INSERTS
$INSERT I_RIA_TRANSFER_TYPES FROM UT.INSERTS
$INSERT I_COMMON FROM UT.INSERTS
Insert this code:
* ------------------------------------------------------------------------------------*
X.TRANS.TYPE = 'S'
X.DIRECTORY.FILE = "HOLD_SHARED_TESTDIR"
X.SOURCE.RECORD = "testFile.txt"
X.TARGET.RECORD = "testFile.txt"
X.FILE.ACTION = RIA.XFER.SAVE
X.NOTIFY.CLIENT = 1
X.ERROR.OCCURRED = ""
XL.ERROR.MSGS = ""
CALL S_RIA_TRANSFER(X.TRANS.TYPE, X.DIRECTORY.FILE, X.SOURCE.RECORD, X.TARGET.RECORD, X.FILE.ACTION, X.NOTIFY.CLIENT, X.ERROR.OCCURRED, XL.ERROR.MSGS)
IF (X.ERROR.OCCURRED) THEN
CALL S_RIA_MESSAGES("", "Save failed. Please contact admin.")
END
* ------------------------------------------------------------------------------------*
User will be prompted to save file "testFile.txt" to his/her computer. For the above code to work, directory TESTDIR must be public, or whoever runs the program needs to have write access to the folder. Directory path for HOLD_SHARED_TESTDIR is "apphome/_HOLD_/SHARED/TESTDIR"
Labels:
code,
Colleague,
datatel,
download file,
ellucian,
envision,
file,
prompted,
save file,
unibasic,
unidata,
web UI 4
Subscribe to:
Posts (Atom)


