Solved: Xpages ListBox can't change selected value

I have a ListBox on my Xpage and I want to change its value automatically when the user hits the Edit button on the page. I am able to change the value of the field from say value B to A in the background but visually the field still says B when its supposed to say A. I have tried various line of code below in the Server Simple Actions of the button but nothing seems to work.

dataSource.setValue(“FieldName”, new Array(“A”));

dataSource.setValue(“FieldName”, “A”);

dataSource.replaceItemValue(“FieldName”,“A”);