guessdip
asked on
Problem With Refresh parent page after save data in dataview web part..
Hii All,
I did one dataview web part in sharepoint site. and i have one hyperlink to open newform.aspx. i open that form in another page like child page. and i removed sharepoint save and cancle button and i wrote code for save and cancel is .. <input Type="button" Value="Save" Onclick="javascript:{ddwrt :Genfirese rverevent{ '_commit'; };window.o pener.docu ment.locat ion.reload ;self.clos e();>
So i used window.opener.document.loc ation.relo ad for refresh and self.close(); for close child window.
But when i click SAVE button then first it refresh the parent window and then it save the data. so i dont get resule. everytime i have to refresh manually..
How can i fix this problem?? Can i refresh twise so i can remove this problem..Please anyone help me ..
And one more thing is an another list it works fine but only this project tasks list it does not work..
Thank You..
Dipesh
I did one dataview web part in sharepoint site. and i have one hyperlink to open newform.aspx. i open that form in another page like child page. and i removed sharepoint save and cancle button and i wrote code for save and cancel is .. <input Type="button" Value="Save" Onclick="javascript:{ddwrt
So i used window.opener.document.loc
But when i click SAVE button then first it refresh the parent window and then it save the data. so i dont get resule. everytime i have to refresh manually..
How can i fix this problem?? Can i refresh twise so i can remove this problem..Please anyone help me ..
And one more thing is an another list it works fine but only this project tasks list it does not work..
Thank You..
Dipesh
ASKER
Hii jyoti sinha,
Exactly i used hyperlink for open pop window means newform like <a href http:abc.com?project=project1"Target=-blank...i used target = blank so it open this form in another window..i did not use show model or window.open...
I dont know what to do. exactly first it refresh the page and then save the data so i am not getting desire output. i need refresh again or try to set time or think about sequence of execute command..
What to do ??
Thanks
Dipesh
Exactly i used hyperlink for open pop window means newform like <a href http:abc.com?project=project1"Target=-blank...i used target = blank so it open this form in another window..i did not use show model or window.open...
I dont know what to do. exactly first it refresh the page and then save the data so i am not getting desire output. i need refresh again or try to set time or think about sequence of execute command..
What to do ??
Thanks
Dipesh
Hope I am getting your question right! using showmodaldialog, you could do like this
1.) On parent page,
instead of using <a href http:abc.com?project=project1"Target=-blank
you can use following:
<a href=# onClick='return openpopup();'>your link text</a>
In javascript write the following function:
function openpopup()
{
var windowFeatures =
'dialogWidth:800px; dialogHeight:500px; ' +
'center:yes; help:no; resizable:no; status:no;';
return window.showModalDialog(you rchildpage URL,' ',windowFeatures);
}
and
2.) on Child page, you can do following:
<input Type="button" Value="Save" Onclick="javascript:{ddwrt :Genfirese rverevent{ '_commit'; };window.r eturnValue =true; window.close();>
Hope this works!
1.) On parent page,
instead of using <a href http:abc.com?project=project1"Target=-blank
you can use following:
<a href=# onClick='return openpopup();'>your link text</a>
In javascript write the following function:
function openpopup()
{
var windowFeatures =
'dialogWidth:800px; dialogHeight:500px; ' +
'center:yes; help:no; resizable:no; status:no;';
return window.showModalDialog(you
}
and
2.) on Child page, you can do following:
<input Type="button" Value="Save" Onclick="javascript:{ddwrt
Hope this works!
ASKER
Hii,
I am using sharepoint designer so i am using sxlt language so i am confuse to write javascript function. can i write code directly in hyperlink??i wrote but i got error...
Thanks..
I am using sharepoint designer so i am using sxlt language so i am confuse to write javascript function. can i write code directly in hyperlink??i wrote but i got error...
Thanks..
ASKER
Hii jyoti,
When i write this <a href=# onClick='return openpopup();'>your link text</a>
then i get error "" This web part does not have valid xslt style sheet :Error: A string literator was expected;But no opening quota character found.""
Thanks
When i write this <a href=# onClick='return openpopup();'>your link text</a>
then i get error "" This web part does not have valid xslt style sheet :Error: A string literator was expected;But no opening quota character found.""
Thanks
ASKER
Hii jyoti,
i used <a href="#" onClick='return openpopup();'>your link text</a>
And i wrote fuction
But when i click on that link then page is not open.. Any idea ??
i used <a href="#" onClick='return openpopup();'>your link text</a>
And i wrote fuction
But when i click on that link then page is not open.. Any idea ??
ASKER
Hiii,
i used your code it works fine for opening pop pup window and close but it is not refresh so i dont get data,i have to refresh manually...Any idea to refresh page after using showmodelwindow..
Thank You
Dipesh
i used your code it works fine for opening pop pup window and close but it is not refresh so i dont get data,i have to refresh manually...Any idea to refresh page after using showmodelwindow..
Thank You
Dipesh
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hii jyoti,
When i use showmodeldialog and when i close this then another normal window open with same url. so everytime i have to close this window. I used window.showmodeldialog(url ,window,wi ndowfeatur e)
thanks
Dipesh
When i use showmodeldialog and when i close this then another normal window open with same url. so everytime i have to close this window. I used window.showmodeldialog(url
thanks
Dipesh
got it...in <head> section of aspx page, just use
like <head>
<base target ="_self"/>
</head>
like <head>
<base target ="_self"/>
</head>
ASKER
Hii i already used,__self in hyperlink target property...
ASKER
Thanks Jyoti,,If you have time then just take a look of my new question..
How about using var ret=window.showModalDialog
If showModalDialog is possible, that offers more control over controling the postback at parent page. Based on save (successful or failed), you can return a true or false from popup page using window.returnvalue= <true or false>.
if true is returned, parent page's server event would be fired and your page will get reloaded.
Hope this helps!