evaluate HTML content from item in region Oracle APEX - oracle

In the database table I have a CLOB column that stores content with html markup. To display the content, I have a "Hidden" item called P4_DESCRIPTION and in the region that I want to display the value of the item, I use &P4_DESCRIPTION. .
Unfortunatelly it is not evaluating the HTML markup and displays the content as it is stored in the DB.
I also tried to change the P4_DESCRIPTION from "Hidden" to "Display Only" but I have the same problem. A workaround that I found is that if I have the P4_DESCRIPTION as "Display Only" and in the region I keep the &P4_DESCRIPTION. then the &P4_DESCRIPTION. will evaluate the HTML code. In this case I have hide with CSS the item and I will have the result I want. But I suppose it's a dirty way of doing it.
What is the clean way of displaying the content of the column that contains HTML markup? (btw to create the content of that column I used the rich text editor field)

Set the item to Display Only and set Escape special characters on it to No.

Related

Oracle Apex Table Cell Attributes for a Page Item Label

I'm using Apex 5.1. I have a form with several display-only items. I'd like to bold or color the label to distinguish it from the text. I see a field for Table Cell Attributes in the Label section, but I don't know how to indicate something like Bold or Color.
By the way, I have the Escape Special Characters option set to NO so that I can display the text in the display-only field without the HTML tags.
If you want ALL the labels on a page to be bold, you should use CSS, e.g. in the page Inline CSS attribute add this:
.t-Form-label { font-weight:bold; }
Should be fairly simple.
if your current label is Employee Name
set it to bold by putting this into the label property: <b>Employee Name</b>

Oracle APEX: URL column in interactive grid cannot be edited

I have an interactive grid in an APEX application, and one of the columns (header ATTACHMENT) has URLs that open in a new tab. However, as part of the functionality of an interactive grid, I am unable to edit the URL within this column. All the columns are editable, but since I changed this column to a 'Link' the user cannot edit it. I also tried single row view, but same.
Is this possible?
Thanks
See my interactive grid
How about specifying the same column (attachment) twice? One would be used for editing purposes, and another one as a link. Something like this:
select
id,
attachment edit_url,
'Link' link_url
from your_table
ID is the primary key column
EDIT_URL is a usual Text Field
LINK_URL is a Link column
its "Query only" property has to be set to "Yes"
"Escape special characters" set to "No"
When you run the page, it'll show 3 columns; EDIT_URL will be editable. Once you modify that column's value and save the changes, LINK_URL will reflect that change and - when you click the "Link" word in that column, it'll lead you to the modified URL.

Display HTML content inside a table cell - BIRT report designer

I have a dataset in which one of the column has html tags. When I try to bind the data column with a cell inside a table, the data is being displayed as it is - I see the html tags like < br >,< br > in the cell. Is there a way I can get rid of the tags and display the data with proper formatting?
Yes.
But a data item does not work for this.
You'll have to use a text item, and inside the text item, reference the data as row["MY_COLUMN"] (you know, what I mean). It is important to switch the text item's Content Type from the default Plain to HTML.

Xpages link to open document view

I want to add an option to the row of the view: the possibility to open the document when clicking on the row. It is possible? How can I achieve this?
Add displayAs="link" to viewColumn. Then it is rendered as link and opens the document if you click on it. You can also choose to open it in edit or read mode.
Set the attributes in properties panel:
Update:
You can open the corresponding document clicking somewhere on a viewPanel's row (not just on a column's link) if you add a rowAttrs property.
Add the following code to your viewPanel:
<xp:viewPanel
rows="30"
id="viewPanel1"
var="row">
...
<xp:this.rowAttrs>
<xp:attr
value="window.open('#{javascript:row.getOpenPageURL(null, true)}', '_self')"
name="onclick"
rendered="#{javascript:!(row.isCategory() | row.isTotal()) }">
</xp:attr>
</xp:this.rowAttrs>
</xp:viewPanel>
Set viewPanel's row variable to var="row". The attribute attr gets rendered for all rows which are represent a document. It adds an individual onclick event to those rows and executes CSJS code defined in value. This CSJS code contains a SSJS part which inserts the URL of the document as window.open's parameter.
If you set getOpenPageURL's second parameter to false then document will be opened in edit mode.
Look here for a detailed description.
I think there is no easy way ;-) Maybe JQuery is your friend to add a on click event to the row with needed

How do I change the top value name in a text box on a Cognos Report?

The default value for the first item in a drop down list is the name of the database field. I need to change it to a more user friendly name. How do I change the value?
add a HTML Item onto the prompt page and add the following as an HTML item:
Example:
<script>
document.formWarpRequest._oLstChoicesMyList[0].text = '--SELECT A CITY--';
</script>
Replace 'MyList' with the name of the component.
from: link text
In Cognos 10, you can specify prompt text of your choice in Report Studio.
Select the value prompt
In Properties pane, under 'Prompt Text' section, the 'Header Text' property will be set to Automatic. Click the ellipsis button next to it and Header Text Dialogue opens.
Select 'Specified Text' choice. Click ellipsis.
Provide the text of your choice and click ok.
Run the report and you will see text that you provided will appear as first item in the drop down list.
I have provided a Screen shot for a better understanding.
You have a couple of options. First, you can rename the data item's name from database field name to a more friendly name in the Framework Manager metadata.
Second, you can rename the item in Report Studio. However, if you do this you will notice that it is still using the database name. You actually need to perform a calculation in the item expression for it to use your name instead of the default name. So say you are pulling in the string field [Namespace].[Unfriendly Name] and you named your report data item "Friendly Name." The top selection will still read "Unfriendly Name." However, if you replace the data item with the following:
[Namespace].[Unfriendly Name] || ''
It will see that there is a calculation involved and use your friendly name. In the case of a number field you have to add zero instead of concatenating ''.
This is also the case with report column headers (which you can replace with text instead of using this calculation method).
Convoluted? Yes.
Within the dataitem in the query.. you could do a ..
IF ( [dataitemA] = 'some text' ) THEN
( 'new text' )
ELSE
( [dataitemA] )
i try to avoid using javascript and html items becuase they dont generally work in pdf or excel outputs.
just a thought..
cheers!

Resources