qbo3 Rendering data from API calls - html-table

I am using qbo3 to fetch data from our data warehouse (Process/MyApiCall?Foo=Bar), and I'd like to display the data to an end user. Does qbo3 have a standard UI for such data (without knowing the schema in advance)?

qbo3 contains Templates/Report/Standard.xslt that will render a DataTable or DataReader as an HTML table.
To view the API data in raw HTML format:
// View as XML
Process/MyApiCall?Foo=Bar&Output=Xml
// View as JSON
Process/MyApiCall?Foo=Bar&Output=Json
// View as an HTML table
Process/MyApiCall?Foo=Bar&Transform=Templates/Report/Standard.xslt
To wrap this same output in the standard QBO skin:
Theme.ashx/Wrap?ClassName=Process&Method=MyApiCall&Foo=Bar&Transform=Templates/Report/Standard.xslt
The Standard.xslt will render a <table> for each DataTable returned by the API call, and a <th> for each column returned in a DataTable.
If the columns follow standard QBO convention with {Table}ID / {Table} paired next to each other, QBO will combine these results into a single column, displaying {Table} with a hyperlink to the underlying record. Note that this feature only works with QBO-recognized Modules (found in Configuration > Modules).

Related

How to filter REST control based on dojo grid selection?

On an Xpage I have two REST controls that populate two enhanced dojo data grids. One is populated with companies, the other I would like populated with the contacts of the selected company. I am able to select a company and display the UNID of that document in a field on the xpage. I am having difficulty filtering the contact grid based on that UNID. What is the best way to do that? Below is what I have tried
Populate the ParentID field with the selected doc UNID using (CSJS):
var grid = arguments[0].grid;
var index = arguments[0].rowIndex;
var item = grid.getItem(index).attributes;
XSP.getElementById("#{id:ParentID}").innerHTML = item.companyLink;
XSP.partialRefreshGet("#{id:contactListPanel}")
Retrieve the UNID from Parent ID and use in the keys parameter of the contact REST control using (SSJS):
getComponent("ParentID").getValue()
It looks like the contact grid is refreshing when a company doc is selected, however all the contacts for all companies appear in the contact grid no matter what company is selected.
Probably, ParentID field doesn't get submitted to server and isn't available as parameter for REST service.
Transfer company's UNID as parameter in partialRefreshGet() instead
XSP.partialRefreshGet("#{id:contactListPanel}",
{params: {'unidCompany': item.companyLink}})
Read the parameter on server side with
param.unidCompany
and use it as parameter for REST service.

Reload just one tab in Qlikview

How can we reload one tab , means one request of many in QLikview.
PS:
I have one request per tab
Help appreciated
Thank you
If you are talking about 1 tab in the front end of QlikView you cannot refresh it as the entire model is driven by the underlying data and data structure.
You can set up partial reloads that will reload only certain tables of in that data.
One request per tab is not ideal, recommended practice is that separate data is held in separate Qlikview documents.
However, this can be achieved - using variables and locally stored QVD's and the script below. You can also control variable values on the UI using buttons and actions on objects. The QVD's hold the data and are only reloaded when expressly requested.
//choose which data to load 1 = load query from scratch
Let vLoadQuery1=1;
Let vLoadQuery2=0;
Let vLoadQuery3=0;
Let vLoadQuery4=0;
Let vLoadQuery5=0;
if vLoadQuery1=1 then
//Enter load details and capture in local QVD
//Load
Query1:
LOAD *;
SQL select * from some.data;
//Store
STORE * from Query1 into Query1.qvd (qvd);
Drop Table Query1;
ENDIF
//Load from QVD - if this hasn't been loaded on this reload, it will grab the previous data
NewQuery1:
LOAD *
FROM Query1.qvd (qvd);

Dynamic URLs in HANA XS

I'm trying to implement simple product catalog using HANA XS Javascript. Pages of the catalog should be rendered on the server side.
How can I handle "dynamic" URLs based on data read from HANA database? For example, http:///myapp/store/[product-slug]/ (products are stored in HANA database and have unique slugs).
You can create a router function on your application.
On 'http:///myapp/index.html', create a javascript function called 'getSlug'. This function get the path url and split string based on '/', the result will be:
[0] store
[1] [product-slug]
Create a function to router the content. You need to have column in product table with slug.
The router function will receive an array of slugs. On this function you need to implement the structure of your app.
For example, every time that fisrt item is 'store', load html of products into the div.
This is a kind o single page application. Every time that load this page, call this function:
$(document).on('load', function(){
router();
)

How to display custom fields in rally?

I have a ruby script that is trying to pull up some custom fields from Rally, the filter works just fine ( the filter contains one of the custom fields i want to pull up) but when I try to display it, it doesn't show up in the list (the value returned for all custom fields is blank, while appropriate values are returned for FormattedID, Name, Description).
Here's the link [link]http://pastebin.ubuntu.com/6124958/
Please see this post.
Do you fetch the fields?
What version of WS API are you using? If it is v2.0 is c_ prepended to the name of the field in the code?
How is the field spelled in your code and how that spelling compares to Name and Display Name of the field in UI?
There is another reason why custom fields might not appear (other than the versioning and 'c_' issues nickm mentioned). I just found this out after a ton of head banging. The Rally SDK's ui stuff will filter out all fields that are hidden (such as _ref, or other 'hidden' custom fields) so you cannot view them in your apps in grids, charts, etc. For example, when constructing a Rally.ui.grid.Grid, a class called Rally.ui.grid.ColumnBuilder is constructed and it executes a command on the columns of the chart that look like this:
_removeHiddenColumns: function (columns) {
return _.filter(columns, function (column) {
return !column.modelField || !column.modelField.hidden;
});
},
As you can see, if you try to display any fields that are hidden (like _ref for example) in a grid, the column gets removed. So, although you may be fetching the custom fields, they will not show up unless those fields are not 'hidden'.

Data not updated in dhtmlx .net scheduler

I have problems and questions about this scheduler. I already tried to build and almost finished it. Although, I receive some errors...
What I do?
I create custom lightbox
mapping all the data in to table dbo.bEvent
I used custom eventbox like this : Scheduler.Templates.event_text = "({position_desc})" + " " + "{newrate}"
position_desc is actually from other table 'dbo.zone'
I create Views in SQL Server to retrieve data from 'newrate'. 'newrate' actually is a new attribute after I do some query to change rate "1000 to 1k" which is new rate save '1k'.
the views that I create by joining table "dbo.zone and dbo.bEvent"
Problem is?
when I save a new data or insert or update new data. my event box just give me '(Undefine)undefine'
all the data that i put in lightbox is save in dbo.bEvent
after I resfresh the page using f5 or navigate to next page or previous page then the data is updated.
Here i attach some screenshot. Thanks in advance
http://s1319.photobucket.com/user/matpyam/library/?sort=3&page=1
If you save the changes as described here http://scheduler-net.com/docs/lightbox.html#define_crud_logic ,
note that the method uses SchedulerFormResponseScript class to render the response.
Constructor takes instance of the event class to be returned to the client. Values of that event will be applied to the related event on the client-side
return (new SchedulerFormResponseScript(action, changedEvent));
make sure object that you send (changedEvent) has all data properties initialized. Basically the event should have the same data as when it is loaded from the Data action.
Alternative solution, which may be more straightforward, would be reload calendar data with the client-side api after saving event:
scheduler.clearAll();
scheduler.load("dataUrl", "json");
http://docs.dhtmlx.com/scheduler/api__scheduler_clearall.html
http://docs.dhtmlx.com/scheduler/api__scheduler_load.html