You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by harishpatarla <ha...@gmail.com> on 2013/01/31 07:54:35 UTC

Disable operations caused due to back and forward buttons

Hi,

I am working on a web app and in this we add test xml scripts to run them.
I have a page ViewTest.tml(test/view) and this page has Run button to
trigger the execution which then navigates to next page
(/execution/run/progress).After it is done we navigate to next page
ShowResults.

Now if the user wanted to see the test script he has executed and uses back
button to navigate to ViewTest page it redirects first to
/execution/run/progress and the same test script gets executed again.Now I
could go back and see the test script.

What i want to avoid here is when the user clicks back button and navigates
to /execution/run/progress it should not execute the test script.

I do not want to disable the back button but stop the operation that is
being done when a user uses back button and navigates to that page




--
View this message in context: http://tapestry.1045711.n5.nabble.com/Disable-operations-caused-due-to-back-and-forward-buttons-tp5719689.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Disable operations caused due to back and forward buttons

Posted by harishpatarla <ha...@gmail.com>.
Yes Slimer.
I wanted to know if writing some javascript in my executionProgress.tml will
help?

If yes, Can you please tell me where i can put that in my
executionProgress.tml . Here is it:

<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
title="Search Testable Entity">

<div id="anyID" t:type="Any" environment="environment"
testsToRun="addedTestableEntities"
t:mixins="testExecutionProgressDisplay"></div>


</t:layout>


The java script that i wanted to use is..

script type = "text/javascript" >

function preventBack(){window.history.forward();}

setTimeout("preventBack()", 0);

window.onunload=function(){null};





--
View this message in context: http://tapestry.1045711.n5.nabble.com/Disable-operations-caused-due-to-back-and-forward-buttons-tp5719689p5719728.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Disable operations caused due to back and forward buttons

Posted by Steve Eynon <st...@alienfactory.co.uk>.
As it's a server side process you're trying to protect, store a flag
in the session when the user has clicked "Run". Then before you kick
off the process again, check the status of the flag.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Disable operations caused due to back and forward buttons

Posted by harishpatarla <ha...@gmail.com>.
Thanks a lot for your response Bob.

The below code i have in ViewTest.tml(test/view)

  ${message:label.markup} :   <br/> <br/>
     <pre t:type="syntaxhighlighting/syntaxhighlighter"
language="literal:xml" > <t:outputraw value="prop:markup"/> </pre>
     
     <br/> <br/>



     <input t:id="submitCopy" type="submit" value="Copy"/>
     <input t:id="submitRun" type="submit" value="Run"/>


       <t:if test="showOptions">
 			<input t:id="submitUpdate" type="submit" value="Update"/>
     		<input t:id="submitDelete" type="submit" value="Delete"/>
     	
      	</t:if>




      	 <t:if test="fromCreate">
         <input type="button" value="Back to Home"
onclick="location.href='../start';" />
      </t:if>


When we click on Run button as shown in above code we navigate to
ExecutionProgress.tml

<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
title="Search Testable Entity">

<div id="anyID" t:type="Any" environment="environment"
testsToRun="addedTestableEntities"
t:mixins="testExecutionProgressDisplay"></div>


</t:layout>


Can i write some java script in the ExecutionProgress.tml such that this
page is shown and only when the user clicks on Run Button and executes the
test case(But not when user uses back button to see the test script which he
has executed and this takes him first to /execution/run/progress page and
executes the test case again and then he/she will be able to see the test
case).

Plz help me out with some thing here.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Disable-operations-caused-due-to-back-and-forward-buttons-tp5719689p5719726.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Disable operations caused due to back and forward buttons

Posted by Bob Harner <bo...@gmail.com>.
You haven't said what mechanisms you're using to navigate between pages.
But my guess is that to achieve the behavior you want you'll need to
eliminate the middle page and put its code into the first page, with the
Run button on the first page causing a form submission followed by a
redirect to the last page. This leaves you with a standard
Post-Redirect-Get pattern, which ensures the back button will be safe. Then
you're only challenge is to add some kind of progress indicator to the form
submission action on the first page, perhaps with JavaScript.
On Jan 31, 2013 1:55 AM, "harishpatarla" <ha...@gmail.com> wrote:

> Hi,
>
> I am working on a web app and in this we add test xml scripts to run them.
> I have a page ViewTest.tml(test/view) and this page has Run button to
> trigger the execution which then navigates to next page
> (/execution/run/progress).After it is done we navigate to next page
> ShowResults.
>
> Now if the user wanted to see the test script he has executed and uses back
> button to navigate to ViewTest page it redirects first to
> /execution/run/progress and the same test script gets executed again.Now I
> could go back and see the test script.
>
> What i want to avoid here is when the user clicks back button and navigates
> to /execution/run/progress it should not execute the test script.
>
> I do not want to disable the back button but stop the operation that is
> being done when a user uses back button and navigates to that page
>
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Disable-operations-caused-due-to-back-and-forward-buttons-tp5719689.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>