Highligting Current Record

Questions and answers for designing and implementing forms in Servoy

Highligting Current Record

Postby ahmad » Mon Jan 05, 2004 12:27 pm

Is there a way we can hightlight the current record when it's selected? (see attached pic)

It would be a nice to have such a property for the forms (in list view). Currently servoy highlights the current record in the table view. But it would be nice to have similar and also ability to use any color in the list view

Any suggestions

Thanks
Ahmad
Hong Kong
Attachments
RecordSelection.JPG
RecordSelection.JPG (52.68 KiB) Viewed 24054 times
ahmad
 
Posts: 139
Joined: Wed Dec 24, 2003 12:01 pm
Location: Hong Kong

Postby Jan Blok » Mon Jan 05, 2004 5:56 pm

A listview shows the current record selection if the vertical lines property is enabled, and current editing record is highlighted in tableview when selected.
Highlighting is handeled by the (OS) Look And Feel... is not in our control
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby pbakker » Sat Jan 31, 2004 12:24 pm

Cannot seem to find the "vertical lines property" for listview... Should there be one???

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Jan Blok » Sat Jan 31, 2004 6:32 pm

sorry, mend portal
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby pbakker » Sat Jan 31, 2004 6:42 pm

:D OK, thought I was going nuts trying to find it...

About listview highlightings: any option there instead of the little black thing on the left side of the selected records?

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Jan Blok » Mon Feb 02, 2004 5:15 pm

What we could do is make the listview/tableview/portal look for a calculation called "servoy_row_bgcolor" and if present is called with recordIndex and selected flag.
In which case you could make the servoy_row_bgcolor calc like:
Code: Select all
var recordIndex = arguments[0]
var selected = arguments[1];
if (selected)
{
   return '#CCCCEE';
}
else
{
   if (recordIndex % 2 == 0)//alternate on even oneven
   {
      return '#0000FF';
   }
   else
   {
      return '#FF0000';
   }
}

Let me know your ideas.
Last edited by Jan Blok on Mon Feb 02, 2004 5:41 pm, edited 1 time in total.
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby IT2Be » Mon Feb 02, 2004 5:28 pm

I like this idea!
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby pbakker » Mon Feb 02, 2004 6:01 pm

I have a bit of trouble grasping the concept, but it looks like this is providing my needs exactly!

Tnx,

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby mattman » Tue Feb 03, 2004 8:27 am

Jan Blok wrote:What we could do is make the listview/tableview/portal look for a calculation called "servoy_row_bgcolor" and if present is called with recordIndex and selected flag.
In which case you could make the servoy_row_bgcolor calc like:
Code: Select all
var recordIndex = arguments[0]
var selected = arguments[1];
if (selected)
{
   return '#CCCCEE';
}
else
{
   if (recordIndex % 2 == 0)//alternate on even oneven
   {
      return '#0000FF';
   }
   else
   {
      return '#FF0000';
   }
}

Let me know your ideas.


Yes, please, anything that makes Servoy NOT look like FileMaker with the stupid little black box at left as the record indicator. I like the flexibility of being able to specify every other, every three or every n records.

Although it would be preferable if the highlight was just a propery of a form in list view. Being able to set the alternating would be nice as a property as well. Imagine the following...

bodyPartHighlight('#CCCCEE')
bodyPartColor(2,'#FF0000'|'#0000FF')
Matt Petrowsky
mattman
 
Posts: 160
Joined: Wed Aug 06, 2003 8:23 am
Location: Murrieta, CA

Postby ahmad » Tue Feb 03, 2004 8:40 am

Hi can any one explain this technique step by step?

How to pass the arguements??

Do we need to place any object in the list body or

do we need to place the calc field servoy_row_bgcolor throughout the list body??

I like the idea of matt to make this function as a propery of a form in list view and also in portal

Thanks
Ahmad
ahmad
 
Posts: 139
Joined: Wed Dec 24, 2003 12:01 pm
Location: Hong Kong

Postby Harjo » Tue Feb 03, 2004 9:59 am

I agree with Matt!
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Jan Blok » Tue Feb 03, 2004 11:01 am

Property whould be possible but, if you want to mark a specific records because it holds very important information you could do so with my proposed method and not with a form property...
Code: Select all
var index = arguments[0]
var selected = arguments[1];
if (myimportantData == 1)
{
   return '#FF0000' //mark red, is overruling the selected also!
}
else
{
   if (selected)
   {
      return '#CCCCEE';
   }
   else
   {
      if (index % 2 == 0)//alternate on even oneven
      {
         return '#0000FF';
      }
      else
      {
         return '#00FF00';
      }
   }
}

Let us know your thoughts.
Last edited by Jan Blok on Thu Feb 05, 2004 1:33 pm, edited 1 time in total.
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby grahamg » Tue Feb 03, 2004 1:12 pm

My vote is to go with Jan's programmed method.

The possibility of highlighting specific records in the list would be a great feature.

_______________
Graham Greensall
Worxinfo Ltd
grahamg
 
Posts: 752
Joined: Fri Oct 03, 2003 3:15 pm
Location: Midlands UK

Postby Harjo » Tue Feb 03, 2004 1:16 pm

Jan, can you make both possible? :lol:
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Jan Blok » Tue Feb 03, 2004 1:50 pm

HJK wrote:Jan, can you make both possible? :lol:

Well yes, both is possible, but we prefer to build one and save some resources for other things which are on the planning.
Since the calculation suggestion is the most powerfull, we prefer that one.
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Next

Return to Forms

Who is online

Users browsing this forum: No registered users and 2 guests