Java

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Problem with parameters of a custom component (Tapestry 4.01)

    6 answers - 1262 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi,
    I am having problems binding a property on my page to a parameter in my
    component. The following does not work
    I have a CategoryListComponent as follows
    <component id="categoryListComponent" type="CategoryListComponent">
    <binding name="Store" value="storeLocation"/>
    </component>
    my CategoryList.java I have
    public abstract void setStoreLocation(Location storeLocation);
    public abstract Location getStoreLocation();
    If however I change it as follows, it works fine. The storeLocation is
    passed into the component.
    <component id="categoryListComponent" type="CategoryListComponent">
    <binding name="Store" value="Store"/>
    </component>
    my CategoryList.java this time I have
    private Location Store;
    public void setLStore(Location Store) {
    Store = Store;
    }
    public Location getLStore() {
    return Store;
    }
    I dont understand why the Location wont be passed through if it declared
    as abstract. Any help would be great
    Regards
    Brian
    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
  • No.1 | | 1506 bytes | |

    Brian Doherty wrote:

    Hi,

    I am having problems binding a property on my page to a parameter in my
    component. The following does not work

    can you be more specific. "Does not work" is somehow general

    I have a CategoryListComponent as follows

    <component id="categoryListComponent" type="CategoryListComponent">
    <binding name="Store" value="storeLocation"/>
    </component>

    my CategoryList.java I have

    public abstract void setStoreLocation(Location storeLocation);
    public abstract Location getStoreLocation();

    If however I change it as follows, it works fine. The storeLocation is
    passed into the component.

    <component id="categoryListComponent" type="CategoryListComponent">
    <binding name="Store" value="Store"/>
    </component>

    my CategoryList.java this time I have

    private Location Store;
    public void setLStore(Location Store) {
    Store = Store;
    }
    public Location getLStore() {
    return Store;
    }

    I dont understand why the Location wont be passed through if it declared
    as abstract. Any help would be great

    Regards
    Brian

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
  • No.2 | | 2829 bytes | |

    Sorry. What I mean by does not work is that getLStore() in my
    component is null after the component renders.
    When I use the updated code below the storeLocation is passed through to
    the component and getLStore() contains the location I passed in
    from the page.
    It does not like it when I use abstract getters and setters but I dont
    understand why.

    Thanks
    Brian

    Ron Piterman wrote:
    Brian Doherty wrote:
    >>

    >Hi,
    >>

    >I am having problems binding a property on my page to a parameter in
    >my component. The following does not work
    >

    can you be more specific. "Does not work" is somehow general
    >
    >>

    >I have a CategoryListComponent as follows
    >>

    ><component id="categoryListComponent" type="CategoryListComponent">
    ><binding name="Store" value="storeLocation"/>
    ></component>
    >>
    >>

    >my CategoryList.java I have
    >>

    >public abstract void setStoreLocation(Location storeLocation);
    >public abstract Location getStoreLocation();
    >>
    >>

    >If however I change it as follows, it works fine. The storeLocation
    >is passed into the component.
    >>

    ><component id="categoryListComponent" type="CategoryListComponent">
    ><binding name="Store" value="Store"/>
    ></component>
    >>
    >>

    >my CategoryList.java this time I have
    >>

    >private Location Store;
    >public void setLStore(Location Store) {
    >Store = Store;
    >}
    >public Location getLStore() {
    >return Store;
    >}
    >>

    >I dont understand why the Location wont be passed through if it
    >declared as abstract. Any help would be great
    >>

    >Regards
    >Brian
    >>

    >
    >To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    >For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
    >>
    >>

    >
    >


    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
  • No.3 | | 3129 bytes | |

    :)

    Tapestry uses a pool to store page instances. While rendering it is safe
    to use instance variables but you have to make sure they are reset,
    preferrably in either pageDetached or pageAttached events.
    If you don't reset them, information can be shared between many users of
    your site, but not by all, since they might get another instance from
    the pool.

    When using abstract properties, tapestry does the initialization work
    for you.

    Hope that helps,
    Ron

    Brian Doherty wrote:
    Sorry. What I mean by does not work is that getLStore() in my
    component is null after the component renders.
    When I use the updated code below the storeLocation is passed through to
    the component and getLStore() contains the location I passed in
    from the page.
    It does not like it when I use abstract getters and setters but I dont
    understand why.

    Thanks
    Brian

    Ron Piterman wrote:

    >Brian Doherty wrote:
    >>


    Hi,

    I am having problems binding a property on my page to a parameter in
    my component. The following does not work
    >>
    >>

    >can you be more specific. "Does not work" is somehow general
    >>


    I have a CategoryListComponent as follows

    <component id="categoryListComponent" type="CategoryListComponent">
    <binding name="Store" value="storeLocation"/>
    </component>

    my CategoryList.java I have

    public abstract void setStoreLocation(Location storeLocation);
    public abstract Location getStoreLocation();

    If however I change it as follows, it works fine. The storeLocation
    is passed into the component.

    <component id="categoryListComponent" type="CategoryListComponent">
    <binding name="Store" value="Store"/>
    </component>

    my CategoryList.java this time I have

    private Location Store;
    public void setLStore(Location Store) {
    Store = Store;
    }
    public Location getLStore() {
    return Store;
    }

    I dont understand why the Location wont be passed through if it
    declared as abstract. Any help would be great

    Regards
    Brian

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org


    >>
    >>

    >
    >To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    >For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
    >>


    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
  • No.4 | | 3878 bytes | |

    Hi,
    Yes, I understand what you are saying here. I do not understand the
    following. If I use instance variables to pass the storeLocation into my
    component it works fine. storeLocation is passed through to the
    component and getLStore() contains the location I passed in
    from the page. If however I use an abstract property to pass the
    storeLocation into my component, storeLocation is not passed into the
    component ie. getStoreLocation() is null

    Thanks
    Brian

    Ron Piterman wrote:
    :)

    Tapestry uses a pool to store page instances. While rendering it is
    safe to use instance variables but you have to make sure they are
    reset, preferrably in either pageDetached or pageAttached events.
    If you don't reset them, information can be shared between many users
    of your site, but not by all, since they might get another instance
    from the pool.

    When using abstract properties, tapestry does the initialization work
    for you.

    Hope that helps,
    Ron
    >
    >
    >

    Brian Doherty wrote:
    >Sorry. What I mean by does not work is that getLStore() in
    >my component is null after the component renders.
    >When I use the updated code below the storeLocation is passed through
    >to the component and getLStore() contains the location I
    >passed in from the page.
    >It does not like it when I use abstract getters and setters but I
    >dont understand why.
    >>

    >Thanks
    >Brian
    >>
    >>

    >Ron Piterman wrote:
    >>

    Brian Doherty wrote:

    Hi,

    I am having problems binding a property on my page to a parameter
    in my component. The following does not work

    can you be more specific. "Does not work" is somehow general

    I have a CategoryListComponent as follows

    <component id="categoryListComponent" type="CategoryListComponent">
    <binding name="Store" value="storeLocation"/>
    </component>

    my CategoryList.java I have

    public abstract void setStoreLocation(Location storeLocation);
    public abstract Location getStoreLocation();

    If however I change it as follows, it works fine. The storeLocation
    is passed into the component.

    <component id="categoryListComponent" type="CategoryListComponent">
    <binding name="Store" value="Store"/>
    </component>

    my CategoryList.java this time I have

    private Location Store;
    public void setLStore(Location Store) {
    Store = Store;
    }
    public Location getLStore() {
    return Store;
    }

    I dont understand why the Location wont be passed through if it
    declared as abstract. Any help would be great

    Regards
    Brian

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

    >>
    >>

    >
    >To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    >For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
    >>
    >>

    >
    >


    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
  • No.5 | | 4349 bytes | |

    Is it an ExternalPage parameter that you are trying to access in
    pageValidate()/pageBeginRender() ?

    I remember having trouble with the order of callbacks for external pages.
    You might find that the you are accessing the parameter before
    activateExternalPage() has been called.

    Hi,
    Yes, I understand what you are saying here. I do not understand the
    following. If I use instance variables to pass the storeLocation into my
    component it works fine. storeLocation is passed through to the component
    and getLStore() contains the location I passed in from the page.
    If however I use an abstract property to pass the storeLocation into my
    component, storeLocation is not passed into the component ie.
    getStoreLocation() is null

    Thanks
    Brian

    Ron Piterman wrote:
    >:)
    >>

    >Tapestry uses a pool to store page instances. While rendering it is safe
    >to use instance variables but you have to make sure they are reset,
    >preferrably in either pageDetached or pageAttached events.
    >If you don't reset them, information can be shared between many users of
    >your site, but not by all, since they might get another instance from the
    >pool.
    >>

    >When using abstract properties, tapestry does the initialization work for
    >you.
    >>

    >Hope that helps,
    >Ron
    >>
    >>
    >>

    >Brian Doherty wrote:

    Sorry. What I mean by does not work is that getLStore() in my
    component is null after the component renders.
    When I use the updated code below the storeLocation is passed through to
    the component and getLStore() contains the location I passed in
    from the page.
    It does not like it when I use abstract getters and setters but I dont
    understand why.

    Thanks
    Brian

    Ron Piterman wrote:

    Brian Doherty wrote:

    Hi,

    I am having problems binding a property on my page to a parameter in
    my component. The following does not work

    can you be more specific. "Does not work" is somehow general

    I have a CategoryListComponent as follows

    <component id="categoryListComponent" type="CategoryListComponent">
    <binding name="Store" value="storeLocation"/>
    </component>

    my CategoryList.java I have

    public abstract void setStoreLocation(Location storeLocation);
    public abstract Location getStoreLocation();

    If however I change it as follows, it works fine. The storeLocation is
    passed into the component.

    <component id="categoryListComponent" type="CategoryListComponent">
    <binding name="Store" value="Store"/>
    </component>

    my CategoryList.java this time I have

    private Location Store;
    public void setLStore(Location Store) {
    Store = Store;
    }
    public Location getLStore() {
    return Store;
    }

    I dont understand why the Location wont be passed through if it
    declared as abstract. Any help would be great

    Regards
    Brian

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org


    >>
    >>

    >
    >To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    >For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
    >>

    >
    >


    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
  • No.6 | | 4213 bytes | |

    Brian Doherty wrote:
    Hi,
    Yes, I understand what you are saying here. I do not understand the
    following. If I use instance variables to pass the storeLocation into my
    component it works fine. storeLocation is passed through to the
    component and getLStore() contains the location I passed in
    from the page. If however I use an abstract property to pass the
    storeLocation into my component, storeLocation is not passed into the
    component ie. getStoreLocation() is null

    where do you set your storeLocation property ( or, why shouldn't it be
    null ) ?
    Cheers,
    Ron

    Thanks
    Brian

    Ron Piterman wrote:

    >:)
    >>

    >Tapestry uses a pool to store page instances. While rendering it is
    >safe to use instance variables but you have to make sure they are
    >reset, preferrably in either pageDetached or pageAttached events.
    >If you don't reset them, information can be shared between many users
    >of your site, but not by all, since they might get another instance
    >from the pool.
    >>

    >When using abstract properties, tapestry does the initialization work
    >for you.
    >>

    >Hope that helps,
    >Ron
    >>
    >>
    >>

    >Brian Doherty wrote:
    >>

    Sorry. What I mean by does not work is that getLStore() in
    my component is null after the component renders.
    When I use the updated code below the storeLocation is passed through
    to the component and getLStore() contains the location I
    passed in from the page.
    It does not like it when I use abstract getters and setters but I
    dont understand why.

    Thanks
    Brian

    Ron Piterman wrote:

    Brian Doherty wrote:

    Hi,

    I am having problems binding a property on my page to a parameter
    in my component. The following does not work

    can you be more specific. "Does not work" is somehow general

    I have a CategoryListComponent as follows

    <component id="categoryListComponent" type="CategoryListComponent">
    <binding name="Store" value="storeLocation"/>
    </component>

    my CategoryList.java I have

    public abstract void setStoreLocation(Location storeLocation);
    public abstract Location getStoreLocation();

    If however I change it as follows, it works fine. The storeLocation
    is passed into the component.

    <component id="categoryListComponent" type="CategoryListComponent">
    <binding name="Store" value="Store"/>
    </component>

    my CategoryList.java this time I have

    private Location Store;
    public void setLStore(Location Store) {
    Store = Store;
    }
    public Location getLStore() {
    return Store;
    }

    I dont understand why the Location wont be passed through if it
    declared as abstract. Any help would be great

    Regards
    Brian

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org


    >>
    >>

    >
    >To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    >For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
    >>


    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org

Re: Problem with parameters of a custom component (Tapestry 4.01)


max 4000 letters.
Your nickname that display:
In order to stop the spam: 3 + 3 =
QUESTION ON "Java"

EMSDN.COM