I am using the AjaxUpdateLink to update a table inside a page instead of refreshing the whole page.
However, the link only refreshes the Ajax Update Container (which wraps the table) briefly while the user clicks on the link.
Can someone point to me how to make sure the container remains updated until the user clicks on the link again to hide the contents?
I wish to allow the user to explicitly click on "Hide Explanation" to hide the explanation.
Currently with the following wod description, an onClick causes the link to update the container correctly, but it only lasts a few seconds, then the update container returns to its previous state.
Here is the description of the link:
ExplanationLink: AjaxUpdateLink {
updateContainerID = "SearchResultsUpdateContainer1";
action = showStatusExplanation;
onClick = "show_explanation(this)";
evalScripts = true;
onComplete = "SearchResultsUpdateContainer1Update()";
}
function show_explanation(element) {
case_number = element.parentNode.parentNode.id;
explanation_row = document.getElementById(case_number + "_status");
if (element.innerHTML == "What does this mean?") {
element.innerHTML = "Hide Explanation";
explanation_row.style.display = '';
} else {
element.innerHTML = "What does this mean?";
explanation_row.style.display = 'none';
}
};
public WOActionResults showStatusExplanation() {
return null;
}
Is an action binding required here? If yes, since the onClick JS Script already takes care of the display, can the action just return null?
Thanks for any hints,
-mai