It's all about the answers!

Ask a question

[HOW TO] Autorefresh web UI after a state change ?


Alvaro Riera (4021418) | asked Sep 22 '11, 6:59 a.m.
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.

2 answers



permanent link
SEC Servizi (97123860) | answered Sep 23 '11, 6:02 a.m.
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 JavaScript. For instance, the Status selection is:
// ...

<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.

permanent link
Alvaro Riera (4021418) | answered Oct 13 '11, 4:07 a.m.
Thank you very much !!!

ill try!

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.