Re: Get link to the page that contains custom component

abangkis <[email protected]> Fri, 26 Oct 2018 22:44:26 +0700
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAGqeSzVDOBTrBkg56RVOAU3XH_K_jt-hDsAFgP0RxuWTO86jPA@mail.gmail.com>
Thanks a lot Dmitry. It's working great.

There's another thing. If the custom component inside a form and like to
set some error message.
If it's a page we can do something like:

@InjectComponent
private Form form;

form.recordError(message);

How to do something like that in a component?

Thanks a lot.



On Fri, Oct 26, 2018 at 7:59 PM Dmitry Gusev <[email protected]> wrote:

> Hi,
>
> I would try something like this:
>
> @Inject ComponentResources resources;
>
> and then
>
> pageRenderLinkSource.createPageRenderLink(resources.getPageName());
>
> On Fri, Oct 26, 2018 at 2:07 PM abangkis <[email protected]> wrote:
>
> > Hi guys. I'm moving parts of of my page to a custom component. In the
> page
> > there's a method that will go to another page and go back to the original
> > page when finished. Here's the code:
> >
> > @OnEvent("AddDoc")
> > Object addDoc() {
> > Link thisPage =
> pageRenderLinkSource.createPageRenderLink(this.getClass());
> > addLoanDocPage.setLoanApplicationId(loanApplication.getId());
> > addLoanDocPage.setLinkBack(thisPage);
> > return addLoanDocPage;
> > }
> >
> > I'm moving that method to the custom component. How can  the component
> > generate the Link to the page that contains it?
> >
> > Thanks
> >
> > --
> > http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
> > twitter : @mreunionlabs @abangkis
> > page : https://plus.google.com/104168782385184990771
> >
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>


-- 
http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
twitter : @mreunionlabs @abangkis
page : https://plus.google.com/104168782385184990771