1. ATK Gimmy Susan
  2. PowerBuilder
  3. Saturday, 7 December 2019 14:34 PM UTC

Hi Comunity


The datawindow dropdowns are very convenient for decoding.


Is there a way to prevent the curtain from falling at the click of the mouse?

 

 

Thanks in advance for your reply

René Ullrich Accepted Answer Pending Moderation
  1. Monday, 9 December 2019 12:23 PM UTC
  2. PowerBuilder
  3. # 1

Hi Gimmy,

here another approach:

Use a field (column object) to edit (simple edit style) and a different field to display the text (dddw style). An easy way is to use two column objects for the same retrieved column (you may add more than one column object for same column). So you don't need any additional code to show the correct text.

If it is no problem to show the two columns you don't need to do more.

If you want to show only one of the columns you have to write some code to show/hide the columns and switch the column focus in the itemfocuschange event.

HTH,

René

Comment
  1. ATK Gimmy Susan
  2. Monday, 9 December 2019 12:40 PM UTC
Hello

I can't.

The dddw code ( is an IUD ) while the user has a surrogate code field to use.
  1. Helpful
  1. René Ullrich
  2. Monday, 9 December 2019 12:47 PM UTC
I don't understand why it should not work for you.

The user can enter a code (say "IT") and you want to show a text for the entered code (say "Italy")? And you want to IUD the code? So my approach should work.
  1. Helpful
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Monday, 9 December 2019 11:22 AM UTC
  2. PowerBuilder
  3. # 2

Hi Gimmy,

Can you use standard behavior when you resize the dropdown to show 0 lines/rows?

There are a few ways to still leverage DDDW technology but manipulate it to suit your specific situation:

  1. Adjust the properties like %width, lines/rows in dropdown etc.
  2. Dynamically change content using custom event mapped to EventId = pbm_dwnDropDown
  3. Change validation logic by code in ItemChanged + ItemError
  4. NOT have DDDW in the displayed column
    Instead, code in ItemChanged; ItemError, Key, ProcessEnter, 4 x TAB something events, etc.
    Here you probably will use a DataStore to retrieve your non-visual DDDW and do find, validation, etc.

Option(4) takes significantly more code. That's the con. But it allows you to do pretty much anything. That's the pro.

I would try to adjust properties of the DDDW so it visually appears as you prefer.

HTH /Michael

UPDATE >> I tried a couple of customizations.
Lines in DropDown = 0 results in "default" number of lines. So THAT is no option.
I checked AllowEdit and unchecked Always Show Arrow. Now dropdown still appears when user clicks in the "arrow" part of the item. Click in the "text" part or TAB into the item does NOT display the dropdown. So it is PARTIAL solution.

If I had to make a DDDW that NEVER drops down then THIS is what I would do unless someone else knew a hidden property or code trick =>

  1. Edit Style = Edit; checked Use Code Table; checked Validation.
  2. At RetrieveEnd or ItemFocusChanged retrieve DropDown data into a DataStore
    Copy this dataset into the Edit item's Code Table. That code table behaves very similar to DDDW with data value and display value.
  3. Add code in EditChanged event if find or "prefix search" is required
  4. Add code in ItemChanged event to handle whatever additional processing is needed beyond data value <=> display value conversion.

Hopefully THIS brings you closer to your goal /Michael

Comment
  1. Roland Smith
  2. Monday, 9 December 2019 21:44 PM UTC
Can you set 'Lines In DropDown' to zero?
  1. Helpful
  1. Michael Kramer
  2. Monday, 9 December 2019 21:54 PM UTC
Yes, but it the DW engine goes> "AH! You mean default number of lines." My bad. I suggested before I could verify in a test.
  1. Helpful
There are no comments made yet.
Gerry Whitmarsh Accepted Answer Pending Moderation
  1. Monday, 9 December 2019 09:10 AM UTC
  2. PowerBuilder
  3. # 3

Hi Gimmy,

Have you tried just setting the tab order to 0 and disabling "always show arrow"? It will display the description but you cannot click on it. 

HTH

Gerry.

Comment
  1. ATK Gimmy Susan
  2. Monday, 9 December 2019 09:29 AM UTC
Hi Gerry

Thanks for the reply.

No, I can't set the tab to zero.

I want the user to be able to enter the field and enter the code to be decoded (it decodes automatically since it is a dddw field).

But I don't want to open the tent to see all the possible choices.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 9 December 2019 02:45 AM UTC
  2. PowerBuilder
  3. # 4

No, you cannot prevent the dddw to display itself when clicking on the arrow. There's an event pbm_dwndropdown which is called just before showing the dddw, but you can only "return 0".

Why don't you write something which uses a datastore instead of the dddw edit style?

You could use the tag attribute of the column to indicate which datastore, description and data field would have to be used.

In the constructor of the dw control you retrieve them all in memory and in the "editchanged" event you do your magic using the corresponding datastore for a specific column.

The only problem I see with this, is that you'd need an extra field or text for the description.

HIH

Comment
There are no comments made yet.
ATK Gimmy Susan Accepted Answer Pending Moderation
  1. Sunday, 8 December 2019 08:45 AM UTC
  2. PowerBuilder
  3. # 5
Hello John
Thanks for your post.

I try to explain myself better.

The DDDWs have the great advantage that by entering the code they decode and display a description (generally decoding) without making any effort.

I want to maintain this automatism, but I don't want it to go down the curtain to display its values ​​when the user clicks on the field.

The idea is to transform the DDDW into a self-decoding field without giving the possibility to view all the records contained in it.

I am imagining an event, a 'return code' or something else that prevents the opening of the dddw to display its contents.


Does anyone have any suggestions?

I hope I was clearer.
Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Sunday, 8 December 2019 03:11 AM UTC
  2. PowerBuilder
  3. # 6

Hi, Gimmy -

Would you please explain a little more clearly what you mean by "prevent the curtain from falling at the click of the mouse"? What behavior are you wanting to prevent? When the user clicks where? Have you tried turning off the "Always Show Arrow" property on the Edit tab in the DataWindow Painter?

Regards, John

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.