[HOW TO] Autorefresh web UI after a state change ?
Hi you all,
I have looked for and have read the manuals but i dont know how to (if possible) autorefresh web ui to show/hide attributes depending on the actual state.
In some states i need to show a specific custom enumeration and to hide another. Now, i have to refresh the page manually to redraw the user interface...
Do i need to use scripts?
Is there any formal or generic way to do this ???
Thank you very much.
I have looked for and have read the manuals but i dont know how to (if possible) autorefresh web ui to show/hide attributes depending on the actual state.
In some states i need to show a specific custom enumeration and to hide another. Now, i have to refresh the page manually to redraw the user interface...
Do i need to use scripts?
Is there any formal or generic way to do this ???
Thank you very much.
2 answers
In some states i need to show a specific custom enumeration and to hide another. Now, i have to refresh the page manually to redraw the user interface...
Do i need to use scripts?
Well, you could use some
// ...
<div class="EnumerationWidget NarrowWidget" id="com_ibm_team_workitem_web_ui_internal_view_editor_parts_StatusAttributePart_0" widgetid="com_ibm_team_workitem_web_ui_internal_view_editor_parts_StatusAttributePart_0">
// ...
<select dojoattachpoint="_select" dojoattachevent="onkeyup: _handleKeyUp, onchange: _handleSelectChange, onclick:_handleSelectClick, onfocus:_handleSelectFocus, onblur: _handleSelectBlur" class="Select">
<option value="Release.state.s14">New Release</option>
// ...
</select>
// ...
</div>
// ...
Then, you could show/hide HTML fields via an "onchange=foo();" in <select>. The "foo()" function could be:
<script type="text/javascript">
function foo() {
if (document.getElementById("com_ibm_team_workitem_web_ui_internal_view_editor_parts_StatusAttributePart_0").getElementsByClass("Selectvalue")[0].value == "Release.state.s14") {
document.getElementById("field_01").style.display = "none";
// ...
} else {
document.getElementById("field_01").style.display = "inline";
// ...
}
</script>
Cheers.