I don't think you got what I tried to say: if you're persisting a parameter value, you're doing it wrong, very wrong. As a rule of thumb, I'd say that persisting parameter values is flat out wrong.

On Mon, 02 Dec 2013 09:21:02 -0200, John <j...@quivinco.com> wrote:

my grumble is having to define 2 members for a single value:

    @Parameter
    private Integer workIdParm;
    @Parameter
    private Integer venueIdParm;
    @Parameter
    private Integer reservationIdParm;

    @Property
    private Integer vendorId;
    @Persist
    private Integer workId;
    @Persist
    private Integer venueId;

and then I'm doing this:

    @SetupRender
    void setup() throws Exception {
        if (workIdParm != null) {
            workId = workIdParm;
        }
        if (reservationIdParm != null) {
            reservationId = reservationIdParm;
        }
        if (venueIdParm != null) {
            venueId = venueIdParm;
        }

Is there something neater than doing this? Like maybe capturing those initial parameter values with a constructor like method?

  ----- Original Message -----
  From: Thiago H de Paula Figueiredo
  To: Tapestry users
  Sent: Monday, December 02, 2013 11:00 AM
  Subject: Re: component paramter frustrations


  On Mon, 02 Dec 2013 07:21:27 -0200, John <j...@quivinco.com> wrote:

  > Hi,

  Hi!

  > I pass parameters to some of my componenets but they don't persist by
  > default

  And that's a very good thing. The less state you keep in memory, the
  better. You are the one who knows what should be persisted and what
shouldn't. Actually, almost 100% of the time it makes no sense to persist
  component parameters exactly because they're being passed from someone
else to them. If you need to persist something, it's generally in pages or
  services (through ApplicationStateManager).

  --
  Thiago H. de Paula Figueiredo
  Tapestry, Java and Hibernate consultant and developer
  http://machina.com.br
  Help me spend a whole month working on Tapestry bug fixes and
  improvements: http://igg.me/at/t5month

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


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
Help me spend a whole month working on Tapestry bug fixes and improvements: http://igg.me/at/t5month

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

Reply via email to