How to create Table using TableContainer in Dojo in a specific format - dojo

Can we use dojox/layout/TableContainer to show a table with Headers and multiple rows eg.
Id || Header1 || Header2
1 || Editable-TextBox1 || Combobox1
2 || Editable-TextBox2 || Combobox1
Thanks in advance.

Yes, you can use table container to create a table like HTML. Please go through below link which explains what a table container is and how to create one.
https://dojotoolkit.org/reference-guide/1.10/dojox/layout/TableContainer.html

Look at the attached image. I have used table container which contains editable textbox and also radio buttons by folowing the links that I had posted earlier i.e.
https://dojotoolkit.org/reference-guide/1.10/dojox/layout/TableContainer.html

Although you could use TableContainer, this would not be that easy as TableContainer is intended to display individual widgets, each one with its header.
In your case, headers are the cells in the first row of the table. So you could:
disable headers (showLabels set to false)
first provide as many disabled TextBoxes as there are columns, with their value set to the respective column header text to fill the first row
then provide the content widgets to fill the content rows
Finally,
the look may not be what you need, knowing TableContainer is limited in this respect.
you would have to handle the changes logics: get back the value of each individual content widget that has changed (or of all content widgets)
Have you considered using dgrid ? See an example here. The associated source code is a good starting point

Related

In oracle apex, if the value of Upload Status column is NEW, then the Edit Button icon should be disabled

In oracle apex, if the value of Upload Status column is NEW, then the Edit Button icon should be disabled in Interactive Report.
I am aware that some dynamic action has to be added.
The name of my table is intg and it has a column named upload_status. If the value of it is NEW then I should not be able to edit that record.
From my point of view, the simplest option is to disable link column in Interactive Report's attributes and create your own link as part of the select statement. Something like this:
select case when upload_status <> 'NEW' then
'<img src="#IMAGE_PREFIX#ed-item.gif" border="0">'
end as link_icon,
id,
name,
whatever
from your_table;
As the link_icon column contains HTML tags, you'll have to set "Escape special characters" to "No" for this column (otherwise you'll actually see the tags instead of the icon).
Then, in column's properties, set its type to "Link". Edit "Link" section and set it to navigate to another page in this application (you know which one, and which parameters to pass).
That should do it.

I'm trying to reference the label value in my tab in Oracle Apex 5

I have several tabs in my APEX application. The first is "Arlington". I want to reference that in my query. In other words I want to have a query that displays data where the city = whatever the tab might say. In this example, it would obviously be Arlington. Am I being clear? I know there is a way to do it. I know my tab name is T_ARLINGTON. But I don't know how to reference the actual text of the tab. Thank you!
Simply create one page item and mention the tab title like ( &P1_NAME.), now refresh the page the text item value should be applied the tab title. this method showing the dynamic tab title...

Control of listview column order

I have a form with quite a few controls on it. The data presented is selected by a query. At occasions I want to change from form view to list view by VBA, however MS Access seems to have it's own ideas on the column order.
How can I control and make sure that the columns appear in a senseful way, e.g. by always having the key (in my case the article number) in the first column followed by the main attributes?
From the looks of the information found here: http://www.access-programmers.co.uk/forums/showthread.php?t=203904 you should simply be able to just set the column order for all of your fields. Example they used:
Me.tblxx_Gemeinde_ID.ColumnOrder = 1
Me.vorschlag.ColumnOrder = 2
Me.tbl_Auftrag_ID.ColumnOrder = 3
Me.tblxx_Haushaltsabschnitte_ID.ColumnOrder = 4
Me.tblxx_Taetigkeit_id.ColumnOrder = 5
So I would just add something like this into your VBA function you use to change to list view. (This answer is based off of the assumption that by list view you mean datasheet view.)

Is it possible to colour a cell with value from data in Cognos BI?

