cancel
Showing results for 
Search instead for 
Did you mean: 

DDDW ?

Former Member
0 Kudos

In my evaluation of PowerBuilder for an upcoming project I am running into an issue.

I will have a form that has many combo boxes (DDDW)...

A snippet of the base table would be

STRING_ID (Integer) , STRING_OTHER (varchar(64))

There is a database table that holds the strings in it

STRING_ID , STRING, LANG_ID

So the DDDW will use this table to show the actual strings in the dropdowns for the user to select from.

My issue is that most of these fields will need to have the option for the user to select "OTHER" and than freeform in their string. So when this occurs the form needs to show this freeform string.

For example the SQL that creates the DDDW results

10        Word 1

20        Word 2

30        Word 3

1000     Other

The drop down would display correctly Word1,Word2,Word3,Other  But when the user actually selects Other the form need to display the freeform text the user entered. This freeform text gets stored in the base table as.     1000 , 'This is what I typed'   

if a non other  item is selected  it would be stored as 10,''

So far the only thing I can think of is to have my form actually have both STRING_ID and STRING_OTHER on it and in code dynamically position and size the appropriate on to display.  If my form would only have a handful of these DDDW's I would go with this. But my form will have 100's of these and that .does not look like a fun task to do.

In Visual Studio C# I would know how to go about this.

Any ideas would be appreciated.

Thanks

TPS

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I think your approach is wrong. Instead of forcing the user to select "Other" and then type something, simply set the column's "Allow Editing" to true. Then in your code check if the column's value does not match any of your IDs you know it was "other".

Another way, create an additional column to hold the "Other" text and enable it only when the user selects "Other" from the dropdown.

Hope that helps.

Former Member
0 Kudos

I tend to use a response window which opens when the drop down dw would have dropped down. The window lists the mapped choices essentially using the dataobject you would have used. Then also a single line edit labelled Other. OK button mapped to default, preselect and scroll to already chosen item or prefill of other texT etc. ok closes with return of choice. Then you set the code value and other text.

More effort but clean.

Former Member
0 Kudos

I'm not sure if I understand correctly your requirements. But, how about including the "freeform" text in the DDDW as hidden field.

Example:

ID     String     String2

10        Word 1     Word 1

20        Word 2     Word 2

30        Word 3     Word 3

1000     Other     Freeform Text

The String2 is hidden. It does not show up in the drop down.

In the drop down field of your  DW, specify String2 as the display column and ID as the data column.

Former Member
0 Kudos

Hi Tom;

1) Any DW Control can have two useful DDDW events added to it ... a) when the DDDW drops and b) when it collapses for more script control.

2) Every DDDW Edit Mask can allocate more screen space when it drops. Have a look at the EM's properties for the DDDW.

3) PB's ability to add an EM for the DDDW in the DB Painter is one of its powerful features. If you map the DDDW through that mechanism - every DW that uses that column will have the DDDW behaviour already mapped & active (auto-magically <bg>).

4) Don't forget about creating a proper DW Control ancestor to encapsulate all your special DDDW processing needs.  

HTH

Regards ... Chris