You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Da...@ingenix.com on 2006/02/23 16:28:25 UTC

remove ASO setter?

Hello all,  
 
I am using the ASO (Application State Object) feature of Tapestry 4.
Mostly it is working very well.  I have a problem with one property
though that seems to require special handling that my other ASOs don't.

 
I have in my hivemind.xml:
<module id="ices" version="1.0.0">
  <contribution configuration-id="tapestry.state.ApplicationObjects">
    .. other ASOs that seem to work fine...
 
    <!-- The current presentation view object -->    
    <state-object name="presentationView" scope="session">
      <create-instance
class="com.ingenix.freya.api.presentation.metadata.PresentationView"/>
    </state-object>  
  </contribution>
</module>

Then in my Java file for the page that uses this:
  @InjectObject("presentationView")
  public abstract PresentationView getPresentationView();
  public abstract void setPresentationView(PresentationView pPv);

I have to call the setter from a method that is called from a trigger
method in a feeder page to initialize the view object (presentationView)
used by the page.  
 
The problem is: when I hit the page I get a ApplicationRuntimeException
Property presentationView should be read-only; remove method public
abstract void
com.ingenix.freya.web.pages.presentation.PresentationDataPage.setPresent
ationView(com.ingenix.freya.api.presentation.metadata.PresentationView).
 
I need the view to be an ASO because it used on other pages that cascade
from this page (popups, etc).  Passing it around would be cumbersome.  
 
Any clues as to why it chokes and needs to be read-only?
 
Regards, 
David Harvey
Ingenix, Inc.  
 
 
 

"Secure Server" made the following
 annotations on 02/23/2006 09:28:27 AM
------------------------------"This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately."
==============================

Re: remove ASO setter?

Posted by Sebastiaan van Erk <se...@sebster.com>.
The comment <!-- The current presetnation view object --> is not quite 
in line with the actual behavior. When you call the getter in your page, 
hivemind creates an instance of your class for you; you cannot set a 
session scope object, you can only get it (and if it does not exist it 
is created).

A simple workaround is to make UserSession class with a presentationView 
property in it that you can set and get.

Regards,
Sebastiaan

David.Harvey@ingenix.com wrote:
> Hello all,  
>  
> I am using the ASO (Application State Object) feature of Tapestry 4.
> Mostly it is working very well.  I have a problem with one property
> though that seems to require special handling that my other ASOs don't.
> 
>  
> I have in my hivemind.xml:
> <module id="ices" version="1.0.0">
>   <contribution configuration-id="tapestry.state.ApplicationObjects">
>     .. other ASOs that seem to work fine...
>  
>     <!-- The current presentation view object -->    
>     <state-object name="presentationView" scope="session">
>       <create-instance
> class="com.ingenix.freya.api.presentation.metadata.PresentationView"/>
>     </state-object>  
>   </contribution>
> </module>
> 
> Then in my Java file for the page that uses this:
>   @InjectObject("presentationView")
>   public abstract PresentationView getPresentationView();
>   public abstract void setPresentationView(PresentationView pPv);
> 
> I have to call the setter from a method that is called from a trigger
> method in a feeder page to initialize the view object (presentationView)
> used by the page.  
>  
> The problem is: when I hit the page I get a ApplicationRuntimeException
> Property presentationView should be read-only; remove method public
> abstract void
> com.ingenix.freya.web.pages.presentation.PresentationDataPage.setPresent
> ationView(com.ingenix.freya.api.presentation.metadata.PresentationView).
>  
> I need the view to be an ASO because it used on other pages that cascade
> from this page (popups, etc).  Passing it around would be cumbersome.  
>  
> Any clues as to why it chokes and needs to be read-only?
>  
> Regards, 
> David Harvey
> Ingenix, Inc.  
>  
>  
>  
> 
> "Secure Server" made the following
>  annotations on 02/23/2006 09:28:27 AM
> ------------------------------"This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately."
> ==============================

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


RE: remove ASO setter?

Posted by James Carman <ja...@carmanconsulting.com>.
Could you not just set a property on your ASO and then forward to the other
page where it could look up that property?  Also, did you mean to use
@InjectState and not @InjectObject?

 

-----Original Message-----
From: David.Harvey@ingenix.com [mailto:David.Harvey@ingenix.com] 
Sent: Thursday, February 23, 2006 10:28 AM
To: tapestry-user@jakarta.apache.org
Subject: remove ASO setter?

Hello all,  
 
I am using the ASO (Application State Object) feature of Tapestry 4.
Mostly it is working very well.  I have a problem with one property
though that seems to require special handling that my other ASOs don't.

 
I have in my hivemind.xml:
<module id="ices" version="1.0.0">
  <contribution configuration-id="tapestry.state.ApplicationObjects">
    .. other ASOs that seem to work fine...
 
    <!-- The current presentation view object -->    
    <state-object name="presentationView" scope="session">
      <create-instance
class="com.ingenix.freya.api.presentation.metadata.PresentationView"/>
    </state-object>  
  </contribution>
</module>

Then in my Java file for the page that uses this:
  @InjectObject("presentationView")
  public abstract PresentationView getPresentationView();
  public abstract void setPresentationView(PresentationView pPv);

I have to call the setter from a method that is called from a trigger
method in a feeder page to initialize the view object (presentationView)
used by the page.  
 
The problem is: when I hit the page I get a ApplicationRuntimeException
Property presentationView should be read-only; remove method public
abstract void
com.ingenix.freya.web.pages.presentation.PresentationDataPage.setPresent
ationView(com.ingenix.freya.api.presentation.metadata.PresentationView).
 
I need the view to be an ASO because it used on other pages that cascade
from this page (popups, etc).  Passing it around would be cumbersome.  
 
Any clues as to why it chokes and needs to be read-only?
 
Regards, 
David Harvey
Ingenix, Inc.  
 
 
 

"Secure Server" made the following
 annotations on 02/23/2006 09:28:27 AM
------------------------------"This e-mail, including attachments, may
include confidential and/or proprietary information, and may be used only by
the person or entity to which it is addressed. If the reader of this e-mail
is not the intended recipient or his or her authorized agent, the reader is
hereby notified that any dissemination, distribution or copying of this
e-mail is prohibited. If you have received this e-mail in error, please
notify the sender by replying to this message and delete this e-mail
immediately."
==============================



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