I received a client request for a couple of new buttons for RADE.
- 1. To add a button that would just run a query without bring up the query dialog
- 2. The other was to allow the user to zoom to a lat/lon coordinate
No problem, I contacted Landor and asked that these two buttons be created for RADE 3.5.
Big problem – I was told that we had agreed that there would not be any more development in RADE 3.5 as that would only delay the release of RADE 4. Some more words were exchanged about impacts, schedules and about sales reps which I won’t elaborate on.
I was also reminded that RADE offered users the ability to develop their own buttons. So I asked for a template on how to develop a custom button to run a user defined query or chart.
Custom Button to Run a RADE Query
The code template was pretty simple – I guess I should not have been whining after all. The basic format is:
1: var gszTgtQueryBuilder = fnCreateUniqueTarget("QueryBuilder");
2: function pQuery2003()
3: {
4: var szQueryUrl="querybuilder/queryselect.aspx?A=2003";
5: goQueryBuilder = window.open(szQueryUrl, gszTgtQueryBuilder, 'menubar=yes, resizable=yes, scrollbars=yes status=no, toolbar=no, width=300, height=300');
6: }
Bottom line on the above is this:
- a) Function pQuery2003() – is the new function we are creating that runs the RADE query with a query_id of 2003.
- b) var szQueryUrl="querybuilder/queryselect.aspx?A=2003"; – the A=2003 is a specific parser to indicate that query_id 2003 is to be run
RADE does not expose the query_id to users so I had to take a quick look at the WR_QUERY_NAME table in Toad to find the query_id for the query that I wanted to run.
So, given the above, I accessed the buttons dialog from the RADE administrator and filled in the dialog as shown in the image below:
The above button will run the Places Query from a map based application. The toughest part of the whole exercise was selecting the images I wanted to use with this query.
Configuring a Custom Dashboard
It occurs to me now that I can layout a complete application that simply places the queries that I want in a series of rows on a dashboard – interesting concept.
You can incorporate charts in the same way using the chart id and replacing “Query” in all the above with “Chart”.