cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing 'Modify properties' when I open space

msvoren
Champ in-the-making
Champ in-the-making
I would like to have that "Modify properties" button when I open space (so I don't have to go to View Properties screen.)

I added this to my browse.jsp:

<a:actionLink id="editProps" value="#{msg.modify}" showLink="false" image="/images/icons/edit_properties.gif"
       action="dialog:editSpace" >
</a:actionLink>


But this code is missing context. Code doesn't know what to edit..
When i click button it returns "NullPointerException".

When I load any "View Details" form, seems that some variable is filled. Then I can use my Edit Properties button, but opens data from that previous space..

Also, code from edit-space-details.jsp doesnt work:
          <hSmiley TongueanelGroup id="props-panel-facets">
             <f:facet name="title">
                   <a:actionLink id="titleLink1" value="#{msg.modify}" showLink="false" image="/images/icons/edit_properties.gif"
                           action="dialog:editSpace" />
                  </rSmiley TongueermissionEvaluator>
             </f:facet>
          </hSmiley TongueanelGroup>

Any thoughts? Thank you
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
The EditSpaceDialog presumes you are editing the details of the space you are viewing the details of, so as you say some context has already been setup. Try making your link the following:


<a:actionLink id="editProps" value="#{msg.modify}" showLink="false" image="/images/icons/edit_properties.gif"
action="dialog:editSpace" actionListener="#{BrowseBean.setupSpaceAction}">
    <f:param name="id" value="#{NavigationBean.currentNodeId}" />
</a:actionLink>

msvoren
Champ in-the-making
Champ in-the-making
Thanks for the reply! Tried that, alfresco returns:
javax.faces.FacesException: Client-id : _idJsp13 is duplicated in the faces tree. Component : browse:_idJsp13, path: {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/poteza/company.jsp][Class: javax.faces.component.html.HtmlForm,Id: browse][Class: org.alfresco.web.ui.common.component.UIPanel,Id: spaces-panel][Class: org.alfresco.web.ui.common.component.data.UIRichList,Id: spacesList][Class: org.alfresco.web.ui.common.component.data.UIColumn,Id: col1][Class: org.alfresco.web.ui.common.component.UIActionLink,Id: col1-act1][Class: javax.faces.component.UIParameter,Id: _idJsp13]}


All in red Smiley Happy


Anyway, I managed to do this by crating new action:

         <action id="edit_details">
            <label-id>edit_details</label-id>
            <image>/images/icons/edit_properties.gif</image>
            <action-listener>#{BrowseBean.setupSpaceAction}</action-listener>
            <action>dialog:editSpace</action>
            <params>
               <param name="id">#{actionContext.id}</param>
            </params>
         </action>

And in jsp, I call it with:
<r:actions id="edit_props" value="edit_space_group" context="#{NavigationBean.currentNode}" showLink="false" styleClass="inlineAction"/>


But still, i'm wondering why this won't work with actionLink..

gavinc
Champ in-the-making
Champ in-the-making
It was probably the following line:

<f:param name="id" value="#{NavigationBean.currentNodeId}" />

try adding an explicit unique id for the page i.e.

<f:param id="edit-space-action" name="id" value="#{NavigationBean.currentNodeId}" />

janco
Champ in-the-making
Champ in-the-making
Hi Gavin,

I was trying your actionlink and its working, but the property screen is showing properties for the parent not for the node I want to edit.

<%– Document edit column –%>
<a:column id="col-edit" style="text-align:left">
   <f:facet name="header">
     <h:outputText id="col-edit-txt" value="Edit" />     
   </f:facet>
   <a:actionLink id="editProps" value="#{msg.modify}" showLink="false" image="/images/icons/edit_properties.gif" action="dialog:editSpace" actionListener="#{BrowseBean.setupSpaceAction}">
     <f:param id="edit-space-action" name="id" value="#{NavigationBean.currentNodeId}" />
   </a:actionLink>
</a:column>

Any idea on how to show the properties for the items from the files list?

Thanks