Place this in the click event for the left button (btnLeft), and something similar in the click event for the right button (btnRight).
xfa.resolveNode("btnLeft.caption.value.#text").value = "Left";
xfa.resolveNode("btnCenter.caption.value.#text").value = "Left";
xfa.resolveNode("btnRight.caption.value.#text").value = "Left";