Javascript go through cells of a standard report column
hi,
my apex version is 4.0.2
how can i go through the cells of a specific column?
when the cell is not null then it should remove the class "data" and add a new one data1
html snippet of the table
<th class="header" id="JACK">
<td class="data" headers="JACK">
Text - 13320
I think this is what you need.
Add the following to the 'Execute when Page Loads' region of the Page:
$('td[headers="JACK"]').each(function() {
if (!$(this).text()) {
$(this).attr('class', 'data1');
});I hope it helps :)
Shunt
Similar Messages
-
Need help with Javascript to get value of standard report column
Hello All,
Apex version 3.1
I have a SQL Query (Updateable report) region where I need to do some validations using an OnDemand Applicaiton Process and javascript. For this validation I need to use the serial number and the item id from the same report row. The function is called when the serial number is changed. I can get the serial number easily because it is a Text field, however the item id is a standard report column (making it a text field or hidden gives me a checksum error, long story). How do I get the value for the standard report column in order to set the value for an Application item to be used in my Application Process along with the serial number? Here is my code below.
<script>
function f_ValidateSerial(pThis)
// The row in the table
var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
//alert('Row is '+vRow);
// Display the serial number
//alert('The Serial Number is '+html_GetElement('f21_'+vRow).value);
var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=ValidateSerial',0);
get.add('F101_SERIAL_NUMBER',html_GetElement('f21_'+vRow).value);
get.add('F101_INVENTORY_ITEM_ID',+html_GetElement(?????+vRow).value); // Here's where I need to get the item id to set application item!!
gReturn = get.get();
if (gReturn)
alert(gReturn);
if(gReturn)
html_GetElement('f21_'+vRow).value = '';
</script>jarola wrote:
Hi,
Ok, No standard report column do not have name attribute-
You can add one extra column to report that is your Item Id with different alias.
Then change that column Display as to "Hidden".
Now you have hidden input where is your Item Id. Than input have name and id.
Regards,
JariBut this puts me back to my initial problem. When making the column hidden I get the checksum error...
Error in mru internal routine: ORA-20001: Error in MRU: row= 0, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process...
The item id is NOT in the table which I am updating (I use a subquery to get the data) so I think it has to be a standard report column. Hidden and Text Item (which have an item id) all generate the checksum error.
So I think I'm back to my original question. Given a standard report column on a row in a sql query (updateable report) region how do I get the value using Javascript?
Edited by: blue72TA on Aug 2, 2011 12:07 PM -
Cannot edit a field that is "Standard Report Column" when new row added
Hi everyone,
I have created a master-detail form from the wizard and within the detail report region source I have used apex_item.xxx API
example;
select C1, C2,
CASE when C2 ='N' then
apex_item.select_list_from_query(3, C3,'select a1 d, a2 r from table1', 'ENABLED', 'NO',null,null, 'f03_#ROWNUM#')
else
apex_item.select_list_from_query(3, C3,'select a1 d, a2 r from table1', 'DISABLED', 'NO',null,null, 'f03_#ROWNUM#')
END C3
from table;
All columns C1,C2,C3 are defined as "Standard Report Columns".
The results allows the column C3 field to be enabled or disabled for input depending on a condition.
The problem is when you hit the default button "Add Row" to add a new row. The row is non-editable and is populated with null values.
What I want is to allow input when a new row is inserted into the multi-row detail form.
Can any one help?
Is there a way to change the Display As field for the new row columns to "text field" from "standard report column" dynamically?I think you will need to use the old way of adding rows instead of the new one. I remember having headaches trying to get it working.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/otn/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
Can "Standard Report Column" be the Default Instead of "Display as Text"
Almost every report region I write has some html in at least one column, whether it's a break or an apex_item or something else. Hence, when the region renders with the default settings, the column shows the html code - I have to change the column display type from "Display as Text" to "Standard Report Column".
Is there some setting to make "Standard Report Column" the default? (Isn't that kind of what the word Standard implies?)
Thanks,
GregoryThat Other Fellas Brother wrote:
Almost every report region I write has some html in at least one column, whether it's a break or an apex_item or something else. Hence, when the region renders with the default settings, the column shows the html code - I have to change the column display type from "Display as Text" to "Standard Report Column".
Is there some setting to make "Standard Report Column" the default? (Isn't that kind of what the word Standard implies?)In earlier versions of APEX "Standard Report Column" was the default. The default was changed in APEX 4.0 to "Display as Text" (which escapes HTML-sensitive characters) as a security measure to limit vulnerability to XSS attack. This is necessary for the protection of users and (so-called) developers who are not security conscious/HTML savvy.
There's no option to change this, and I doubt that one will be provided in the future. The indications are that the Oracle APEX team are committed to blocking as many security holes as possible by default, leaving it to the developer to consciously make any modifications that increase the surface exposed to attack. -
Displaying leading spaces in a Standard Report Column
Is there a way to display leading spaces in a standard report column in APEX?
I am using the following hierarchy query to left pad the metric title with spaces to indent subordinate records. The problem is that the APEX report truncates the leading spaces when the data is displayed.
I have replaced the spaces with an underscore, however the end users prefers white spaces for readability.
Any help is greatly appreciated.
SELECT
t.group_id,
t.metric_id,
LPAD(' ',(LEVEL - 2)*5,' ') || d.metric_title metric_title,
d.business_unit,
get_name(d.data_owner) data_owner,
d.metric_status,
t.group_sort
FROM tbl_health_metric_groupings t JOIN tbl_health_metric_definition d ON t.metric_id = d.metric_id
WHERE t.group_id != 0
START WITH t.group_id = 0
CONNECT BY t.parent_group_id = PRIOR t.group_id
ORDER SIBLINGS BY t.group_sort, d.metric_titleThanks Tony your comment got me pointed in the right direction.
LPAD only pads a single character to the left so doing something like LPAD(' ',(LEVEL -2)*5,' ') does not produce the expected results however placing LPAD inside a replace function does...
The following works as expected and places leading spaces at the begining of the metric title based on the hierarchy:
SELECT
t.group_id,
t.metric_id,
replace(LPAD(' ',(LEVEL - 2)*5,' '),' ',' ') || d.metric_title metric_title,
d.business_unit,
get_name(d.data_owner) data_owner,
d.metric_status,
t.group_sort
FROM tbl_health_metric_groupings t JOIN tbl_health_metric_definition d ON t.metric_id = d.metric_id
WHERE t.group_id != 0
START WITH t.group_id = 0
CONNECT BY t.parent_group_id = PRIOR t.group_id
ORDER SIBLINGS BY t.group_sort, d.metric_title -
Define a new class in CSS for the width in a standard report column
Hi all,
I need to give one standard report column a width of 30px. I read anything about this here in the forum. I only know a litte of CSS and HTML. So I tried the following, but it doesn't work.
I have a own css-file for my application. I tried to define a new class in it:
div.reportcol30{width:30em;}
Then I write the following in the report attribute "CSS CLASS" for my column:
<div class="reportcol30">
Does anybody have an idea what's wrong?
Thanks, DanielaDear Denes Hi,
I tried (display:block;width:500px;overflow:hidden;) in my application, but the problem is that
the column it self took the new width (500) , but the data row (which is select_list_from_lov)
still smaller than 500 about 250 what is th problem
thank you -
Can we change the background color of a Standard report "column"?
4.2.1
Theme 24 - Cloudy
Hi There,
I searched this forum and online but did not get a straight forward way to change the color of a standard classic Apex report column. I want the whole columns background color to be blue. I tried some of the suggestions for using span etc, but they did not work.
Was wondering if anyone has a solution for this? would be very helpful!
Thanks,
RyanUse a custom named column report template with <tt><colgroup>/<col></tt> and CSS as in these threads.
Could also be done with JavaScript, but if the entire column is to be coloured (rather than individual cells based on some condition), the template approach will be simpler and have better performance -
I need to limit the column size on a Report Column using APEX 3.1.
I have set the Element Width in the Column Attribute Screen, but the actual report column size does not change.I have a date field in format of DD-MON-YYYY HH24:MI and it wraps like so:
TASK_DATE
21-JUL-2008
00:00
I would like to it to display:
TASK_DATE
21-JUL-2008 00:00
I can do the following:
TASK_DATE...........
21-JUL-2008 00:00
I also have to troubleshoot why the date is set to midnight, because my query is select sysdate from dual.
Thanks for any help... -
Null Index Error When Sorting Standard Report Column
I have a page in one of my application that contains three reports in three seperate regions within the page. You only see one report at a time, however, and control which one you see based on a sidebar table containing links that call javascript functions to toggle the hiding/showing of each region.
The problem stems from trying to use the standard column sort on any of the columns. When I click the column header in any of the the reports, the page submits the request to sort the column (for example: request="fsp_sort_6", etc...), and then the page refreshes with all three reports displayed. The report for which you actually 'clicked' a column header will be sorted. However the other two will display with an error (code ORA-06502) saying that the report cannot parse the query because of a null key index value in one of the corresponding tables being queried.
The weird thing is - this only happens on other computers - not when I'm on my workstation developing in my apex workspace/schema. I've even given each of the three reports a seperate static ID attribute so that I can identify each using those unique IDs.
I have to say - I am stumped. Any help would be much appreciated. If you need more details, feel free to respond to this thread.
Thanks!What version of APEX are you using? This was supposed to be fixed in 3.1 however it isn't because we still experience it sometimes, we just have never been able to re-create it in order to raise an SR. Getting to the bottom of this would be fantastic for us as it's the one thing which makes me extremely nervous of implementing new applications which are production-critical. The only workarounds are to flush the SGA or edit the report in production so the query is different (usually just fetch back null somewhere and then hide the column). This clearly isn't acceptable however without a reproducable test case there isn't much which can be done! :(
-
Standard Report & Image Column
Hi everybody,
I have a standard report for employees in this report there is an image column displaying the employee photo.
Of course if there is no image in the database for the employee the report won't display anything.
What I want is that if the image column is NULL the report will display a standard NO_PHOTO.JPG image for this employee.. is this possible??
My select statment is simple:
select
"EMP_ID",
"EMP_FIRST_NAME",
"EMP_SECOND_NAME",
"EMP_FAMILY_NAME",
dbms_lob.getlength("EMP_PHOTO") "EMP_PHOTO"
from "T_EMPLOYEE"One method is to use a Dynamic Action to insert the default image when there isn't one in the report. This avoids having to modify the report query or attributes.
h4. When
Event: After Refresh
Selection Type: Region
Region: <your report region>
h4. True Action
Action: Execute JavaScript Code
Fire On Page Load: Yes
Code:
$('#emp-report td[headers="PHOTO"]')
.contents()
.filter(function() {
return this.nodeType === 3; // report cell contents is a text node, not an img element
.replaceWith('<img src="&WORKSPACE_IMAGES.NO_PHOTO.jpg" alt="No photo">');Another is to put the logic in the query and get the image source programatically:
select
"EMP_ID",
"EMP_FIRST_NAME",
"EMP_SECOND_NAME",
"EMP_FAMILY_NAME",
'<img src="' || nvl2(photo, apex_util.get_blob_file_src('P2_PHOTO_FILE', employee_id), '&WORKSPACE_IMAGES.NO_PHOTO.jpg')
|| '" alt="' || nvl2(photo, "EMP_FIRST_NAME" || ' ' || "EMP_FAMILY_NAME", 'no photo') || '">' "EMP_PHOTO"
from "T_EMPLOYEE"Where <tt>P2_PHOTO_FILE</tt> is the file browser item used to upload the photos.
The Display As column attribute for the EMP_PHOTO column must be changed to Standard Report Column when using this method. -
Hi,
I've tried to set a standard report's column width in all available places in the column's attributes but it ignores me. I'm using Apex 3.1 and found a javascript workaround but am sure there must be an easyer way.
Can someone tell me where I have to set the width so it wraps text into the needed amount of lines? I searched for it because I was sure there'd be something but not found nothing (maybe not searching right :p )
Thank you,
MarcHi Chris,
Done what you said but the column still takes the width of it's content. Any idea why might that be?
The only solution I've found that works for now is this javascript process:
Standard Report Column
Marc -
How to refresh a report column value alone.
Hi All,
If we have a static report and for one of the columns of report, if I need to give a feature to click on it and a popup appears and there is a checkbox to select values on that popup page and finally after making changes and I press on apply changes, It should close the popup window and then come and change the value of that column alone in original report instead of refreshing the whole page.
The column of the report is of type "Standard Report Column".
How can I achieve this functionality?
Thanks & Regards,
Vikas
Edited by: Vikas Krishna on Sep 29, 2009 9:47 PMVikas,
I slightly modified on of my older examples and you will find everything here:
http://apex.oracle.com/pls/otn/f?p=31517:241
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------------------ -
Script to find report columns with XXS vulnerabilities
Hi,
Report columns with display as "Standard Report Column" are vulnerable to Cross Site Scripting attacks. I have written a simple script to find these report columns and described an easy way to change them all at once. Check: http://wiki.shellprompt.net/bin/view/Apex/XssExamples
Regards PeteHi Pete,
good that you bring up that security issue!
I was talking to Joel during ODTUG about the "Standard Report Column" default the wizard uses and he said that this might be changed in the next version to use the more secure "Display as Text (escape special characters, does not save state)"
Patrick
My APEX Blog: http://inside-apex.blogspot.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/ -
Conditional display of list box in form (depends on other report column)
Hello,
i have one question regarding conditional display in forms.
I have a tabular form where only one column ("flag") is updateable, all other columns are visible only.
I changed the column "flag" from "standard report column" to "Select list (static lov)", which has the values "yes" and "no".
This works fine. But in the running form i want to display the list box only if the column "status" = 'ERROR'.
The column "status" can have the values 'ERROR' and 'OK'.
When one record has "status" = 'OK', the column "flag" should not display the list box (only empty column row),
when one record has "status" = 'ERROR" the column "flag" should display the list box.
The idea behind is that if a record has "status" = 'ERROR' i have the possibility to confirm that "error" and update the column "flag" with "YES". This should only be possible for errors.
This is my main problem.
I tried with conditional display, but this hides or shows the column for the whole report/form, not on record level...
The second problem then is, that if the column "flag" is changed to "YES" in case of column "status" = 'ERROR', then it should not be possible to change it again to 'NO". At the beginning it is 'NO', but once changed to 'YES' it should not be changeable any more.
Is this possible?
Thank you in advance,
MatthiasHello Mike
your solution sounds good, but unfortunately it is not working.
None of my 2 columns are displayed, although i tried it as you wrote and the conditions should match...
But i am no sure if this can work. If so, the 2 columns must fuse to 1 column:
ID STATUS FLAG
1 ERROR yes/no => comes from column1
2 OK (null => comes from column2
so "FLAG" must display column1 and column2 in one column. is that possible?
regards,
Matthias -
Preserving leading spaces in a report column.
Hi
I have a report region derived from a sql query. One of the columns in the database can contain leading spaces. However, my report column is not displaying the leading spaces.
These are the things I've tried:
On the Column Attributes page, under Column Formatting, I have entered CSS Class = "code".
Also on the Column Attributes page, under Tabular Form Element, I have selected Display As = Text Field and I have entered Element Attributes = class="code" READONLY.
However, the report does not look nice. The column looks too different from the other columns (disabled text field vs standard report columns). Can anyone suggest a better fix for this problem?
Thanks.
JoHere's 3 ways to do it:
http://htmldb.oracle.com/pls/otn/f?p=25262:1
CSS WS - using the CSS white-space: pre property (here in the Column Formatting/CSS Style property, or it could be done with a class and an external style sheet); doesn't work in Win IE 6 :-(
HTML Exp - wrapped the column in a <pre> tag in the report SQL [doing this in the Column Formatting/HTML Expression property didn't work - it stripped the spaces. Anyone know if this expected?]. Also had to add a .t4data pre { display: inline; } style rule to the page to remove unwanted default formatting.
&nbsp; - replaced the spaces in the column in the report SQL with HTML non-breaking spaces: replace(..., ' ', '&nbsp;')
Given the Win IE restriction on the CSS approach, the last one looks like the simplest solution.
Maybe you are looking for
-
Does the 1st generation ipod Shuffle work with the new iTunes?
I was just trying to sync my old iPod shuffle with iTunes 11 and it won't work. Any help?
-
AIR 3.0 Socket, Standard packaging method = won't works on iOS device
Hello, I'm using FB 4.5.1. with AIR 3.0. My project uses Socket connection class, which works as expected in the simulator run, even when packaged and run in the iOS device (iPad or iPhone) with Fast package method. But whenever we're doing the packa
-
i cant change my security questions. i forgot them. if i press on send them with mail to me i am not recieving any mail not in spam too. goes same for my password i just dont recieve a mail at al.. please solve this and answer me fast as possible. th
-
To fetch selective fields from DATABASETABLE into Internal TABLE
Hi Friends, I have declared an internal table with fields for e.g. A , B , C , D. This does not have any records as of now. I have to fetch data from a DATABASE TABLE with fields A , B , X , Y , Z having records . I only need records for fields A B f
-
Call method after closing JFrame
Hi everyone, I'm opening a JFrame in another JFrame. Here is the code and beneath is the question. import javax.swing.*; import javax.swing.text.*; import java.awt.event.*; import java.awt.*; import java.util.*; public class ContactsInterface extends