You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Shing Hing Man <ma...@yahoo.com> on 2006/12/19 16:45:23 UTC

Problem with InlineEditBox on persisted page property

I am using the component InlineEditBox, in Tapestry
4.1.2 snapshot,
to edit a persisted (with session scope) property
called description  on page TestInlineEditBox.
I have noticed the changes done to the property
description  is
lost if I leave the page TestInlineEditBox  and come
back to it later.
As the property description is persisted with scope
session,
I expect the changes made  to the property description
to be retained between requests.

It would be appreciated if someone could  give me a
pointer on this.

Here is my code.


public abstract class TestInlineEditBox extends
BasePage implements 
              PageBeginRenderListener{
  
	@Persist
	public abstract String getDescription();
	
	public abstract void setDescription(String desc);


	public void pageBeginRender(PageEvent event) {

		
		if (getDescription() == null){
			setDescription("Please edit me");
		}
		
	}	
}


TestInlineEditBox.html :
     
 <span >Description </span>:
          <Span jwcid="descriptionEB@InlineEditBox"
value="ognl:description"/> <br>
      
<a href="#" jwcid="@PageLink"
page="literal:Home">Home</a>

Shing




  

Home page :
  http://uk.geocities.com/matmsh/index.html


		
___________________________________________________________ 
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html

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


Re: Problem with InlineEditBox on persisted page property

Posted by Jesse Kuhnert <jk...@gmail.com>.
Not sure, but with the amount of emails flying around you'll have a
much better chance of this getting looked at if a jira issue is filed.

On 12/21/06, Shing Hing Man <ma...@yahoo.com> wrote:
> In (Tap 4.1.2) InlineEditBox.script :
>   <if expression="component.destroy">
>     dojo.event.connectOnce(${box}, "onSave",
> function(newValue, oldValue){
>         tapestry.bind("${component.updateUrl}",
> {"${component.clientId}":newValue}, true);
>     });
>     </if>
>
> where component.destroy is from
> AbstractWidget.isDestroy.
> When I run my TestInlineBox page in debug mode, I
> discovered that
> component.destroy is set to false. So the piece code
> that fires the event to update the page property
> description when button 'save' is clicked, is not
> rendered.
> That explains why the persisted page property
> description  does not keep its value between requests.
> It works as expected when I comment out the "if
> expression="component.destroy".
>
>
> When I run the TimeTracker application in debug mode,
> the  InlineBoxEditor component.destroy is true.
> In the javadoc of  AbstractWidget.isDestroy, it says
> it is set dynamically and also give
> an explanation, which I do not understand.
> http://tapestry.apache.org/tapestry4.1/apidocs/index.html
>
> My question is why for my  TestInLineBox page,
> component.destroy is set to false ?
>
> Thanks in advance for any help!
>
> Shing
>
>
>
>
>
> --- Shing Hing Man <ma...@yahoo.com> wrote:
>
> > I am using the component InlineEditBox, in Tapestry
> > 4.1.2 snapshot,
> > to edit a persisted (with session scope) property
> > called description  on page TestInlineEditBox.
> > I have noticed the changes done to the property
> > description  is
> > lost if I leave the page TestInlineEditBox  and come
> > back to it later.
> > As the property description is persisted with scope
> > session,
> > I expect the changes made  to the property
> > description
> > to be retained between requests.
> >
> > It would be appreciated if someone could  give me a
> > pointer on this.
> >
> > Here is my code.
> >
> >
> > public abstract class TestInlineEditBox extends
> > BasePage implements
> >               PageBeginRenderListener{
> >
> >       @Persist
> >       public abstract String getDescription();
> >
> >       public abstract void setDescription(String desc);
> >
> >
> >       public void pageBeginRender(PageEvent event) {
> >
> >
> >               if (getDescription() == null){
> >                       setDescription("Please edit me");
> >               }
> >
> >       }
> > }
> >
> >
> > TestInlineEditBox.html :
> >
> >  <span >Description </span>:
> >           <Span jwcid="descriptionEB@InlineEditBox"
> > value="ognl:description"/> <br>
> >
> > <a href="#" jwcid="@PageLink"
> > page="literal:Home">Home</a>
> >
> > Shing
> >
> >
> >
> >
> >
> >
> > Home page :
> >   http://uk.geocities.com/matmsh/index.html
> >
> >
> >
> >
> ___________________________________________________________
> >
> > The all-new Yahoo! Mail goes wherever you go - free
> > your email address from your Internet provider.
> > http://uk.docs.yahoo.com/nowyoucan.html
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail:
> > users-help@tapestry.apache.org
> >
> >
>
>
> Home page :
>   http://uk.geocities.com/matmsh/index.html
>
>
>
> ___________________________________________________________
> The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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


