Calendar Activity instance using calendar cell background color
Hi ,
We have a requirement to show activity instance belong to a certain provider in calendar using the calendar cell background color, instead of the color of activity. Is this possible? If so, how to implement it?
I checked the calendar skin keys here:
http://jdevadf.oracle.com/adf-richclient-demo/faces/components/skinningKeys/calendar.jspx
but only find some keys related to activity like "af|calendar::month-time-activity", "af|calendar::all-day-activity" and "af|calendar::month-time-activity". These highlight the activity with color, but not the whole calendar cell.
I saw there is a skin key called "af|calendar::month-grid-cell" which set the background color of the calendar cells for the month. This is similar to what I am looking for, but I would like the cell's background color for the cells of the activity instance only, not all the cells in the month.
Any ideas?
Thanks
-Mina
Hi Mina,
There is a way to highlight cells corresponding to activity by using skinning, but you have to set the backgroud color property: af|calendar::month-time-activity{ background-color: Blue; }
Georgiana :)
Similar Messages
-
Cell background colors are not showing in preview - help? - DW4
Hi,
I created a horizontal table for my menu bar, and gave each cell a different color by creating a separate class for each with background image - image is a block of color created in Photoshop. In design mode they look they way I want, but in preview (Safari) the colors don't show up at all - the whole area is gray, and all I see is the text for each cell. Can someone tell me what I'm doing wrong? Alternatively, is there a better way I can set this up to have different colors for each button?
Thank you!Here is the HTML code, and the CSS code for the menu bar follows:
ul.MenuBarHorizontal
></style><style type="text/css"><!body { background-color: #FFF; font-family: Arial, Helvetica, sans-serif;}-->
h1.
ul.MenuBarVertical
[about | MS_about.html]
[fiction | MS_fiction.html]
[dramatic work | MS_dramaticwork.html]
[arts | MS_arts.html]
[contact | MS_contact.html]
[blog | MS_blog.html]
<!-- end #header ><div id="mainContent"><p> </p><table width="950" border="0" cellspacing="10" cellpadding="12"> <tr> <td width="106"><p> </p></td> <td width="766"><p> </p> <p>Miriam Seidel is a writer, critic and curator whose work is informed by her background in art, music and dance. </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p></td> </tr> <tr> <td colspan="2" bgcolor="#CCCCCC"><p>c Miriam Seidel 2011 all rights reserved</p></td> </tr> </table><script type="text/javascript"><!var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", );var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", );var MenuBar3 = new Spry.Widget.MenuBar("MenuBar3", );//></script></body> <! end #mainContent --></div></html>
CSS CODE:
@charset "UTF-8";
/* SpryMenuBarHorizontal.css - version 0.6 - Spry Pre-Release 1.6.1 */
/* The outermost container of the Menu Bar, an auto width box with no margin or padding /ul.MenuBarHorizontal/ Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html /ul.MenuBarActive{ z-index: 1000; font-family: Arial, Helvetica, sans-serif; font-size: medium; color: #FFF; background-color: #FFCC99; background-repeat: no-repeat; left: auto; top: auto; right: auto; bottom: auto;}/ Menu item containers, position children relative to this container and are a fixed width /ul.MenuBarHorizontal li/ Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) /ul.MenuBarHorizontal ul/ Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item /ul.MenuBarHorizontal ul.MenuBarSubmenuVisible/ Menu item containers are same fixed width as parent /ul.MenuBarHorizontal ul li/ Submenus should appear slightly overlapping to the right (95%) and up (-5%) /ul.MenuBarHorizontal ul ul/ Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
/* Submenu containers have borders on all sides /ul.MenuBarHorizontal ul/ Menu items are a light gray block with padding and no text decoration /ul.MenuBarHorizontal a/ Menu items that have mouse over or focus have a blue background and white text /ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus{ background-color: #6C9; color: #999; font-family: Arial, Helvetica, sans-serif; font-size: medium; font-style: normal; line-height: normal; font-weight: normal; font-variant: normal; text-decoration: none; text-align: center; vertical-align: middle; height: 50px; width: 115px;}/ Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible{ background-color: #FFCC99; color: #FFF; font-family: Arial, Helvetica, sans-serif; text-decoration: none; font-size: medium;}
SUBMENU INDICATION: styles if there is a submenu under a given menu item
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) /ul.MenuBarHorizontal a.MenuBarItemSubmenu{ background-image: url(SpryMenuBarDown.gif); background-repeat: no-repeat; background-position: 95% 50%; text-align: center;}/ Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) /ul.MenuBarHorizontal ul a.MenuBarItemSubmenu{ background-image: url(SpryMenuBarRight.gif); background-repeat: no-repeat; background-position: 95% 50%;}/ Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) /ul.MenuBarHorizontal a.MenuBarItemSubmenuHover{ background-image: url(SpryMenuBarDownHover.gif); background-repeat: no-repeat; background-position: 95% 50%;}/ Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover{ background-image: url(SpryMenuBarRightHover.gif); background-repeat: no-repeat; background-position: 95% 50%;}
BROWSER HACKS: the hacks below should not be changed unless you are an expert
/* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe /ul.MenuBarHorizontal iframe/ HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */@media screen, projection{ ul.MenuBarHorizontal li.MenuBarItemIE { display: inline; f\loat: left; background: #FFF;
Date: Mon, 20 Jun 2011 15:30:46 -0600
From: [email protected]
To: [email protected]
Subject: Re: cell background colors are not showing in preview - help? - DW4
NEED to see the code.
Otherwise it's like dialing a random phone number, and asking whoever answers, where you left your keys.
> -
Right way to change datagrid row, column, cells background colors in code-behind?
Hi all,
I have a winform program that I'm upgrading to wpf (I'm new to wpf). The wpf code for the function (SetdataGridBackgroundColors()) is below with the winform code commented out so I can fix it. I have a datagrid with a Cornsilk background color alteranating
with LightGreen depending on the content of datetime cell. If the day portion of the datetime is different then the color changes from one to the other. I used a colorIndex variable because at the end of the month it could go from 31 to 1 and that would
not work if I use the day directly.
I tried this line to change the background color:
optionsDataDatagrid.RowBackground = new SolidColorBrush(Colors.Cornsilk);
this works but it changes every row. I found this other stuff:
DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromIndex(i) as DataGridRow;
//DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromItem(optionsDataDatagrid.Items[i]) as DataGridRow;
currentRowColor.Background = new SolidColorBrush(Colors.Cornsilk);
Either ContainerFromIndex or ContainerFromItem throw an exception because currentRowColor is null. I looked at optionsDataDatagrid.Items[i] and is not null. Then I read that using ItemContainerGenerator is not a good idea.
BTW I'm calling SetdataGridBackgroundColors() after datagrid is been filled with data.
So... what is the proper way to set each row, column or cell background color in wpf?
Thanks
private void SetdataGridBackgroundColors()
optionRowData rowData = new optionRowData();
if (optionsDataDatagrid.Items.Count == 0)
return;
int colorIndex = 1;
DateTime savedDate, currentRowDate;
rowData = optionsDataDatagrid.Items[0] as optionRowData;
savedDate = rowData.col_datetime.Date; //only compare the date not the time
for (int i = 0; i < optionsDataDatagrid.Items.Count; i++)
//currentRowDate = Convert.ToDateTime(optionsDataDatagrid.Rows[i].Cells[3].Value); //winform code
//currentRowDate = currentRowDate.Date; //winform code
rowData = optionsDataDatagrid.Items[i] as optionRowData;
currentRowDate = rowData.col_datetime.Date;
if (currentRowDate != savedDate)
colorIndex++;
savedDate = currentRowDate;
if (colorIndex % 2 == 0)
//optionsDataDatagrid.Rows[i].DefaultCellStyle.BackColor = Color.Cornsilk;
//------------------- testing new code --------------begin
optionsDataDatagrid.RowBackground = new SolidColorBrush(Colors.Cornsilk); //this changes all rows
//DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromIndex(i) as DataGridRow;
//DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromItem(optionsDataDatagrid.Items[i]) as DataGridRow;
//currentRowColor.Background = new SolidColorBrush(Colors.Cornsilk);
//------------------- testing new code --------------end
//optionsDataDatagrid.Columns[4].DefaultCellStyle.BackColor = Color.DarkSalmon;
//optionsDataDatagrid.Columns[5].DefaultCellStyle.BackColor = Color.Aquamarine;
//optionsDataDatagrid.Rows[i].Cells[4].Style.ApplyStyle(optionsDataDataGridView.Columns[4].DefaultCellStyle);
//optionsDataDatagrid.Rows[i].Cells[5].Style.ApplyStyle(optionsDataDataGridView.Columns[5].DefaultCellStyle);
else
//optionsDataDatagrid.Rows[i].DefaultCellStyle.BackColor = Color.LightGreen;
//------------------- testing new code --------------begin
optionsDataDatagrid.RowBackground = new SolidColorBrush(Colors.LightGreen); //this has no effect
//------------------- testing new code --------------end
//optionsDataDatagrid.Columns[4].DefaultCellStyle.BackColor = Color.Coral;
//optionsDataDatagrid.Columns[5].DefaultCellStyle.BackColor = Color.LimeGreen;
//optionsDataDatagrid.Rows[i].Cells[4].Style.ApplyStyle(optionsDataDataGridView.Columns[4].DefaultCellStyle);
//optionsDataDatagrid.Rows[i].Cells[5].Style.ApplyStyle(optionsDataDataGridView.Columns[5].DefaultCellStyle);I (also) strongly recommend mvvm.
Setting values is a particularly bad idea in this case.
I don't mean to be rude but your explanation of the requirement is kind of vague.
I would bind solidcolourbrushes.
Set the properties based on whatever your logic is within the viewmodel.
You can switch out what each of the brushes holds when the user clicks wherever.
So you use a highlightbrush when something or other is true.
That highlightbrush is set to a blue brush when the user clicks left and a red brush when they click right.
Please don't forget to upvote posts which you like and mark those which answer your question.
My latest Technet article - Dynamic XAML -
Is it possible to apply conditional formatting to a cell (or range) based upon a LOOKUP query to cell values in another sheet.?
I want to alter the formatting (i.e., text and/or cell background color), but not the content, of the target cell(s).Hi Tom,
Your LOOKUP formula will return a value that it finds in the "other" table. That value can be used in conditional highlighting rules. (Numbers 3 calls it conditional highlighting, not conditional formatting. Just to keep us awake, I guess, but it works the same).
Please explain what you are trying to do.
Regards,
Ian. -
Hi All,
I want to change the background color of the same of the cells in jTabel. How can I do that.
Like, I want to keep 3 cells in red color. Another 2 cells in in green color, And keep other cell background color to default.
Also I want to change the background color of the cell, with different selection in other component(like jTree, jList).
Thank you,
Avin PatelThe same cell renderer is used by all cells of the table. You can't just set the background color of a cell once. You have to reset it every time the cell renderer is called (depending on which row/column you are being asked to render). Here is an example:
import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
public class TableCell extends JFrame
JTable table;
public TableCell()
Object[][] data = { {"1", "A"}, {"2", "B"}, {"3", "C"}, {"4", "D"} };
String[] columnNames = {"Number","Letter"};
DefaultTableModel model = new DefaultTableModel(data, columnNames);
table = new JTable( model );
// Set default cell renderer
TableCellRenderer renderer = new TestRenderer();
table.setDefaultRenderer(Object.class, renderer);
JScrollPane scrollPane = new JScrollPane( table );
getContentPane().add( scrollPane );
public static void main(String[] args)
TableCell frame = new TableCell();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.pack();
frame.setVisible(true);
class TestRenderer extends DefaultTableCellRenderer
public Component getTableCellRendererComponent(
JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
super.getTableCellRendererComponent(table,
value, isSelected, hasFocus, row, column);
if (column == 0)
setHorizontalAlignment( LEFT );
setBackground( Color.blue );
else
setHorizontalAlignment( RIGHT );
setBackground( Color.green );
if (row == 1)
setBackground( Color.red );
return this;
} -
Set cell background color conditionally?
I want to set a cells' background colors conditionally, e.g., if the computer value is between 5 to 9, make the background red. Is there any way to do that?
That is a good question. It would appear it does not work. A way around it is to put 1:00 (1 hour duration, not 1 o'clock) in a cell and a 1:30 in another then reference those cells as your two conditions.
This is not the only place where the duration format is not fully implemented. -
How to change a selected cell background color in JTable?
Hi all,
I am trying to change the background color of a selected cell by clicking on that particular cell. DefaultTableCellRenderer class provides setBackground(Color c) to change the background color of unselected cells. Is there a way to change a selected cell background color?
Thank you,
ArthurWrite your own renderer (eg. extending DefaultTableRenderer) and put in getTableCellRendererComponent method something like this:
if( isSelected && hasFocus )
setBackground( Color.RED );
setForeground( Color.GREEN );
} -
Is it possible to change cell Background color?
I want to change table cell background color.
Can anyone help me with code example?Hi,
tanusree wrote:
I want to change table cell background color.
Can anyone help me with code example?You can find code example in the java tutorial.
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
exacting
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#renderer
greetings
Axel -
ADF calendar date cell background color change
Hi,
I am new to jdeveloper / ADF.
I coded per the below calender sample in my jdeveloper and it runs fine.
http://www.oracle.com/technetwork/developer-tools/jdev/calendar-091799.html
The current date cell shows in yellow color background. How/where can I change that color.
Also the small calendar look up for the start/end date-time setting allows the user set the start/end time upto HH/MIN/seconds. How can I remove the seconds
Thanks for all your help.You can create a new skin for your application and use the following selector which we deliver..
.AFCalendarTodayBackground:alias
background-color: blue;
ALternatively, you can use the specific selector
af|calendar af|calendar::day-of-week:today {
background-color: blue;
You can also see other ways of customizing your look and feel of the calendar component by referencing the hosted demo for skinning the calendar component.
http://jdevadf.oracle.com/adf-richclient-demo/faces/components/skinningKeys/calendar.jspx -
Template Cell Background Color
Hi,
I'm creating Dreamweaver templates with the pages built from them being edited in Contribute. There is a need for the Contribute users to be able to change the background color of individual cells in a table (on a page built from a DWT). I can't figure out how to make this happen. The rows are repeating regions. If I make an editable attribute then it applies to every row. I can't use ID's because with repeating regions they are not unique. If the user right-clicks a cell (a cell that is an editable region of course) and chooses a style, that style is applied to the contents of the cell via a span and not to the cell itself. Any ideas?
Thanks,
DougNancy O.
Not looking for alternating colours. Here is an example of what I want:
Header 1
Header 2
Header 3
blah
blah
bgcolor here is white
blah
blah
bgcolor here is red
blah
blah
bgcolor here is yellow
blah
blah
bgcolor here is green
Keeping in mind that the table would have started out as one repeatable row and the Contribute user would add the rest. -
Table cell background color in PDF
I have a requirement to generate a PDF from a stoplight report.
The stoplight report colors were implemented by setting the background color in table cells
via css (background-color: red;). Its working in the browser but when I generate a pdf the cells show up with grey backgrounds. How can I generate a pdf with the correct colors?
Thanks for your help.
I'm using Apex 3.1 and pdf generation functionality that comes with Apex. I don't have BI Publisher.Hi David.
At this time you don't get WYSIWYG reports in PDF.
You're limited to the Column Colour settings you can specify in the Print Attributes of the report region but these would apply to all columns in the report and would not be dynamic.
This may be something that is addressed in a future version of APEX.
If anyone else knows different, feel free to chip in.
Regards
Simon -
How to allow internet pages to use their own background colors ?
On my old Win7Pro system (Firefox stepwise updated from early version 2 to version 18.0) this works perfectly: for example my own homepage http://www.du-ch.net/ shows its light blue background color. However, on my new Win8Pro laptop with Firefox 18.0 directly installed, the background is always white (system windows color).
NOTE: There is of course a menu option (—settings—menu—color) where changes SHOULD be possible. However, crossing or uncrossing the checkboxes does not change anything in the system behaviour: the Win8 and the Win7 systems show different background colors independently on any checks in the 2 boxes (of course with the same settings, too). Obviously a bug [to be corrected by the developers], but meanwhile does anybody know what to change in the settings file (I will of course be careful !) ?Thanks, indeed returning to another predefined design resolved the problem. Note that before, I used a personal, modified design, but obviously there was still a "high-contrast" [disturbing] function active, which overread the "allow internet pages colours" setting in Firefox and IE [but not in Opera and Chrome]. The Win8 high contrast themes anyway lead to highly unsatisfactory results in many applications, such as black text on darl grey background, or light grey text on white background.
-
Cell background color in JTable
Hi all,
I have a JTable that has numbers in its cells. Now, based on user input, I would like to be able to search the numbers in the JTable's cells and change the background color of the cells that have same number as the one user has provided.
My program now searches through the table and can find the cells containing that particular number.
Is there any way (without having to go through defining a cell renderer), somehow change the background color of the cells my program finds, simply by using setBackgroundColor()?
Thanks,
Payam.I don't see a method called setBackgroundColor anywhere in the API, so I don't know what that is. But what do you have against cell renderers? That's what you should be using to answer your question, that's what they were designed for.
-
FORMS 6i and cells background color
Hello,
I ve got a tabular forms based on a table.
Is it possible to change the background color of ONE or MORE cells ?
Thanks.
Romeo.I am with Mediware Information Systems and we have an opening for a Senior Oracle 6i DBA if you know of anyone who has 5 yrs. of Oracle 6i DBA experience. If so, they can send their resume to [email protected] with the subject line 06-029.
Thanks! -
JTable cell Background Color problem
I overriden the table renderer and tried to chenge the color of only that row which has greater value in the third column. I coded the logic but it set the color of all the rows. The custom tablecellrendere code is as follows
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,boolean hasFocus, int row, int column)
cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if(vuti[0]==0)
//cell.setBackground(Color.pink);
vuti[0]=counter;
else
if (counter>vuti[0] && !isSelected)
vuti[0]=counter;
cell.setBackground(Color.lightGray);
else if(counter<vuti[0])
cell.setBackground(Color.white);
return cell;
}In the code that sets the background, you have a if - else (if - else if) structure. What's the default setting, when none of the 3 conditions are met?
And learn to indent your code correctly so that code blocks are readily apparent.
[http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html]
db
Maybe you are looking for
-
Can I fix a disk with this message? Disk Utility can't repair this disk. Back up as many of your files as possible, reformat the disk, and restore your backed-up files.
-
Airplay won't show video of movie downloaded from itunes, only sound
i just got a new ipad mini. upgraded the OS. downloaded movie from itunes. video won't play on the tv, just the sound plays on the tv. my other ipad is not having this problem. The IOS of the ipad has not been updated. The appletv did just do any u
-
G5 as a Server for Online Gaming?
I am curious as to if a G5 can be used for a Server for Online Gaming prior to my going out and purchasing one. I am new to Apple computers and would like to know if i bought the Full Upgraded version.. would the game work and be able to handle the a
-
IPad and iTunes Freak Out!
Bought a new iMac in November and finally got around to backing up my iPad to it. All software is up to date on both, but when I plug my iPad into the computer it starts freaking out. On the iPad, a message pops up about trusing or not trusting the c
-
A Free Phone that I am paying $350 for - What kind of business practice is that? Customer Service manager that promises problem is fixed and then new manager refuses to honor agreement? Oh and by the way your 30 day change period has lapsed. Hours on