cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Screen Personas 3.0 - Update GuiComboBox

Former Member
0 Kudos
217

For SAP Screen Personas 3.0 I’m trying to dynamically update an existing GuiComboBox

The entries is held by a GuiCollection

GuiCollection API has a function call add(Object item)

When I try to use add() it gives me following error"

oPrivateInstance.aElements.push is not a function

The object I try to set as input-parameter is the element object retrieved from GuiComboBox.entries.elementAt(i);  

Example code below:

var dropDownObj = session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:*/cmbPersonas_1458022736755");

var dropDownTargetObj = session.findById("wnd[0]/usr/cmbPersonas_1458268186725");

for(var i=0; i < dropDownObj.entries.length; i++) {

                        var element  = dropDownObj.entries.elementAt(i); 

                        alert(element.key);      //Succsessfully print out the key value

                        dropDownTargetObj.entries.add(element); ERROR

}

have been trying to use the

var element = {key: "B", value: "Limit"}; but does not work either

Anybody that has successfully used the GuiCollection.add(Object item) ?

Accepted Solutions (0)

Answers (2)

Answers (2)

clemens_gantert
Employee
Employee
0 Kudos

Hi,

it's not possible to manipulate the value set of a combo box via scripting in Personas 3.0 SP2. The method GuiCollection.add() only adds an entry the collection itself but it does not change the combobox.

With all the due disclaimers about announcing future functionality, the following is planned:

a) custom combo: Adding, removing, reordering entries and label changing

b) standard/dnypro combo: removing, reordering of existing entries, and label changes.

Best Regards,

Clemens

Former Member
0 Kudos

Hi Clemens,

Good to here about the future API! I think to dynamically update a custom combo is a common scenario where you would like to replace some of the F4s entries with a combo to speed up the key-ins.

In regards to my initial question about the GuiCollection.add(object) do you know the format of the object to be added ?

Thanks !


Regards

Rasmus

clemens_gantert
Employee
Employee
0 Kudos

Hi,

The GuiCollection that GuiCombobox.entries returns is a "detached" collection whose entries are of type GuiComboboxEntry. Even if you were able to create a new instance of GuiComboboxEntry  - and you cannot in SP2 - it wouldn't matter because the changes to the collection are not "sent back" to the combobox (and GuiCombobox.enties is a read-only property).

In SP2, you can add any object to a GuiCollection but as I said it won't have any effect on the "parent" or factory control that created it.

Best Regards,

Clemens

Former Member
0 Kudos

Hi Clemens,

Thanks for the clarification !

regards

Rasmus

Thomas_Mangler
Active Participant
0 Kudos

I think i have the same problem.

Question:

Is ist possible to set  labels/values to a combobox per script?

I would like to set the labels/values as part of the onload event. Per example i want a combobox with 4 years based on the actual year.

If there is no solution i have to update the flavors with fix values ervery year.