Re: Problem with InlineEditBox on persisted page property

Posted by Shing Hing Man <ma...@yahoo.com>.
In (Tap 4.1.2) InlineEditBox.script :
  <if expression="component.destroy">
    dojo.event.connectOnce(${box}, "onSave",
function(newValue, oldValue){
    	tapestry.bind("${component.updateUrl}",
{"${component.clientId}":newValue}, true);
    });
    </if>

where component.destroy is from
AbstractWidget.isDestroy. 
When I run my TestInlineBox page in debug mode, I
discovered that 
component.destroy is set to false. So the piece code
that fires the event to update the page property
description when button 'save' is clicked, is not
rendered. 
That explains why the persisted page property
description  does not keep its value between requests.
It works as expected when I comment out the "if
expression="component.destroy".


When I run the TimeTracker application in debug mode, 
the  InlineBoxEditor component.destroy is true. 
In the javadoc of  AbstractWidget.isDestroy, it says
it is set dynamically and also give 
an explanation, which I do not understand.
http://tapestry.apache.org/tapestry4.1/apidocs/index.html

My question is why for my  TestInLineBox page,
component.destroy is set to false ?

Thanks in advance for any help!

Shing

 



--- Shing Hing Man <ma...@yahoo.com> wrote:

> I am using the component InlineEditBox, in Tapestry
> 4.1.2 snapshot,
> to edit a persisted (with session scope) property
> called description  on page TestInlineEditBox.
> I have noticed the changes done to the property
> description  is
> lost if I leave the page TestInlineEditBox  and come
> back to it later.
> As the property description is persisted with scope
> session,
> I expect the changes made  to the property
> description
> to be retained between requests.
> 
> It would be appreciated if someone could  give me a
> pointer on this.
> 
> Here is my code.
> 
> 
> public abstract class TestInlineEditBox extends
> BasePage implements 
>               PageBeginRenderListener{
>   
> 	@Persist
> 	public abstract String getDescription();
> 	
> 	public abstract void setDescription(String desc);
> 
> 
> 	public void pageBeginRender(PageEvent event) {
> 
> 		
> 		if (getDescription() == null){
> 			setDescription("Please edit me");
> 		}
> 		
> 	}	
> }
> 
> 
> TestInlineEditBox.html :
>      
>  <span >Description </span>:
>           <Span jwcid="descriptionEB@InlineEditBox"
> value="ognl:description"/> <br>
>       
> <a href="#" jwcid="@PageLink"
> page="literal:Home">Home</a>
> 
> Shing
> 
> 
> 
> 
>   
> 
> Home page :
>   http://uk.geocities.com/matmsh/index.html
> 
> 
> 		
>
___________________________________________________________
> 
> The all-new Yahoo! Mail goes wherever you go - free
> your email address from your Internet provider.
> http://uk.docs.yahoo.com/nowyoucan.html
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail:
> users-help@tapestry.apache.org
> 
> 


Home page :
  http://uk.geocities.com/matmsh/index.html


		
___________________________________________________________ 
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html

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