Table - highlight row based on Action.Handler.handleAction

Hello,
I want to highlight a Table row ( or rows ) based on the user selecting “highlight row” from dropdown using the Action.Handler interface. So it is very dynamic, totally controlled by the user. My problem is that when they click the line, valueChange is initiated, which in my case goes into a form ( it also highlights the line in blue, but the user cannot see that because table hidden by form ). I have to go to form, that is what users are used to when they click the line. But now they want to highlight it so they can scroll right and left to see different values without going to form. Any ideas would be appreciated.

Thanks.
Tony

Any ideas on how to do this?

Ok, it is kind of cludgy, and not generic, but I got it to sort of work. Now what would be ideal is some way to add a css directly to the row instead of the way I am doing it, since the way I am doing it cannot be applied more broadly ( not every table in my application has a statusDesc data element I can use easily ). Is there anyway to get to the CSS of a given row inside the ActionHandler?

Code that works for one of my cases, but is not ideal because it has to change data elements inside bean.

	private class PlansActionHandler implements Handler {
		private final Action highlightLine = new Action("Highlight Line");

		@Override
		public void handleAction(final Action action, final Object sender,
				final Object target) {
			String statusDesc = null;
			String status = null;
			Property<String> statusDescProp = null;
			
			Item item = ((Table) sender).getItem(target);
			if (item != null) {
				statusDescProp = item.getItemProperty("statusDesc");
				statusDesc = statusDescProp.getValue();
				status = (String) item.getItemProperty("status").getValue();
			}
			
			if(action == highlightLine) {
				boolean selectLine = true;
				if( statusDesc instanceof String &&
						statusDesc.equals("highlight") )
				{
					selectLine = false;
				}
				
				if( selectLine && statusDescProp instanceof Property )
				{
					statusDescProp.setValue("highlight");
				}
				else if( statusDescProp instanceof Property )
				{
					PlanStatus planStatus = null;
					
					if( status instanceof String )
					{
						planStatus = PlanStatus.valueOf( status );
					}
					
					if( planStatus instanceof PlanStatus)
						statusDescProp.setValue(planStatus.getName());
					else
						statusDescProp.setValue("");
				}
				
				table.refreshRowCache();
			}
		}

		@Override
		public Action[] getActions(final Object target, final Object sender) {
			return new Action[] { highlightLine };
		}
	}

Then I used this CellStyle generator:

		table.setCellStyleGenerator((source, itemId, propertyId) -> {
			if( propertyId == null && itemId != null )
			{
				Item item = source.getItem(itemId);
				if (item != null) {
					String statusDesc = (String) item.getItemProperty("statusDesc").getValue();

					if( statusDesc instanceof String && statusDesc.equals("highlight"))
						return "highlight";
				}
			}
			
			return null;
		});

The corresponding CSS is here:

  .v-table-row-highlight {
  	background-color: #197de1;
	background-image: -webkit-linear-gradient(top, #1b87e3 2%, #166ed5 98%);
	background-image: linear-gradient(to bottom,#1b87e3 2%, #166ed5 98%);
	background-origin: border-box;
	color: #ecf2f8;
	text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05);
  }

Never got a solution, so did something totally different: check box at top. If checked, highlight lines and do NOT go into edit form. If not checked, got into edit form. Default is not checked.