Loading...

user@struts.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: child window reseting the values of parent window Piyush Kumar Fri Feb 03 04:02:47 2012

When I mentioned "page source" in my last email, I meant the HTML source
generated on the client side which you can see in the browser (right click
the page and click view page source).

Thanks and regards,
Piyush

On Thu, Jan 26, 2012 at 12:10 PM, Piyush Kumar <[EMAIL PROTECTED]>wrote:

> Please read my last reply and note that the hidden element may also look
> like -
>
> <html:hidden name="Globals.TRANSACTION_TOKEN_KEY" scope="session" />
>
> in your JSP which eventually will be converted to the HTML
>
> <input type="hidden" ....
>
> which will appear in the page source. If you are getting  a message that
> the form has already been submitted, it means that you have sent another
> request with the same token earlier. Thus, it boils down to the fact that
> you have same tokens for the pop up and the parent. Try to change this as
> per the scope of changes in your project.
>
> Piyush
>
> On Thu, Jan 26, 2012 at 11:45 AM, Piyush Kumar <[EMAIL PROTECTED]>wrote:
>
>> There must be following in the forms on the both window.
>>
>> <input type="hidden"
>> name="<%=org.apache.struts.taglib.html.Constants.TOKEN_KEY%>"
>> value="<bean:write name="<%=Globals.TRANSACTION_TOKEN_KEY%>"/>">
>>
>> When the pop up appears, find the above described element in the page
>> source, you will find that on both the page such elements are identical,
>> which is not desirable. For every request new token is generated and stored
>> as a session attribute with the key Globals.TRANSACTION_TOKEN_KEY. We
>> have to make sure that this generated token is different for the parent and
>> the child window.
>>
>> Since, for every request, a new token is generated by the action which
>> renders the form, try to load the parent and the pop up through different
>> actions.
>>
>> Think about it and reply,
>> Piyush
>>
>> On Wed, Jan 25, 2012 at 10:14 PM, Arpan <[EMAIL PROTECTED]> wrote:
>>
>>> Actually what is happening that when my child window submits, it has a
>>> specific struts token.
>>> When I close the child and try to submit the parent window, it shows that
>>> the form has already been submitted.
>>>  So can any one know, how  to solve this problem.
>>>
>>> Thanks
>>>
>>>
>>> On Mon, Jan 23, 2012 at 12:56 AM, Arpan <[EMAIL PROTECTED]> wrote:
>>>
>>> > Hi Piyush,
>>> >
>>> > If I close my child window and try to submit the parent one, submit
>>> button
>>> > doesn't work.
>>> > There's no JS error shown in the browser.
>>> > But if I reload the parent window,submit button works .
>>> >
>>> > Thanks
>>> >
>>> >
>>> >
>>> > On Sun, Jan 22, 2012 at 1:58 PM, Piyush Kumar <[EMAIL PROTECTED]
>>> >wrote:
>>> >
>>> >> why are you reloading the parent window on child window close. i think
>>> >> your
>>> >> problem can be solved with pure javascript. please describe it more.
>>> >>
>>> >> On Sat, Jan 21, 2012 at 9:52 PM, Arpan <[EMAIL PROTECTED]>
>>> wrote:
>>> >>
>>> >> > Hi,
>>> >> >
>>> >> > My requirement is like as follows:
>>> >> >
>>> >> > User can edit fields in a page. This page will have a link, which
>>> will
>>> >> open
>>> >> > a child window, which will work independently.
>>> >> > The child window uses different Action classes and different submit
>>> flow
>>> >> > altogether.
>>> >> >
>>> >> > But after closing the child window, the user can again start
>>> editing the
>>> >> > parent page fields and should submit also.
>>> >> >
>>> >> > If I reload the parent page,while closing the child window, one pop
>>> up
>>> >> > warning message comes out and all the parent window field values get
>>> >> reset,
>>> >> > which are not desirable.
>>> >> >
>>> >> > Can any one knows how to do it. I am using Struts1.
>>> >> >
>>> >> > Thanks
>>> >> >
>>> >>
>>> >
>>> >
>>>
>>
>>
>