[xwiki-users] Document parent name changing on edit.
Hello All, At the top of some pages, I have three html buttons for the options to 'go to parent page', 'edit current', and 'delete current'. go to parent page works fine when the document is first created. However if someone tries to edit the page (which is necessary at some points) the parent of the page is wiped when the page is saved again. i.e. on clicking 'Save & View' the parent value is wiped and set as the page itself. Any ideas why this would be happening? These are the buttons if there is something I am doing wrong here.. {{html}} #if($context.action=="view") <button style="width:100;height:65" onClick="window.location='$doc.getParentURL()'"> <b>Back to Hub</b> </button> <button style="width:100;height:65" onClick="window.location='$doc.getExternalURL('inline')'"> <b>Edit Current</b> </button> <button style="width:100;height:65" onClick="window.location='$doc.getExternalURL('delete')'"> <b>Delete Current</b> </button> #end {{/html}} Thanks, Adam
On 07/25/2011 02:47 PM, Adam Kozuch wrote:
Hello All,
At the top of some pages, I have three html buttons for the options to 'go to parent page', 'edit current', and 'delete current'.
go to parent page works fine when the document is first created. However if someone tries to edit the page (which is necessary at some points) the parent of the page is wiped when the page is saved again. i.e. on clicking 'Save& View' the parent value is wiped and set as the page itself. Any ideas why this would be happening?
Does this happen only on the documents that have these buttons? Check the HTML source of the page displayed in edit mode, and check how many inputs with the name "parent" are there, and what's their value.
These are the buttons if there is something I am doing wrong here..
{{html}} #if($context.action=="view") <button style="width:100;height:65" onClick="window.location='$doc.getParentURL()'"> <b>Back to Hub</b> </button> <button style="width:100;height:65" onClick="window.location='$doc.getExternalURL('inline')'"> <b>Edit Current</b> </button> <button style="width:100;height:65" onClick="window.location='$doc.getExternalURL('delete')'"> <b>Delete Current</b> </button> #end {{/html}}
Thanks,
Adam _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Sergiu Dumitriu http://purl.org/net/sergiu/
I did just that and that was my problem. There was a : <input type="hidden" name="parent" value="${doc.name}"/> That was setting the page parent its own name (I was using $request.someVar to gather and set values on creating a new page). I had figured it out last night but forgot to reply back to myself saying it was solved. On a different note, are the html buttons I am using the most efficient (best method calls?) to edit, delete, and navigate to a parent page? Thanks, Adam On Tue, Jul 26, 2011 at 3:29 AM, Sergiu Dumitriu <[email protected]> wrote:
On 07/25/2011 02:47 PM, Adam Kozuch wrote:
Hello All,
At the top of some pages, I have three html buttons for the options to 'go to parent page', 'edit current', and 'delete current'.
go to parent page works fine when the document is first created. However if someone tries to edit the page (which is necessary at some points) the parent of the page is wiped when the page is saved again. i.e. on clicking 'Save& View' the parent value is wiped and set as the page itself. Any ideas why this would be happening?
Does this happen only on the documents that have these buttons?
Check the HTML source of the page displayed in edit mode, and check how many inputs with the name "parent" are there, and what's their value.
These are the buttons if there is something I am doing wrong here..
{{html}} #if($context.action=="view") <button style="width:100;height:65" onClick="window.location='$doc.getParentURL()'"> <b>Back to Hub</b> </button> <button style="width:100;height:65" onClick="window.location='$doc.getExternalURL('inline')'"> <b>Edit Current</b> </button> <button style="width:100;height:65" onClick="window.location='$doc.getExternalURL('delete')'"> <b>Delete Current</b> </button> #end {{/html}}
Thanks,
Adam _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (2)
-
Adam Kozuch -
Sergiu Dumitriu