Microsoft Content Management Server - Problem with Submit/Decline with Reason

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > May 2004 > Problem with Submit/Decline with Reason





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Problem with Submit/Decline with Reason
LDo

2004-05-12, 3:46 am

Hello,

Can someone help me with this problem. I have the SubmitWithReason class written similar to DeclineWithReason as follow to allow the Author to tell the Editor the reason of changing the content of the posting.

public class SubmitWithReason : Microsoft.ContentManagement.WebControls.ConsoleControls.SubmitAction
{
public SubmitWithReason()
{
}

protected override void OnLoad(System.EventArgs e)
{
string reasonfunc =
"<script language=\"JavaScript\">\n"+
"function SG_setSubmitReason(strReason)\n"+
"{\n"+
" __CMS_PostbackForm.SubmitReason.value = strReason;\n"+
" "+base.ActionJavascript+";\n"+
"}\n"+
"</script>";

base.OnLoad( e );

if (this.Available == true)
{
// create hidden "SubmitReason" case
Page.RegisterHiddenField( "SubmitReason", "" );
Page.RegisterClientScriptBlock( "SubmitReasonScript", reasonfunc );
}
}

public override string ActionJavascript
{
get
{
string myPostBackString="";
Posting currentPosting;

currentPosting = CmsHttpContext.Current.Posting;

if(currentPosting!=null)
{
myPostBackString = "window.open('"+Page.Request.ApplicationPath+"/Utilities/GetSubmitReason.aspx?" + currentPosting.QueryStringModeUpdate + "');";
}


return myPostBackString;
}
}
}


I find there is a problem. If I change a posting content, save and submit it, after the submit click, enter the reason ok, the browser refreshes and the posting reappears with the Page status: WaitingForEditorApproval as we expected. But the problem happe
ns when in the same session, I want to submit another posting, after successfully enter the reason, the main screen doesn't refresh and is frozen for an unacceptable length of time. But behind it the posting status is already changed, you can check by ope
n another browser window and see the status of that posting has changed to WaitingForEditorApproval. Sometimes if I am very lucky, it let me go through with a few submits but most of the time, I cannot pass the second one. I find the same thing happened f
or declining with reason, ie, I cannot decline more than 2 postings before it is frozen.

This only happens if you want to have the popup submit/decline reason. Otherwise with the standard submit/decline (without reason), we can submit/decline as many as we want.

Thank you if you can help.




Trevor Grant

2004-05-19, 5:49 pm

Hi

The code looks good. How is the submit reason being processed in the
workflow even handlers?

Trevor

"LDo" <anonymous@discussions.microsoft.com> wrote in message
news:DA0D1218-33B7-4B3A-984A-613CBC7343B2@microsoft.com...
> Hello,
>
> Can someone help me with this problem. I have the SubmitWithReason class

written similar to DeclineWithReason as follow to allow the Author to tell
the Editor the reason of changing the content of the posting.
>
> public class SubmitWithReason :

Microsoft.ContentManagement.WebControls.ConsoleControls.SubmitAction
> {
> public SubmitWithReason()
> {
> }
>
> protected override void OnLoad(System.EventArgs e)
> {
> string reasonfunc =
> "<script language=\"JavaScript\">\n"+
> "function SG_setSubmitReason(strReason)\n"+
> "{\n"+
> " __CMS_PostbackForm.SubmitReason.value = strReason;\n"+
> " "+base.ActionJavascript+";\n"+
> "}\n"+
> "</script>";
>
> base.OnLoad( e );
>
> if (this.Available == true)
> {
> // create hidden "SubmitReason" case
> Page.RegisterHiddenField( "SubmitReason", "" );
> Page.RegisterClientScriptBlock( "SubmitReasonScript", reasonfunc );
> }
> }
>
> public override string ActionJavascript
> {
> get
> {
> string myPostBackString="";
> Posting currentPosting;
>
> currentPosting = CmsHttpContext.Current.Posting;
>
> if(currentPosting!=null)
> {
> myPostBackString =

"window.open('"+Page.Request.ApplicationPath+"/Utilities/GetSubmitReason.asp
x?" + currentPosting.QueryStringModeUpdate + "');";
> }
>
>
> return myPostBackString;
> }
> }
> }
>
>
> I find there is a problem. If I change a posting content, save and submit

it, after the submit click, enter the reason ok, the browser refreshes and
the posting reappears with the Page status: WaitingForEditorApproval as we
expected. But the problem happens when in the same session, I want to submit
another posting, after successfully enter the reason, the main screen
doesn't refresh and is frozen for an unacceptable length of time. But behind
it the posting status is already changed, you can check by open another
browser window and see the status of that posting has changed to
WaitingForEditorApproval. Sometimes if I am very lucky, it let me go through
with a few submits but most of the time, I cannot pass the second one. I
find the same thing happened for declining with reason, ie, I cannot decline
more than 2 postings before it is frozen.
>
> This only happens if you want to have the popup submit/decline reason.

Otherwise with the standard submit/decline (without reason), we can
submit/decline as many as we want.
>
> Thank you if you can help.
>
>
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com