You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Perkins, Nate-P63196" <Na...@gdc4s.com> on 2008/08/01 23:48:25 UTC

Jscookmenu/trinidad problem

Our project uses trinidad components exclusively in our webapp with the
exception of the tomahawk jscookmenu.

We've been trying to implement a javascript solution in our pages to
notify the user if he/she attempts to perform an action when he/she
currently has some data record in 'Edit Mode'.  

We used window.onbeforeunload to show the user a confirmation dialog
conditionally based on a flag we set through another js function.  This
seemed to work whenever a trinidad component was used to initiate the
action with the following steps occurring:
1. User enters edit mode
2. User clicks some other button
3. User sees edit mode confirmation dialog
4. User hits 'Cancel'
5. User resumes editing

But we discovered that if the jscookmenu originated the action that
things didn't' work as expected with the following happening:
1. User enters edit mode
2. User clicks the jscookmenu menu item
3. User sees edit mode confirmation dialog
4. User hits 'Cancel'
5. User resumes editing
6. User hits another button
7. User is navigated to jscookmenu menu item target

I don't understand why Trinidad's javascript responds well to the
onbeforeunload action but the jscookmenu does not.

So I have a few questions,
Is this a problem with jscookmenu and the Trinidad PPR interaction?
Is there a better way to get the behavior we desire?
If what we are doing makes sense, would the easiest solution be to just
modify the jscookmenu javascript to get around this 'bug'?

Nate Perkins
General Dynamics C4 Systems

> This email message is for the sole use of the intended recipient(s)
> and may contain GDC4S
>  confidential or privileged information. Any unauthorized review, use,
> disclosure or distribution
>  is prohibited. If you are not an intended recipient, please contact
> the sender by reply email and
>  destroy all copies of the original message.
> 
> 

Re: Jscookmenu/trinidad problem

Posted by Walter Mourão <wa...@gmail.com>.
Sorry, no clues.

On Tue, Aug 5, 2008 at 11:21 AM, Perkins, Nate-P63196 <
Nate.Perkins@gdc4s.com> wrote:

>  Thanks Walter,
>
> I think you are right about the state.  I think that the jscookmenu is
> telling the server to create a new view but then I short-circuit the
> client-side page-unloading with my javascript.  Then when another button or
> link is pressed later on, JSF just ignores the request since it believes
> that a new view is being served and renders that instead.
>
> I know I can edit the jscookmenu javascript to be aware of my edit mode
> considerations but I still don't understand what the trinidad components are
> doing differently that they don't cause the same behavior.  Do you have any
> clues about that?
>
>
> Nate Perkins
> General Dynamics C4 Systems
>
> *This email message is for the sole use of the intended recipient(s) and
> may contain GDC4S*
> * confidential or privileged information. Any unauthorized review, use,
> disclosure or distribution*
> * is prohibited. If you are not an intended recipient, please contact the
> sender by reply email and*
> * destroy all copies of the original message*.
>
>
>  ------------------------------
> *From:* Walter Mourão [mailto:walter.mourao@gmail.com]
> *Sent:* Tuesday, August 05, 2008 4:08 AM
> *To:* MyFaces Discussion
> *Subject:* Re: Jscookmenu/trinidad problem
>
>  Hi Nate,
> I don't use jscookmenu but I think your problem is related with some kind
> of state saved by jscookmenu when the user clicks the menu link. Maybe
> there is a way to intercept the click in jscookmenu and execute the
> validation/confirmation at that time.
>
> On Mon, Aug 4, 2008 at 8:37 PM, Perkins, Nate-P63196 <
> Nate.Perkins@gdc4s.com> wrote:
>
>>  Can anybody help me with this problem?
>>
>>  ------------------------------
>>  *From:* Perkins, Nate-P63196 [mailto:Nate.Perkins@gdc4s.com]
>> *Sent:* Friday, August 01, 2008 2:48 PM
>> *To:* users@myfaces.apache.org
>> *Subject:* Jscookmenu/trinidad problem
>>
>>  Our project uses trinidad components exclusively in our webapp with the
>> exception of the tomahawk jscookmenu.
>>
>> We've been trying to implement a javascript solution in our pages to
>> notify the user if he/she attempts to perform an action when he/she
>> currently has some data record in 'Edit Mode'.
>>
>> We used window.onbeforeunload to show the user a confirmation dialog
>> conditionally based on a flag we set through another js function.  This
>> seemed to work whenever a trinidad component was used to initiate the action
>> with the following steps occurring:
>>
>> 1. User enters edit mode
>> 2. User clicks some other button
>> 3. User sees edit mode confirmation dialog
>> 4. User hits 'Cancel'
>> 5. User resumes editing
>>
>> But we discovered that if the jscookmenu originated the action that things
>> didn't' work as expected with the following happening:
>>
>> 1. User enters edit mode
>> 2. User clicks the jscookmenu menu item
>> 3. User sees edit mode confirmation dialog
>> 4. User hits 'Cancel'
>> 5. User resumes editing
>> 6. User hits another button
>> 7. User is navigated to jscookmenu menu item target
>>
>> I don't understand why Trinidad's javascript responds well to the
>> onbeforeunload action but the jscookmenu does not.
>>
>> So I have a few questions,
>> Is this a problem with jscookmenu and the Trinidad PPR interaction?
>> Is there a better way to get the behavior we desire?
>> If what we are doing makes sense, would the easiest solution be to just
>> modify the jscookmenu javascript to get around this 'bug'?
>>
>> Nate Perkins
>> General Dynamics C4 Systems
>>
>> *This email message is for the sole use of the intended recipient(s) and
>> may contain GDC4S*
>> * confidential or privileged information. Any unauthorized review, use,
>> disclosure or distribution*
>> * is prohibited. If you are not an intended recipient, please contact the
>> sender by reply email and*
>> * destroy all copies of the original message*.
>>
>>
>
>
> --
> Walter Mourão
> http://waltermourao.com.br
> http://waltermourao.blogspot.com
> http://arcadian.com.br
>
>


