I have an object that has a String attribute which may be of four possible values, for each value i want to put a different css class to the cell . I am wondering if there is a way to write composite conditions in here:
<ui:repeat value="#{row.info}" var="wui" >
<td class="#{wui.status eq 'In execution'? 'inexec' : '' }">
<!--<td id="wuitd" onLoad="classfunction()" >-->
<h:outputText value="#{wui.status}" />
<h:outputText value="#{wui.remainingEffort} effort units" />
</td>
</ui:repeat>
I tried writing a javascript function but i am not sure if it is correct, also i think the function invocation is wrong:
<td id="wuitd" onLoad="classfunction()" >
<h:outputText value="#{wui.status}" />
</td>
<script>
function classfunction(){
char status = document.getElementById("wuistatus").value;
switch(status) {
case 'In execution':
document.getElementById("wuitd").style.parentRule('inexec');
break;
case 'Ready for execution':
document.getElementById("wuitd").style.parentRule('ready');
break;
case 'Finished':
document.getElementById("wuitd").style.parentRule('finished');
break;
case 'Not ready':
document.getElementById("wuitd").style.parentRule('notExec');
break;
default:
code block
}
}
</script>