문제

I have select menu in JSF xhtml page. The select menu contains a

<h:selectOneMenu value="#{bean.statusFlag}">

    <f:selectItems value="#{bean.statusList}"/>
 </h:selectOneMenu>

The value is be being stored in status.

This works fine. I have to print the value in h:outputText in next column.

<h:outputText value="#{bean.statusFlag}" />

prints code rather value corresponding value of code, since the value is in statusList.

Is there any way to achieve this without having to modify the backing bean.

도움이 되었습니까?

해결책

You could perhaps implement some sort of <f:ajax> within your <h:selectOneMenu>.

You could also use jquery with an onchange() event.

$('#select').change(function() {
    $('#outText').val($('#select').val());
});

Hope that helps!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top