cancel
Showing results for 
Search instead for 
Did you mean: 

what does dialog:close do and how can i intervene?

netos
Champ in-the-making
Champ in-the-making
hi,

i am currently changing the logic of how associations are handled so that a user can go from modifying a content's properties to modifying the association's properties with a single click.

i did that by adding an action link instead of the path to the association, and gave the path as the link to show. the parameters to the action link were exactly like in the action details_doc in web-client-config-action.

all works great but the problem is that when i press close after modifying the association's properties, i go back to the space i was in and not to the properties of the content that owns the association.(where i came from).
if i don't modify the properties the first click on close does nothing and the second one takes you back to the space as before.

i tried to figure out the logic behind dialog:close and couldn't find anything.

any help would be appreciated.

thx, netanel.
14 REPLIES 14

netos
Champ in-the-making
Champ in-the-making
thx again, but unfortunately it didn't help…

i tried what you said in 2 ways:


<h:commandButton id="close-btn" value="#{msg.close}" action="#{DocumentDetailsBean.handleAssociation}" styleClass="wizardButton" />

and:


<h:commandButton id="close-btn" value="#{msg.close}" action="dialog:close" actionListener="#{DocumentDetailsBean.handleAssociation}" styleClass="wizardButton" />

while my method is:



public String handleAssociation(){
     
      Node curNode = getDocument();
      List<ChildAssociationRef> assocs = nodeService.getParentAssocs(curNode.getNodeRef());
      if(assocs.size() != 1)
         throw new AlfrescoRuntimeException("handleAssociation: more than one parent for an association");
      NodeRef parent = assocs.get(0).getChildRef();
      browseBean.setupContentAction(parent.getId(), true);
      return "dialog:close";
   }


(it differs a little on each variant but does the same)

still, it doesn't work. is there a phase in the way that overrides what BrowseBean.setupContentAction() does? what i saw from debugging seems to do ok, except for the final result… :shock:

if you can enlighten me some more i would appreciate it.
thx

gavinc
Champ in-the-making
Champ in-the-making
Hmm, I'm now at a loss for what to suggest 😞

What you have tried is exactly what I was suggesting and I would expect to work. When you say the everything seems to do ok apart from the final result, what is the final result? Does the details dialog still show the details of the previous node?

netos
Champ in-the-making
Champ in-the-making
yes…

i found this link as an answer to another post of mine, and it seems to talk about this problem exactly, haven't had a chance to go over it yet.

hope it will help.

netos
Champ in-the-making
Champ in-the-making
ok i got it!!!!

silly me… Smiley Surprisedops:

i just gave the wrong node to the browseBean.

the correct code is:


<h:commandButton id="close-btn" value="#{msg.close}" action="#{DocumentDetailsBean.handleAssociation}" styleClass="wizardButton" />
together with:

public String handleAssociation(){
     
      Node curNode = getDocument();
      List<AssociationRef> assocs = nodeService.getSourceAssocs(curNode.getNodeRef(), CustomModel.PROP_SCENE);
      if(assocs.size() != 1)
         throw new AlfrescoRuntimeException("handleAssociation: more than one parent for an association");
      NodeRef parent = assocs.get(0).getSourceRef();
      browseBean.setupContentAction(parent.getId(), true);
      return "dialog:close";
   }

thanks for all the help gavin.

gavinc
Champ in-the-making
Champ in-the-making
Your welcome, glad it's now working.