question with focus on popup
bennop Dec 9, 2011 4:56 AMI have the following code. Popup works correctly, no problem, but how do I set the focus when it shows to popup to the input with id= commentToAddDetail?
Thanks,
Ben
<h:commandButton id="sendChannelManuallyDialog"
value="#{messages['Toolbar_sendChannelManually']}"
title="#{tradeDetailBean.sendChannelManuallyActionTooltip}"
disabled="#{tradeDetailBean.sendChannelManuallyActionForbidden}"
>
<rich:componentControl
onbeforeoperation="checkSelectedRecipients();addCommentDetail('sendChannelManually');"
target="popupAddCommentDetail"
operation="show" />
</h:commandButton>
<rich:popupPanel id="popupAddCommentDetail" modal="true" moveable="true" autosized="true"
style="{background-color:white;}" shadowDepth="0">
<div title="Add Comment" id="addCommentSoyonDetail" style="border:3;background:grey">
<f:facet name="header">
<h:outputText value="Add Comment Detail" />
</f:facet>
<h:form id="formAddCommentDetail">
<h:inputHidden id="id" value="#{tradeDetailBean.tradeId}"></h:inputHidden>
<h:inputHidden id="recipients" value="#{tradeDetailBean.recipients}" />
<h:panelGrid columns="2" >
<h:outputText value="#{messages['addComment_Comment']}" />
<h:inputText
id="commentToAddDetail"
size="20" maxlength="2000"
value="#{tradeDetailBean.commentMessage}" />
<h:outputText value=" " />
<h:outputText value=" " />
<h:panelGrid columns="5">
<h:commandButton
id="addCommentDetailDialogOk"
actionListener="#{tradeDetailBean.processToolbar}"
value="#{messages['addComment_Ok']}"
styleClass="blocking" >
</h:commandButton>
<h:commandButton
id="addCommentDetailDialogDiscardOk"
actionListener="#{tradeDetailBean.processToolbar}"
value="#{messages['addComment_Ok']}"
styleClass="blocking" >
</h:commandButton>
<h:commandButton
id="addCommentDetailDialogSendConfirmationManuallyOk"
actionListener="#{tradeDetailBean.processToolbar}"
value="#{messages['addComment_Ok']}"
styleClass="blocking" >
</h:commandButton>
<h:commandButton
id="addCommentDetailDialogDiscardRecipientChannelOk"
actionListener="#{tradeDetailBean.processToolbar}"
value="#{messages['addComment_Ok']}"
styleClass="blocking" >
</h:commandButton>
<h:commandButton
id="addCommentDetailDialogSendChannelManuallyOk"
actionListener="#{tradeDetailBean.processToolbar}"
value="#{messages['addComment_Ok']}"
styleClass="blocking" >
</h:commandButton>
</h:panelGrid>
<h:commandButton
id="addChannelDetailDialogCancel"
onclick="#{rich:component('popupAddCommentDetail')}.hide(); return false;"
value="#{messages['addComment_Cancel']}" />
</h:panelGrid>
</h:form>
</div>
</rich:popupPanel>