setSelection() in for multilist field
How to use setSelection() for a multilist attribute which already has some values. I try to use the below lines and it overwrites the existing values.
IAgileList values = (IAgileList)cell.getAvailableValues();
Object[] t = new Object[1];
t[0] = values.getChildren()[0];
values.setSelection(t);
cell.setValue(values);
I’m not certain I understand what you are attempting to do. Please explain what you are trying to accomplish and through what means.
Items Page 2 has a field EBS Org which is change controlled . EBS Org already has values 101;102. When I try the above script on Event = Update Table to add value = 100 to the EBS Org field when the affected items table is updated , the EBS Org field gets updated with 100 but removes any existing values (101;102 in this case).
So to be straight I cannot help you but have clarified that the data would need to be appended rather than replaced so the command should ADD if rule = TRUE.
Perhaps some of our JAVA savvy folks can elaborate on how to addend data in a multi picklist on automation.
Just found this in hopes that it may ring a bell…
“You have no other conditions like update this in all rows then you can try
UPDATE jos_content SET title = CONCAT('Mr. ', title)
if you want to update conditionally that means particular row needs to update the you can use
UPDATE jos_content SET title = CONCAT('Mr. ', title) where fiedl_name ='condition'
eg: UPDATE jos_content SET title = CONCAT('Mr. ', title) where id = '1'
this will update only one row which contain id=1.
any way before doing this should keep a backup”
Found at http://stackoverflow.com/questions/13358923/sql-query-to-append-prefix-to-existing-value-in-a-field
Please try the below code :
String newValue = “100”;
String attributeValue = agileObj.getValue( “Page Two.attribute”).toString();
String [] strArr = attributeValue.split(“;”);
ArrayList <String> list = Arrays.asList(strArr);
list.add(newValue);
//Call this method
//Cell is the Page Two Attribute Cell which you want to update
//ArrayList is the list which you get from the above lines of code