4 Replies Latest reply on May 3, 2012 9:33 AM by juza1

    editable List(boxes)

    juza1

      Hello,

       

      is there a component for lists where the entries are editable "in place"?

       

      Something like orderingList,and if I double-click on an entry, I can edit it.

       

      Thank you

      Francesco

        • 1. Re: editable List(boxes)
          paul.dijou

          Hi,

           

          Can't you combine a rich:list with a rich:inplaceInput inside ?

           

          Regards

          1 of 1 people found this helpful
          • 2. Re: editable List(boxes)
            juza1

            Hi Paul,

             

            I'm new about RF. Can you give me an example to follow on how to combine the two, please?

             

            Thank you

            Francesco

            • 3. Re: editable List(boxes)
              paul.dijou

              Sure. I would try something like :

               

               

              <h:form>
                  <rich:list value="#{beanAction.yourList}" var="_bean" type="ordered">
                      <rich:inplaceInput value="{_bean.yourAttribute}" />
                  </rich:list>
                  
                  <h:commandButton value="Save" action="#{beanAction.saveList()}"/>
              </h:form>
              

               

              Not sure it will works and can't test it right now. If it's fail, I will test it tonight. This is RichFaces 4 code. If you are using Richfaces 3, you will need to replace <rich:list type="ordered"> with <rich:dataOrderedList>

              1 of 1 people found this helpful
              • 4. Re: editable List(boxes)
                juza1

                Thank you for the hint.

                I prefer this solution as it has a better layout...

                 

                <rich:panel style="width:300px;height:100px;overflow: auto;">

                     <a4j:repeat value="#{detailModel.afterObject.metadata.getTitlesAsList()}"

                                                var="title"

                                                rows="#{detailModel.afterObject.metadata.getTitlesAsList().size()}"

                                                id="repeat">

                           <h:panelGrid columns="1">

                                 <rich:inplaceInput value="#{title.value}"/>

                           </h:panelGrid>

                     </a4j:repeat>

                </rich:panel>

                 

                I would have preferred using orderingList in combination with inplaceInput, but it seams not possible...