Powerbuilder multiple select in dropdown - dropdown

Is there a multiple select option for the datawindow dropdown in powerbuilder? I have a dropdown (dddw) and I need to select more than one value. How can I do that?
Thanks!

Nope. A dropdowndatawindow is a single select object. You can do this via a listbox. Here is a link which may help you from the old PowerBuilder Developers Journal. You basically set the muli select property of the listbox to true. Populate the entries. Then loop through the selected items.
There also is a discussion string on this topic in the SAP archives (SAP used to own PowerBuilder). There is a custom control by Balu Ramasamy which may help too.

I don’t know how to make Powerbuilder select multiple rows in a dropdowndatawindow, but I had a situation where it did select multiple rows and I didn’t want it to. I had to turn off the prior row and reselect the new row. I added this code to the itemchanged event when transaction_reason changed.
DataWindowChild ldwc_Reason
this.GetChild('transaction_reason', ldwc_Reason)
// unselect prior reason's'
ldwc_Reason.selectrow( 0, false)
// select the current reason
ldwc_Reason.selectrow( ldwc_Reason.getrow(), true)

Related

Automation Anywhere. How do I pick a value from dropdown

Automation Anywhere. How do I pick a value from dropdown. I tried 'set text' from a copied variable. Its very slow, and also doesnt seem to be the right away. I would want to pick a value from the dropdown. Any idea how this can be done ? Thank you
You can use Object Cloning for this.
The process will be like:
Select object cloning and select the window you want to clone.
Capture the object to which you want to select from the drop-down.
Object cloning intelligence will automatically treat this as Drop down, and an extra option like "select Item by text" will appear in the action list. Select that option.
It will only suggest the all the drop down options. Select the required option you want.
Press Save.
That's it.
Thanks
You can do it using 'Manage Windows Controls' AA Command ( in this command make sure you check available checkbox for Capture a control of specific type [select - Drop Down] in next text box) and capture the value from pick list.

Spotfire: Need to select all values in a Multi select List Box Document Property

I have zero knowledge of coding. Can someone please help me with code.
My situation is as follows:
Dashboard has a Multi select List Box (Document Property). I am using that to restrict the data and calculations.
User does not want to select values each time. He wants a button where in (s)he click it once and all the values present in the list box gets selected.
Can someone please help me.
Regards,
Subro
This is fairly easy to do. Let us say that the Document Property that the list box is used for is named "Test" and it is of type "String List". Then you can use an IronPython script like so:
Document.Properties["Test"] = ["First Choice","Second Choice","Third Choice"]
Where the string list you see above, are all the values in your list box. Make sure that the strings you assign to the document property are the ones you want to populate your list with, since sometimes the displayed values can be different than the ones assigned to the document property(The case of using the "Fixed Values" option when setting up the control).
Hope that this helps.
Zenios

Gray out a form row's (detail's) button conditionally with VBA code

I have a standard form in MS-Access which lists a bunch of orders, and each row contains order no, customer, etc fields + a button to view notes and attached document files.
On request from our customer we should gray out the button btnAnm (or check or uncheck a checkbox) depending on a calculation from two queries to two other tables (a SELECT COUNT WHERE and a check if a text field is empty).
I've tried btnAnm_BeforeUpdate(...) and btnAnm_BeforeRender(...) and put breakpoints in the subs, but none of them trigger. The same if I use the control Ordernr instead of btnAnm.
I'd like a function in the Detail VBA code to be triggered for each "Me." (row) so to speak, and set the row's control's properties in that sub.
What do I do? I've looked at the help file and searched here.
*Edit: So I want to do something that "isn't made to work that way"? Ie. events are not triggered in Details.
As an alternative, could I base the value of a checkbox on each line on a query based on the 'Ordernr' field of the current row and the result of a SELECT COUNT from another table and empty field check?
Do I do this in the query the list is based on, or can I bind the extra checkbox field to a query?
A description of how to do this (combine a COUNT and a WHERE "not empty" to yes/no checkbox value) would be perfectly acceptable, I think! :)*
You cannot do much with an unbound control in a continuous form, anything you do will only apply to the current record. You can use a bound control with a click event so that it acts like a button.
Presumably the related documents have a reference to the order number that appears on your form, which means that you can create a control, let us call it CountOrders, with a ControlSource like so:
=DCount("OrderID","QueryName","OrderID=" & [OrderID])
The control can be hidden, or you can set it up to return true or False for use with a textbox, you can also use it for Conditional Formatting, but sadly, not for command buttons.
Expression Is [CountOrders]>0
You can also hide the contents and add a click event so that is acts in place of the command button. Conditional Formatting will allow you to enable or disable a textbox.
As I understand your question, you have a continuous form with as command button that appears on each row - and you'd like to enable/disable the button conditionally depending on the contents of the row.
Unfortunately you can't do that. It seems that you can't reference the individual command buttons separately.
Having wanted to do something similar in the past I came up with two alternate ways of setting up my interface.
Put a trap into the onClick code for the Button. Which is icky, because it is counter intuitive to the user. But it gets you that functionality now.
Move the command button (and editable fields) up into the form header, and make the rows read only. Your users then interact with the record only in the header, and select the record they want work with in the list below. As I recall this is known a Master-Detail interface.

VB.Net - select whole line in a multicolumn ListView and not only first item

I have a ListView in VB.Net.
I want to use it to display a table of data.
However I want to be able to click on a row and select it.
The component allows me to select a row only by clicking on the first item of each row.
Can I change that?
Is there a better component to display tables? (I've already tried the DataGridView. I don't like it's appearance)
This should simply be a matter of setting FullRowSelect on the control to be True.
Change the FullRowSelect property to True.

VB in Access: Combo Box Values are not visible in form view but are visible through Debug.Print

Code in Form onLoad:
country_combo.RowSourceType = "Value List"
Code in a reset function:
Dim lListIndex As Long
With Me.country_combo
For lListIndex = .ListCount - 1 To 0 Step -1
.RemoveItem (lListIndex)
Next lListIndex<br/>
End With
Code to populate country combo:
*For n = 1 To numCountries*
*countryCombo.AddItem (countryRS.Fields("countryName"))*
*countryRS.MoveNext*
*Next n*
I'm having a problem that occurs AFTER the code to populate the country combobox runs. The values are there as I can run Debug.Print(countryCombo.Value) and it prints out the name of the selected country, but I can't see the values in the combobox at all. They're invisible, and as far as I know there is no visiblity property for specific items, unless I'm completely mistaken.
comboBoxError.png http://img110.imageshack.us/my.php?image=comboboxerror.png
I think you should probably use Access's GUI tools to do what you're looking for. In design mode, click on the field you are trying to populate, then click the "lookup" tab. You can then specify a table to populate the field with and your forms should automaticly update as well.
I've also seen what you describe here - as far as I can tell, it's a bug within Access (I was using 2007) that only occurs when you programatically mess with the contents of a combo box. It does not happen every time. The issue corrects itself if you highlight the text that is in the combo box.
I am experiencing a similar issue with Access 2003. Based on the selection of one combo box, the row source of a listbox is set to an SQL string Basically a SELECT DISTINCT [MyField_Selected] FROM MyTable. For some fields the values are visible in the list box and others it is not. The values are there however as I can access them via code. To make it more interesting it works fine in Access 2007.
Just found the resolution on another forum. Check the format property of the field(s) in question on the table. In my case, when Access 2007 created the table, it put an # format in there. I removed that and all works great!