1 Reply Latest reply on Jan 23, 2010 5:17 AM by ilya_shaikovsky

    Is it possible to make rich client with RichFaces ?

    dzakharov

      Hello!

       

      Is it possible to make rich client with RichFaces? I want to make a convenient form to data entry without a mouse.
      I want to do the following:
      1. To make a modal window
      2. To start the modal window and to set focus on a particular field

       

                                  <a:commandLink value="#{messages['message.name']}" reRender="orderingPanel"
                                            oncomplete="Richfaces.showModalPanel('orderingPanel', {});"
                                            focus="customer">
                                      <a:actionparam name="h" value="#{_search.h}"
                                                 assignTo="#{orderHome.instance.h}"/>

                                       ......

       

      modal window

       

               <rich:modalPanel id="orderingPanel" autosized="true" width="500" height="260">
                        <f:facet name="header">
                            <h:outputText value="#{messages['title']}" />
                        </f:facet>
                        <h:form id="orderingForm">
                            <h:panelGrid columns="1">
                               <s:decorate id="customerField" template="/layout/edit.xhtml">
                                  <ui:define name="label">#{messages['customer']}</ui:define>
                                  <h:inputText id="customer" value="#{orderHome.instance.customer}" size="50"
                                         required="true" requiredMessage="#{messages['name']}">
                                  <a:support id="customerCheck" event="onblur" reRender="customerField, severityPanel" focus="email"/>
                                  </h:inputText>
                               </s:decorate>

                               .....

       

       

      This code doesn't work.

       

      3. If the validation doesn't success, focus remained on wrong field

      4. Don't validate, if user clicks the Cancel button.

       

      I use RichFaces 3.3.2.SR1 and Seam 2.1.1.

      Tell me please, where can I find my problems solution.

      Or it'll be better to use another product, like jQuery or GWT!

        • 1. Re: Is it possible to make rich client with RichFaces ?
          ilya_shaikovsky

          2)

          oncomplete="#{rich:component('editPanel')}.show(); #{rich:element('makeInput')}.focus();"

          the problem is that focus tried to be set before oncomplete. so panel hidden and js failed.

          3) You could pass id of the first failed input to client and return focus on oncomplete in the same way.

          4) Not a problem at all - showing modal panel - client side operation. Or use ajaxSingle if using ajax control for cancel.