-- 
Walter Mourão
http://waltermourao.com.br
http://waltermourao.blogspot.com
http://arcadian.com.br

RE: Jscookmenu/trinidad problem

Posted by "Perkins, Nate-P63196" <Na...@gdc4s.com>.
Thanks Walter,
 
I think you are right about the state.  I think that the jscookmenu is telling the server to create a new view but then I short-circuit the client-side page-unloading with my javascript.  Then when another button or link is pressed later on, JSF just ignores the request since it believes that a new view is being served and renders that instead.
 
I know I can edit the jscookmenu javascript to be aware of my edit mode considerations but I still don't understand what the trinidad components are doing differently that they don't cause the same behavior.  Do you have any clues about that?
 

Nate Perkins 
General Dynamics C4 Systems 

This email message is for the sole use of the intended recipient(s) and may contain GDC4S 
 confidential or privileged information. Any unauthorized review, use, disclosure or distribution 
 is prohibited. If you are not an intended recipient, please contact the sender by reply email and 
 destroy all copies of the original message. 

 

________________________________

From: Walter Mourão [mailto:walter.mourao@gmail.com] 
Sent: Tuesday, August 05, 2008 4:08 AM
To: MyFaces Discussion
Subject: Re: Jscookmenu/trinidad problem


Hi Nate,
I don't use jscookmenu but I think your problem is related with some kind of state saved by jscookmenu when the user clicks the menu link. Maybe there is a way to intercept the click in jscookmenu and execute the validation/confirmation at that time.


On Mon, Aug 4, 2008 at 8:37 PM, Perkins, Nate-P63196 <Na...@gdc4s.com> wrote:


	Can anybody help me with this problem? 
	 
________________________________

	From: Perkins, Nate-P63196 [mailto:Nate.Perkins@gdc4s.com] 
	Sent: Friday, August 01, 2008 2:48 PM
	To: users@myfaces.apache.org
	Subject: Jscookmenu/trinidad problem
	
	

	Our project uses trinidad components exclusively in our webapp with the exception of the tomahawk jscookmenu. 

	We've been trying to implement a javascript solution in our pages to notify the user if he/she attempts to perform an action when he/she currently has some data record in 'Edit Mode'.  

	We used window.onbeforeunload to show the user a confirmation dialog conditionally based on a flag we set through another js function.  This seemed to work whenever a trinidad component was used to initiate the action with the following steps occurring:

	1. User enters edit mode 
	2. User clicks some other button 
	3. User sees edit mode confirmation dialog 
	4. User hits 'Cancel' 
	5. User resumes editing 

	But we discovered that if the jscookmenu originated the action that things didn't' work as expected with the following happening:

	1. User enters edit mode 
	2. User clicks the jscookmenu menu item 
	3. User sees edit mode confirmation dialog 
	4. User hits 'Cancel' 
	5. User resumes editing 
	6. User hits another button 
	7. User is navigated to jscookmenu menu item target 

	I don't understand why Trinidad's javascript responds well to the onbeforeunload action but the jscookmenu does not. 

	So I have a few questions, 
	Is this a problem with jscookmenu and the Trinidad PPR interaction? 
	Is there a better way to get the behavior we desire? 
	If what we are doing makes sense, would the easiest solution be to just modify the jscookmenu javascript to get around this 'bug'?

	Nate Perkins 
	General Dynamics C4 Systems 

	This email message is for the sole use of the intended recipient(s) and may contain GDC4S 
	 confidential or privileged information. Any unauthorized review, use, disclosure or distribution 
	 is prohibited. If you are not an intended recipient, please contact the sender by reply email and 
	 destroy all copies of the original message. 





