HELP!!!!!How To Make Drop Down Data Window Selection NULL

HELP!!!!!How To Make Drop Down Data Window Selection NULL

Post by Buddy McAliste » Tue, 23 Jan 1996 04:00:00



I have a field that is a drop down data window.  When the window initially
comes up there is no selection and the field is null(There is no entry in the
DB table for the NULL record).  I would like to put a button on the window that
allows me to reset the field back to the state it was when the window came up
(i.e. no selection visable and field is blank).

Does any one have any ideas on how this can be done ?
--
Buddy Mcalister, Sr. Consultant Engineer
Arthur D. Little, Inc
5300 International Blvd N. Charleston, S.C. 29419

 
 
 

HELP!!!!!How To Make Drop Down Data Window Selection NULL

Post by dacd.. » Thu, 25 Jan 1996 04:00:00



>I have a field that is a drop down data window.  When the window initially
>comes up there is no selection and the field is null(There is no entry in the
>DB table for the NULL record).  I would like to put a button on the window that
>allows me to reset the field back to the state it was when the window came up
>(i.e. no selection visable and field is blank).

>Does any one have any ideas on how this can be done ?
>--
>Buddy Mcalister, Sr. Consultant Engineer
>Arthur D. Little, Inc
>5300 International Blvd N. Charleston, S.C. 29419


Datawindowchild dwc
dw_1.GetChild ("dddwname",dwc)
dwc.InsertRow(1)

Inserts a blank row at row 1....

Peter Bech Lund,
Developer at DAC-DATA, Denmark



 
 
 

HELP!!!!!How To Make Drop Down Data Window Selection NULL

Post by Allen Hadde » Fri, 26 Jan 1996 04:00:00



>I have a field that is a drop down data window.  When the window initially
>comes up there is no selection and the field is null(There is no entry in the
>DB table for the NULL record).  I would like to put a button on the window that
>allows me to reset the field back to the state it was when the window came up
>(i.e. no selection visable and field is blank).

>Does any one have any ideas on how this can be done ?
>--

Insert an extra row into the DDDW (after the initial retrieve), don't set the "value" column of
the drop-down (that is, leave it NULL).

DATAWINDOWCHILD ldwc_temp
LONG ll_row

IF dw_1.GetChild( "dddw_column_name", ldwc_temp ) > 0 THEN

   // Insert a row at position 1
   ll_row = ldwc_temp.InsertRow( 1 )

   IF ll_row > 0 THEN
      // Set the non-null columns

      // This assumes that you have a description column in the dddw.
      ldwc_temp.SetItem( ll_row, "description", "(None)" )
   END IF  
END IF

Now, the user can select the "Null" row in the drop-down.

-Allen

Allen Hadden
Systems Engineer
Taratec Development Corporation

 
 
 

HELP!!!!!How To Make Drop Down Data Window Selection NULL

Post by Greg Pettengil » Fri, 26 Jan 1996 04:00:00



> I have a field that is a drop down data window.  When the window initially
> comes up there is no selection and the field is null(There is no entry in the
> DB table for the NULL record).  I would like to put a button on the window that
> allows me to reset the field back to the state it was when the window came up
> (i.e. no selection visable and field is blank).

> Does any one have any ideas on how this can be done ?
> --
> Buddy Mcalister, Sr. Consultant Engineer
> Arthur D. Little, Inc
> 5300 International Blvd N. Charleston, S.C. 29419


If I understand you correctly, you wish to be able reset the value back to a 'blank' state
I assume that you may use this 'NULL' value in an 'Update()' statement.  What I have done
in the past is get the hadle to the dddw by using the GetChild function.  Then I code the
function dwc_child.InsertRow (1) which will insert a blank row before the first row in the
result set.  I have used this technique to allow a user to 'reset' a non-editable dddw back
to its 'NULL' state.  This could easily be coded on the clicked event of a commandbutton.

Greg Pettengill

 
 
 

HELP!!!!!How To Make Drop Down Data Window Selection NULL

Post by Geert Lefever » Sun, 28 Jan 1996 04:00:00


Hi,

Supposing your column is a string, try the following:

cb_::clicked
        dw_.PostEvent ('ue_reset')

dw_::ue_reset
        string ls_Null;  SetNull (ls_Null)
        This.SetItemString (This.GetRow (), ls_Null)

Bye !

Johan Deryckere
LGTsoft (Belgium)

 
 
 

HELP!!!!!How To Make Drop Down Data Window Selection NULL

Post by Rik Broo » Sun, 28 Jan 1996 04:00:00


Allen,

        The problem with your way is the the user is going to insert the
word (Null) in their database if they choose null... not the NULL
value.  In order to insert the NULL you have to delete the data
column from the datawindow referenced by the drop down datawindow.  
Replace this with a calculated column that has the following
evaluation:

if(not isNull(origVal), origVal, '(Null)')

        Now go back to the datawindow that holds the dddw.  Set the edit
style and change the display row to your calc'ed column and leave the
datarow the original column.
        What this does is allows your drop down to display the word null
even though the value there is an actual Null.

Rik Brooks
Owner BYTE, Inc.

http://www.halcyon.com/chigh/crh_rb/rb_main.htm

 
 
 

HELP!!!!!How To Make Drop Down Data Window Selection NULL

Post by Allen Hadde » Tue, 30 Jan 1996 04:00:00



> Allen,

>         The problem with your way is the the user is going to insert the
> word (Null) in their database if they choose null... not the NULL
> value.  In order to insert the NULL you have to delete the data
> column from the datawindow referenced by the drop down datawindow.
> Replace this with a calculated column that has the following
> evaluation:

> if(not isNull(origVal), origVal, '(Null)')

>         Now go back to the datawindow that holds the dddw.  Set the edit
> style and change the display row to your calc'ed column and leave the
> datarow the original column.
>         What this does is allows your drop down to display the word null
> even though the value there is an actual Null.

Actually, I made an assumption (possibly incorrect) that there were two
datawindow columns, one for the value and one for a "description".  The
value column would contain the null value and the description would contain
the string "(None)".

I agree that your solution is better if there is only one column.

Allen

Allen Hadden
Systems Engineer
Taratec Development Corporation

 
 
 

1. Help : Refreshing the Data Window within a Drop Down List Box

I have a self-referencing table (i.e. ER fish-hok or this kind of
relationship:

(Field) Department ID : ID Type
(Field) Reports to : ID Type

The "Reports to" field will be either null (reports to no-one) or with
a valid Department ID (within the same table). Recursion 101 :-)

Anyway, when I insert into this table, the row goes in fine but the
Drop Down List Box i'm using for the "Reports To" field doesn't show
the new row. Even when I cause the parent (i.e. the datawindow the
DDLB is in) to retrieve, it still won't put the new entry in the DDLB.
Only when I close the window and open it again will the DDLB have the
new row. This makes some sense if a retrieve of the DataWindow the
DDLB is in does not cause the DataWindow of the DDLB itself to
refresh, but I need to in this case.

How can I tell the Data Window DDLB to re-read it's table?

Puzzled..

Kevin Stussman

2. _export : Porting from VC1.5 to 4.0

3. Help - Can't get Drop Down Data Window (DDDW) to work w/Sybase

4. how to display the registered, copyright sign

5. Drop Down Data Window Edit Style Help

6. interrupt

7. Why do Drop Down List Boxes drop down off screen?

8. drop down data window

9. Drop Down Data Window partial retrieve?

10. Drop Down Data Window Arrows

11. Drop down data windows