4 Replies Latest reply: May 3, 2012 9:33 AM by Francesco Croci RSS

editable List(boxes)

Francesco Croci Newbie

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 Newbie

    Hi,

     

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

     

    Regards

  • 2. Re: editable List(boxes)
    Francesco Croci Newbie

    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 Newbie

    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>

  • 4. Re: editable List(boxes)
    Francesco Croci Newbie

    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...