-- 
Walter Mourão
http://waltermourao.com.br
http://waltermourao.blogspot.com
http://arcadian.com.br



Re: Jscookmenu/trinidad problem

Posted by Walter Mourão <wa...@gmail.com>.
Hi Nate,
I don't use jscookmenu but I think your problem is related with some kind of
state saved by jscookmenu when the user clicks the menu link. Maybe there is
a way to intercept the click in jscookmenu and execute the
validation/confirmation at that time.

On Mon, Aug 4, 2008 at 8:37 PM, Perkins, Nate-P63196 <Nate.Perkins@gdc4s.com
> wrote:

>  Can anybody help me with this problem?
>
>  ------------------------------
>  *From:* Perkins, Nate-P63196 [mailto:Nate.Perkins@gdc4s.com]
> *Sent:* Friday, August 01, 2008 2:48 PM
> *To:* users@myfaces.apache.org
> *Subject:* Jscookmenu/trinidad problem
>
>  Our project uses trinidad components exclusively in our webapp with the
> exception of the tomahawk jscookmenu.
>
> We've been trying to implement a javascript solution in our pages to notify
> the user if he/she attempts to perform an action when he/she currently has
> some data record in 'Edit Mode'.
>
> We used window.onbeforeunload to show the user a confirmation dialog
> conditionally based on a flag we set through another js function.  This
> seemed to work whenever a trinidad component was used to initiate the action
> with the following steps occurring:
>
> 1. User enters edit mode
> 2. User clicks some other button
> 3. User sees edit mode confirmation dialog
> 4. User hits 'Cancel'
> 5. User resumes editing
>
> But we discovered that if the jscookmenu originated the action that things
> didn't' work as expected with the following happening:
>
> 1. User enters edit mode
> 2. User clicks the jscookmenu menu item
> 3. User sees edit mode confirmation dialog
> 4. User hits 'Cancel'
> 5. User resumes editing
> 6. User hits another button
> 7. User is navigated to jscookmenu menu item target
>
> I don't understand why Trinidad's javascript responds well to the
> onbeforeunload action but the jscookmenu does not.
>
> So I have a few questions,
> Is this a problem with jscookmenu and the Trinidad PPR interaction?
> Is there a better way to get the behavior we desire?
> If what we are doing makes sense, would the easiest solution be to just
> modify the jscookmenu javascript to get around this 'bug'?
>
> Nate Perkins
> General Dynamics C4 Systems
>
> *This email message is for the sole use of the intended recipient(s) and
> may contain GDC4S*
> * confidential or privileged information. Any unauthorized review, use,
> disclosure or distribution*
> * is prohibited. If you are not an intended recipient, please contact the
> sender by reply email and*
> * destroy all copies of the original message*.
>
>


-- 
Walter Mourão
http://waltermourao.com.br
http://waltermourao.blogspot.com
http://arcadian.com.br

RE: Jscookmenu/trinidad problem

Posted by "Perkins, Nate-P63196" <Na...@gdc4s.com>.
Can anybody help me with this problem? 
 
________________________________

From: Perkins, Nate-P63196 [mailto:Nate.Perkins@gdc4s.com] 
Sent: Friday, August 01, 2008 2:48 PM
To: users@myfaces.apache.org
Subject: Jscookmenu/trinidad problem



Our project uses trinidad components exclusively in our webapp with the
exception of the tomahawk jscookmenu. 

We've been trying to implement a javascript solution in our pages to
notify the user if he/she attempts to perform an action when he/she
currently has some data record in 'Edit Mode'.  

We used window.onbeforeunload to show the user a confirmation dialog
conditionally based on a flag we set through another js function.  This
seemed to work whenever a trinidad component was used to initiate the
action with the following steps occurring:

1. User enters edit mode 
2. User clicks some other button 
3. User sees edit mode confirmation dialog 
4. User hits 'Cancel' 
5. User resumes editing 

But we discovered that if the jscookmenu originated the action that
things didn't' work as expected with the following happening:

1. User enters edit mode 
2. User clicks the jscookmenu menu item 
3. User sees edit mode confirmation dialog 
4. User hits 'Cancel' 
5. User resumes editing 
6. User hits another button 
7. User is navigated to jscookmenu menu item target 

I don't understand why Trinidad's javascript responds well to the
onbeforeunload action but the jscookmenu does not. 

So I have a few questions, 
Is this a problem with jscookmenu and the Trinidad PPR interaction? 
Is there a better way to get the behavior we desire? 
If what we are doing makes sense, would the easiest solution be to just
modify the jscookmenu javascript to get around this 'bug'?

Nate Perkins 
General Dynamics C4 Systems 

This email message is for the sole use of the intended recipient(s) and
may contain GDC4S 
 confidential or privileged information. Any unauthorized review, use,
disclosure or distribution 
 is prohibited. If you are not an intended recipient, please contact the
sender by reply email and 
 destroy all copies of the original message.