1
I am using JSF 1.2 and Richfaces 3.3.3 in my sample JSF Application.
I have a form with rich:dataTable that having single column with h:inputText and footer having a4j:commandButton with value "add".
when I click "add" button then new row adding in rich:dataTable and that is working fine.
My need is after pressing "add" button the focus have to go newly created row to the h:inputText field...
sample code :
<rich:dataTable value="" var="">
<rich:column>
<f:facet name="header">
<h:outputText value="name" />
</f:facet>
<h:inputText id="name" value="#{obj.name}">
</rich:column>
<f:facet name="footer">
<a4j:commandButton value="add" action="{actionMethod}" />
</f:facet>
</rich:dataTable>
當我點擊「添加」按鈕,然後添加在rich:dataTable中的新行,並且工作正常。 我需要的是按下「添加」按鈕後,焦點必須去新創建的行,以h:inputText字段...如何將rich:dataTable中的h:inputText設置爲一列後按a4j:commandButton,如rich()的頁腳中的(+):dataTable?
如何使用JQuery或Java腳本,任何想法?
感謝您的回覆蘇德赫。它的工作很好... – Jagan 2013-04-18 10:22:41