我正在尝试在选择 selectOneRadio 值时提交表单。我有下面的代码,但它没有进入我的#{contentEditorBacking.addNewsArticle}
.
有谁知道单击 selectOneRadio 时我如何进入该方法?
<p:panel header="News Article Title">
<h:panelGrid columns="2">
<h:outputLabel for="title" value="Title" style="font-weight: bold;"/>
<p:inputText id="title" required="true" value="#{contentEditorBacking.newsTitle}" />
<h:outputLabel value="Site" />
<p:selectOneRadio value="#{contentEditorBacking.selectedNews}" layout="pageDirection" onchange="submit()">
<f:selectItem itemLabel="Public" itemValue="Public" />
<f:selectItem itemLabel="Member" itemValue="Member" />
</p:selectOneRadio>
<p:commandButton value="submit" action="#{contentEditorBacking.addNewsArticle}" />
</h:panelGrid>
</p:panel>