How to change the table row background color while the conditions fails? - wicket

I am merging three coloumns and showing the merged values in the 4th column, am appliying some rules for merge operation. In some case that rules will bring up null value and display it in any row in the 4th column, i want to highlight the null row alone in RED color.
Like listed below.
Value1
Value2
NULL(Red color)
Value 4
please help me on this, Am working in wicket framework.

You can use AttributeModifier.replace("class", IModel<?>). Put a string in the model of the css tag you have to make it red. For example td.redbox {backgroundcolor:red} with AttributeModifier.replace("class", Model.of("redbox"));.
ps.
You need to supply more code next time. If you ask a unclear question, you'll get an unclear answer.

Related

Modify an ag-grid row after rendering

I need to slightly modify a ag-grid row after it has been rendered. In ag-grid, the actual HTML elements are not necessarily persistent, so manually-set styles may fall off.
For one thing, I have to modify the selection checkbox to set its tabindex to -1. This can technically be done in the cellRenderer callback, although it looks quite hacky. (The checkbox can be found at params.eGridCell.children[0].children[0].wrappedElement.)
But I also have to add a CSS class to some rows to highlight them based on external criteria. I haven't found a way to do this at all.
The best solution would seem to be using some sort of after-rendering callback, but to my knowledge no such thing exists.
I found a couple of related questions, but they were both resolved via cellStyle, which would not suffice here:
Row formatting in ag-Grid
How to provide a background color for an entire row in ag grid based on a certain value in a column?
You have not 1 but 3 options:
getRowClass(params):
Callback version of property 'rowClass'. Function should return a string or an array of strings.
getRowStyle(params):
Callback version of property 'rowStyle'. Function should return an object of CSS values.
processRowPostCreate(params):
Allows you to process rows after they are created. So do final adding of custom attributes etc.
In this last one you have the row in params.eRow.
All taken from https://www.ag-grid.com/javascript-grid-callbacks/index.php

How to design textbox visibility expression in SSRS?

I have an RDL with a table/textbox visibility set to:
=iif(Fields!question_caption.Value = "OBJECTIVE 1",false,true)
I am trying to make this textbox display the value named "narrative" only if the question_caption record = "OBJECTIVE 1". How can I do this? Currently this textbox displays nothing with the above logic. I have the narrative field stored in a Placeholder if that makes any difference.
Here is some sample data for you:
create table #dummy_data
(
question_caption varchar(max),
narrative varchar(max)
)
insert #dummy_data values('1st week dates','week 1'),('2nd week dates','week 2'),('3rd week dates','week 3'),('OBJECTIVE 1','obj 1'),
('5th week dates','week 5')
select * from #dummy_data
I don't see anything wrong with your visibility expression. However, in your question, you're discussing two separate things as one (i.e., visibility & displaying a value in a placeholder).
The hidden property will show an object (tablix, textbox, image, chart, container, etc) if the expression returns false and will hide an object when the expression returns true. When I say hide, I mean that it will remove the object from the grid and, if all is setup properly, the surrounding objects will be shifted to fill the now empty space of the hidden object.
To display (or not) a value is an entirely different thing. To show or hide a value, you would put the following expression in the value property of the placeholder:
=IIF(Fields!question_caption.Value = "OBJECTIVE 1",Fields!narrative.Value,"")
Notice that I've set it up such that if the desired value of the question_caption field is present, it will display the value of the narrative field. Otherwise, it will return an empty string. This will maintain the layout of the report but simply display the desired value or an empty string, based on some criteria.
As for the issues you're current experiencing, I'm not sure why that would be happening. I would first check that you don't have a typo in the Objective 1 hardcoded value in your expression.
If this doesn't help, please comment and let me know some more information about your problem and I'll do my best to help.

How to highlight first node of GtkTreeView

I would like to highlight the first node of a GtkTreeView and give that node the focus. gtk_tree_view_row_activated () seems appropriate for what I am trying to do, but I couldn't figure out the arguments it takes.
Thanks in advance.
gtk_tree_view_row_activated() actually acts on just one cell. I wonder if you really want to Highlight the row or just select it. I.e. if you want to leave the highlight even if the cursor is on another line.
If that's the case, note that you can define extra fields in the underlying model, for example, if you have 3 fields for your data, you can add field 4 with a color. Then you can tell the renderer to use the color in field 4 (instead of giving the renderer the color immediately).
This example not only changes the background, but also the text color:
http://faq.pygtk.org/index.py?req=show&file=faq13.031.htp
For more sophisticated work, you can even modify the atributes on a cell-per-cell basis:
http://www.pygtk.org/docs/pygtk/class-gtktreeviewcolumn.html#method-gtktreeviewcolumn--set-cell-data-func
Use set_cursor method:
TextView.set_cursor(0,None,False)
0 = Index of the first row

GXT 3 spinnerField validation

I want to validate that user cannot change spinner value manually by typing in text box of spinner.
For example a field sales multiple = x which I fetched from server not fix.
and displays a spinner field with limitation of like bellow
spinner.setMinValue = x
spinner.setIncrement = x
spinner.setValue = x
so user forcefully select a value which is multiple with x. e.g. if x=3 the user have to enter 3,6,9... and so on.
So here my issue is if I type a 2 in spinner field text box. GXT widget accept that value.
Posible solutions:
Is there any predefined properties of spinnerfield that i forget to set it?
Is there any predefined validator for this?
Can I set text box of spinner field read only by css so user cannot focus on text box but still change a value.
If none of above how to achieve manually?
i've searched a bit in the different classes and I don't see either a precise method which would set what you want.
Don't know about one, and even with one, a validator doesn't change the value in the input field, but maybe it's enough for your needs.
You can disable the text input by calling setEditable(boolean) on the spinnerfield (testSpinner.setEditable(false);)
Maybe you could search around the IntegerPropertyEditor, I haven't tried but as long as a new Spinner is like this:
SpinnerField<Integer> testSpinner = new SpinnerField<Integer>(new NumberPropertyEditor.IntegerPropertyEditor());
you can seen that there is another Constructor for IntegerPropertyEditor, which takes a "NumberFormat" param, but there is no NumberFormart() constructor, so I'm not sure about how you create your own one, but that could be an idea (to format numbers in the input to be a multiple of the increment).
The last option would be that Sencha forgot this possibility and that you should report this as a "bug" on the forum ?
Hope to have helped a bit, good luck :).

Crystal Reports show field grey when date is null

Our user wants a date field to display as highlighted or with a grey background when the date is null. How would I do something like this? (At the very least, I suspect I'll first have to convert it to a string.)
Completed Date
12/15/2010
03/07/2011
<-- make that a grey block
05/01/2010
I hope that you don't think this too hacky but you can do what you want by adding a Formula field and calling it something like NullCheck. Then put the code below in the NullCheck formula field so that it places an X whenever the date field is null.
If IsNull({DeleteMe.DateField}) Then
"X"
Next put that field (NullCheck) on your page so that the box covers the date field exactly. Then use the Highlighting Expert to set the background and the font to the same color when the X appears in the field (see image below).
When done it should "highlight" all null dates fields as shown.