Re: Dynamic setting of ITEM Properties - Forms 4.5

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 1997/11/12
Message-ID: <879354388.15599_at_dejanews.com>#1/1


In article <3462235F.52FA_at_boco.co.gov>,   tlberukoff_at_boco.co.gov wrote:
>
> I know someone out there has done this VERY WELL. I want to have the
> displayed items in my app to:
> 1) Change color when the cursor is in them (not the whole record, just a
> single item)
> 2) Change color when an error is associated with that item.
>
> I noticed that the SET_ITEM_PROPERTY built in doesn't have color
> options. What is the best way to do this and what are the best triggers
> to handle these types of dynamic changes in.
>
> Thanks in advance
>
> Tracey

Our forms do it. You use the display_item built in.

Create a CurrentItem visual attribute. (we use yellow) In a form-level when-new-item-instance trigger, set the trigger_item to the CurrentItem visual attribute. In a post-text-item trigger set the item back to its original attribute. We use the following code:

  DISPLAY_ITEM(:SYSTEM.TRIGGER_ITEM,Null);

To set an item to an error color (we use red), set up a visual attribute named ErrorItem, and use the Display_Item again to set your item. In some cases, (date mask and numeric mask errors) the forms resource file attribute, textcontrolfailvalidation sets the color, and display_item will have no effect.

The biggest drawback to using display item is that it wipes out Form's automatic setting of the current record color. So if you want to also have a current record visual, you have to create your own process to emulate that.

We also have problems in some areas with the wnii trigger firing after you set an item to the ErrorItem color, setting it back to the current item color. To prevent this, we set a parameter from the error process naming the item in error, and check the parameter in the wnii trigger. The wnii trigger either does a go_item to the error item, or sets it to red and nulls the parameter.

The QA utility available from my website uses the above techniques--you can try it out.

Regards,
Steve Cosner
http://members.aol.com/stevec5088

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Wed Nov 12 1997 - 00:00:00 CET

Original text of this message