Let me first be clear. I'm not asking about how I do conditional formatting in Cognos BI. If there were a simple Red/Amber/Green colour scheme, based upon value ranges then I could do that. If it were a static list of colours, which never changed, I could also do that.
What I am after is accessing a hex colour code that is stored in my database, and I want to use that colour as my table cell background colour. This is something I commonly do in SSRS reports, but cannot see a method for in Cognos BI.
Is this even possible?
You can do this via the HTML object in Cognos.
The HTML object can get its definition from one of the three main ways:
1) Hard-coded text
2) Data Item Value
3) Report Expression
Obviously the first method provides no way to dynamically set the value. I couldn't get the second one to work at all. I'm not yet sure why. However, I was able to use the third type to work to allow dynamic setting of a visual style.
For the solution we'll assume you have a data item called [Color] which pulls a string value from a database in the standard hex form that is used in CSS: #xxxxxx, e.g. #CCCCCC. For the purpose of this example we'll assume it is in query Query1. The following steps describe how to set it up.
1) Add an HTML item right above your list
2) Add another HTML item at the bottom of your list
3) In the top HTML item add a span tag with a unique id such as:
<span id="list">
4) In the bottom HTML item add a closing span tag
</span>
5) Add a third HTML item before all of the other HTML items
6) Set the 'Source Type' property of the HTML item to 'Report Expression'
7) In the Report Expression put the following code:
'<style>
#list td {
background-color: ' + [Query1].[Color] + '
}
</style>'
8) Select the Page object and set the Query property to Query1
9) Click on the Properties property. Check the Color column to give the page access to that query-sourced value.
Now you can dynamically set the column color based on a database provided value. We used the span to give us a way to isolate just the table cells we want to manipulate.
The technique isn't perfect. For instance, the header cells also get their background changed to the color in question, which may or may not be desirable. This is because Cognos doesn't use the th tag for headers but instead renders them as normal cells (td).
I know it's quite and old post but just for completeness I'll add the references to get this working in html, pdf and excel.
To get this working not only for html but also for pdf and excel use a rich text item instead of a html item.
You can use following code in a query item for instance:
<span style="display:block; background-color:' + [Query Subject].[Query Item] + '"> </span>
The query item must then contain a valid color (e.g. rgb(255,0,0)) etc. which is defined by your data source.
Dragging a rich text item in a list and changing it to data item value and selecting the query item will work.
By using the span it will work for excel too, however to make sure it follows the size of the upper object in the hierarchy (the list column or a table etc) you want the display:block style.
Instead of the space in between the > < you can use any other query item that you want to appear as text.

BIRT result set values in specific cells

My query returns location_cd(string) and item_count(int). I only need certain rows from the result however and I need them to display in specific places in my layout so I don't think the table solution is going to work. Can I determine where I place the value for a particular row of the result set?
I am using a grid to display values for a number of fields. I cannot seem to be able to get the values from the results to show. The grid is bound to the result set. I even tried binding the cells to the result set but that didn't work either.
I checked in the query editor and there is a result set shown in the Preview so I know the query works. The complete and correct result set shows if I put a table on the page.
I tried inserting a Dynamic Text or Data object in a cell and used the expression:
dataSetRow["location_cd"]=="3SD"?dataSetRow["item_count"]:""
This returns a blank and does not seem to evaluate. I tested it with :
dataSetRow["location_cd"]=="3SD"?dataSetRow["item_count"]:"BLANK"
and got 'BLANK' to appear in that cell.
dataSetRow["location_cd"] and dataSetRow["item_count"] will display the location_cd and item_count from the first row of the result set. row.outer[] did the same thing. Obviously I am just hacking at this report at this point.
A co-worker suggested that she uses a JAVA if-statement in places like this but I could not get that to work either.
Any ideas or suggestions that will get me on the right road??
Thanks
An elegant option would be to use a HashMap storing the result of the dataset.
Declare a report variable named "values", with a new hashmap as default value (see image below)
Fill values in the onFetch script of the dataset: vars["values"].put(row["location_cd"],row["item_count"]);
Insert new data elements at any place of the report with expressions such: vars["values"].get("myFavoriteLocationCD");
Though it is important to note the dataset should be triggered by the report before these data elements.
The particular row you want to display you specify in a "Text" field inside your grid. Just drag and drop a "Text" field inside your grid. If you bound the fields you want to display to your grid, the "Text" field inside the grid inherits the bindings of its parent (the grid), so you can access the bindings automatically in the "Text" field.
You could try following steps, maybe that works.
Don't use "Dynamic Text" field, instead use a regular "Text" field
Ensure the fields of your query which you use, are bound to the grid (you sayed you already did)
Open the "Text" field
Change preselected pull-down entry "Auto" into "HTML"
Change preselected pull-down entry "Formatting" into "Dynamic Text"
Wrap your code in <value-of format="HTML"> your code goes here... </value-of>
Note: You should check in the "Expression Builder" of your "Text" field if you are able to access the fields you bound to the grid. If they are not available sth. went wrong with your binding. Avoid binding query records to cells this will drive you crazy.
If you want to display a list, ensure you didn't set a constant height in the row of your grid. Set the height to 100% than the row takes its height dynamically.
What about the idea to optimize your query, that only get the results you want are displayed, than you don’t need to filter them with java script? If you don’t need the filtered results in another place this would be the cleaner solution in my opinion.