NetTalk Central

NetTalk Web Server => Web Server - Share Knowledge => Topic started by: Rene Simons on October 29, 2008, 06:47:48 AM

Title: Showing description of lookup field on the netxt line (i.e. under de code field)
Post by: Rene Simons on October 29, 2008, 06:47:48 AM
Hi,

For some reason, it might be handy when the description of a code is displayed Under the code field in stead of behind the code field
Here is a way I figured out how to do things without too much hassle. Describing it was more difficult than doing it.

   1. I Define the lookup field (CODE:Field) like any other lookupfield.
   2. As display field I use a small dummy field (like a 1 char string), just to fool the template.
   3. On the client side tab I check the "send new value to server"-box.
   4. In the reset-list for the form I add the REAL:DisplayField. This field can be the original display
       field belonging to the CODE:Field
   5. In the servercode I do: p_web.ssv('REAL:DisplayField', getCodeDesc(Code:Field))
       where getCodeDesc is a function that gets the description for the code.
   6. Finally I add a condition to the REAL:DisplayField, to hide it when it's blank   
       (p_web.gsv('REAL:DisplayField') = ''  ), to prevent the description field from being shown when
        there is no description.
       To make sure that showing the description goes smoothly, you can also add a dummy field after
       the REAL:DisplayField that has a complementary condition.
   
Have fun
Rene