Re: How to let custom component participate in form submission

2018-11-06 Thread abangkis
Hi chris, thanks for the reply.


On Sun, Nov 4, 2018 at 8:19 PM Chris Poulsen  wrote:

>
> With a few exceptions, I would generally say that using @Persist in
> components is a smell, instead pass the information as a parameter - Pages
> are ultimately the things driving the components, they should worry about
> how to configure the components (if that means that a value should be
> persisted, it should happen in the page).
>
>
Yes, we currently uses this approach. Thanks a lot.


Re: How to let custom component participate in form submission

2018-11-04 Thread Chris Poulsen
Hi

It sounds like you are attempting to do something in a way that may not be
ideal (judging from all the hoops you are trying to jump through).

In Tapestry you can usually get really far using the simple building blocks
that are provided. With a few exceptions you are usually taking a bad
course, when you think you need to write all kinds of weird code to make
the framework happy (Exceptions are usually things like when the (complex)
built-in components like grid and tree does not support what you need).

You seem to have a somewhat unclear understanding of component rendering
and form submissions, that could be a place to start. (Hint. take a look at
the Form component
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Form.html
- That is the one that triggers those prepare* events etc, there is no
magic going on in pages with respect to that. As events bubble "up" through
containers, you should not expect your component to receive those events if
it is _inside_ the form. If you want something complex acting like a form
element, use Thiagos suggestion).

I would recommend against trying to implement some kind of pub/sub
mechanism to circumvent the fact that you feel your components are
misbehaving because events bubble up... - It may be possible to get
something to work, but with respect to maintenance and component
re-usability you will most likely end up realizing that you have shoot
yourself in the foot, at some point.

With a few exceptions, I would generally say that using @Persist in
components is a smell, instead pass the information as a parameter - Pages
are ultimately the things driving the components, they should worry about
how to configure the components (if that means that a value should be
persisted, it should happen in the page).

Also if you find yourself needing page life-cycle callbacks in your
component (e.g my component should do this on activate or similar, you are
doing it wrong)

It is hard to come up with something concrete based on the info provided,
but I guess that if you realize how form submission and component render
life cycles interact, it will be easier to fix your problem.

-- 
Chris





On Thu, Nov 1, 2018 at 3:53 PM abangkis  wrote:

> Hi Thiago,
>
> This component is some ui that we extract from few common pages. It shows a
> series of tabs. Each tabs has its own related Hibernate Entity. We don't
> pass all the tabs entity as parameter to the component. Instead we just
> pass the root component and let the rest of the tab get their entity from
> the DAO injected to the component.
>
> The component is encapsulated inside of a form. It works well showing the
> data for each tab. But when we submit the form we receive that error. Since
> the tabs Hibernate Entity is not Persist in the component. Our approach is
> to use @Persist only when we have to. Usually this is handled in the page
> by populating the tabs Hibernate Entities in the page OnPrepare method.
> Translating this approach from a page implementation to the custom
> component isn't as straight forward as I thought. Since OnPrepare isn't
> called in the custom component. (it's part of page life cycle but not part
> of component rendering lifecycle?)
>
> Tried to implement it using Process Submission example from jumpstart
> (since it seems that's how you implement a component that contribute the
> value to form submission process). But still haven't got it working yet.
>
> By the way. Is it common to have @Persist property inside of a component?
> How do you clean the persisted field after submission? Is it enough only by
> calling ComponentResources.discardPersistentField() on the page OnSucces
> method? Or do we need to clean it up on the Component Java code instead?
>
> Sorry if the explanation a bit long and confusing. Thanks.
>
>
>
>
>
>
> On Thu, Nov 1, 2018 at 8:41 PM Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > Hello!
> >
> > What exactly is this component trying to do? I couldn't get it by looking
> > at your code snippet.
> >
> > Anyway, the probably best way of doing it if you want to create a
> component
> > which edits something is to subclass AbstractField.
> >
> > The error message says you're trying to pass a null object to BeanDisplay
> > while it renders, so this doesn't seem to be a problem with form
> submission
> > at all, but a problem while rendering the page later.
> >
> > Failure reading parameter 'source' of component
> > common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0.loop:
> > Parameter 'object' of component
> > common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0 is bound
> >
> >

Re: How to let custom component participate in form submission

2018-11-01 Thread abangkis
Hi Thiago,

This component is some ui that we extract from few common pages. It shows a
series of tabs. Each tabs has its own related Hibernate Entity. We don't
pass all the tabs entity as parameter to the component. Instead we just
pass the root component and let the rest of the tab get their entity from
the DAO injected to the component.

The component is encapsulated inside of a form. It works well showing the
data for each tab. But when we submit the form we receive that error. Since
the tabs Hibernate Entity is not Persist in the component. Our approach is
to use @Persist only when we have to. Usually this is handled in the page
by populating the tabs Hibernate Entities in the page OnPrepare method.
Translating this approach from a page implementation to the custom
component isn't as straight forward as I thought. Since OnPrepare isn't
called in the custom component. (it's part of page life cycle but not part
of component rendering lifecycle?)

Tried to implement it using Process Submission example from jumpstart
(since it seems that's how you implement a component that contribute the
value to form submission process). But still haven't got it working yet.

By the way. Is it common to have @Persist property inside of a component?
How do you clean the persisted field after submission? Is it enough only by
calling ComponentResources.discardPersistentField() on the page OnSucces
method? Or do we need to clean it up on the Component Java code instead?

Sorry if the explanation a bit long and confusing. Thanks.






On Thu, Nov 1, 2018 at 8:41 PM Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Hello!
>
> What exactly is this component trying to do? I couldn't get it by looking
> at your code snippet.
>
> Anyway, the probably best way of doing it if you want to create a component
> which edits something is to subclass AbstractField.
>
> The error message says you're trying to pass a null object to BeanDisplay
> while it renders, so this doesn't seem to be a problem with form submission
> at all, but a problem while rendering the page later.
>
> Failure reading parameter 'source' of component
> common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0.loop:
> Parameter 'object' of component
> common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0 is bound
>
>
> On Thu, Nov 1, 2018 at 4:43 AM abangkis  wrote:
>
> > Hai guys, still working on my custom component.
> >
> > How do we let our custom component participate in form submission.
> > Apparently there is no onPrepare hook for tapestry custom component.
> > http://tapestry.apache.org/component-rendering.html.
> >
> > I'm reading
> >
> >
> http://jumpstart.doublenegative.com.au/jumpstart/examples/component/subformvalidation1
> > example. But still haven't grasp the general gist
> > about ProcessSubmission/ComponentAction. Calling the prepare method from
> > process submission doesn't seems to work. Rendering the component is
> fine,
> > but when submitting the page I receive the error and stack trace bellow.
> >
> > Any advice? Thanks.
> >
> > Here's my custom component setup & prepare method:
> >
> > private static final ProcessSubmission PROCESS_SUBMISSION = new
> > ProcessSubmission();
> >
> > // Tapestry calls afterRender() AFTER it renders any components I
> > contain (ie. Loop).
> > final void afterRender() {
> >
> > // If we are inside a form, ask FormSupport to store
> > PROCESS_SUBMISSION in its list of actions to do on submit.
> > // If I contain other components, their actions will already be
> in
> > the list, before PROCESS_SUBMISSION. That is
> > // because this method, afterRender(), is late in the sequence.
> > This guarantees PROCESS_SUBMISSION will be
> > // executed on submit AFTER the components I contain are
> processed
> > (which includes their validation).
> >
> > if (formSupport != null) {
> > formSupport.store(this, PROCESS_SUBMISSION);
> > }
> > }
> >
> > private static class ProcessSubmission implements
> > ComponentAction {
> > private static final long serialVersionUID =
> -2132279249191788845L;
> >
> > @Override
> > public String toString() {
> > return this.getClass().getSimpleName() +
> ".ProcessSubmission";
> > }
> >
> > @Override
> > public void execute(LoanBundleEditTabs2 component) {
> > component.processSubmission();
> > }
> > 

Re: How to let custom component participate in form submission

2018-11-01 Thread Thiago H. de Paula Figueiredo
Hello!

What exactly is this component trying to do? I couldn't get it by looking
at your code snippet.

Anyway, the probably best way of doing it if you want to create a component
which edits something is to subclass AbstractField.

The error message says you're trying to pass a null object to BeanDisplay
while it renders, so this doesn't seem to be a problem with form submission
at all, but a problem while rendering the page later.

Failure reading parameter 'source' of component
common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0.loop:
Parameter 'object' of component
common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0 is bound


On Thu, Nov 1, 2018 at 4:43 AM abangkis  wrote:

> Hai guys, still working on my custom component.
>
> How do we let our custom component participate in form submission.
> Apparently there is no onPrepare hook for tapestry custom component.
> http://tapestry.apache.org/component-rendering.html.
>
> I'm reading
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/component/subformvalidation1
> example. But still haven't grasp the general gist
> about ProcessSubmission/ComponentAction. Calling the prepare method from
> process submission doesn't seems to work. Rendering the component is fine,
> but when submitting the page I receive the error and stack trace bellow.
>
> Any advice? Thanks.
>
> Here's my custom component setup & prepare method:
>
> private static final ProcessSubmission PROCESS_SUBMISSION = new
> ProcessSubmission();
>
> // Tapestry calls afterRender() AFTER it renders any components I
> contain (ie. Loop).
> final void afterRender() {
>
> // If we are inside a form, ask FormSupport to store
> PROCESS_SUBMISSION in its list of actions to do on submit.
> // If I contain other components, their actions will already be in
> the list, before PROCESS_SUBMISSION. That is
> // because this method, afterRender(), is late in the sequence.
> This guarantees PROCESS_SUBMISSION will be
> // executed on submit AFTER the components I contain are processed
> (which includes their validation).
>
> if (formSupport != null) {
> formSupport.store(this, PROCESS_SUBMISSION);
> }
> }
>
> private static class ProcessSubmission implements
> ComponentAction {
> private static final long serialVersionUID = -2132279249191788845L;
>
> @Override
> public String toString() {
> return this.getClass().getSimpleName() + ".ProcessSubmission";
> }
>
> @Override
> public void execute(LoanBundleEditTabs2 component) {
> component.processSubmission();
> }
> }
>
> private void processSubmission() {
> // Validate. We ensured in afterRender() that the components I
> contain have already been validated.
> prepare();
> }
>
> @SetupRender
> void setup() {
> prepare();
> }
>
> void prepare() {
> Long loanApplicationId = loanApplication.getId();
> loanApplicationDetail =
> loanApplicationDetailDao.getByApplicationId(loanApplicationId);
>
> homeAddress =
> loanAddressDao.getHomeAddressByApplicationId(loanApplicationId);
> homeAddress2 = new AddressModel();
> addressCopier.copy(homeAddress, homeAddress2);
>
> mailAddress =
> loanAddressDao.getMailAddressByApplicationId(loanApplicationId);
> mailAddress2 = new AddressModel();
> addressCopier.copy(mailAddress, mailAddress2);
>
> officeAddress =
> loanAddressDao.getOfficeAddressByApplicationId(loanApplicationId);
> officeAddress2 = new AddressModel();
> addressCopier.copy(officeAddress, officeAddress2);
> }
>
> Here's the stack trace
>
> [ERROR] ioc.Registry Failure reading parameter 'source' of component
> common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0.loop:
> Parameter 'object' of component
> common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0 is bound
> to null. This parameter is not allowed to be null.
> [ERROR] ioc.Registry Operations trace:
> [ERROR] ioc.Registry [ 1] Handling traditional 'action' component event
> request for common/loan/ApplicationSummary:form.
> [ERROR] ioc.Registry [ 2] Triggering event 'action' on
> common/loan/ApplicationSummary:form
> [ERROR] TapestryModule.RequestExceptionHandler Processing of request failed
> with uncaught exception:
> org.apache.tapestry5.ioc.internal.OperationException: Failure reading
> parameter 'source' of component
>

How to let custom component participate in form submission

2018-11-01 Thread abangkis
Hai guys, still working on my custom component.

How do we let our custom component participate in form submission.
Apparently there is no onPrepare hook for tapestry custom component.
http://tapestry.apache.org/component-rendering.html.

I'm reading
http://jumpstart.doublenegative.com.au/jumpstart/examples/component/subformvalidation1
example. But still haven't grasp the general gist
about ProcessSubmission/ComponentAction. Calling the prepare method from
process submission doesn't seems to work. Rendering the component is fine,
but when submitting the page I receive the error and stack trace bellow.

Any advice? Thanks.

Here's my custom component setup & prepare method:

private static final ProcessSubmission PROCESS_SUBMISSION = new
ProcessSubmission();

// Tapestry calls afterRender() AFTER it renders any components I
contain (ie. Loop).
final void afterRender() {

// If we are inside a form, ask FormSupport to store
PROCESS_SUBMISSION in its list of actions to do on submit.
// If I contain other components, their actions will already be in
the list, before PROCESS_SUBMISSION. That is
// because this method, afterRender(), is late in the sequence.
This guarantees PROCESS_SUBMISSION will be
// executed on submit AFTER the components I contain are processed
(which includes their validation).

if (formSupport != null) {
formSupport.store(this, PROCESS_SUBMISSION);
}
}

private static class ProcessSubmission implements
ComponentAction {
private static final long serialVersionUID = -2132279249191788845L;

@Override
public String toString() {
return this.getClass().getSimpleName() + ".ProcessSubmission";
}

@Override
public void execute(LoanBundleEditTabs2 component) {
component.processSubmission();
}
}

private void processSubmission() {
// Validate. We ensured in afterRender() that the components I
contain have already been validated.
prepare();
}

@SetupRender
void setup() {
prepare();
}

void prepare() {
Long loanApplicationId = loanApplication.getId();
loanApplicationDetail =
loanApplicationDetailDao.getByApplicationId(loanApplicationId);

homeAddress =
loanAddressDao.getHomeAddressByApplicationId(loanApplicationId);
homeAddress2 = new AddressModel();
addressCopier.copy(homeAddress, homeAddress2);

mailAddress =
loanAddressDao.getMailAddressByApplicationId(loanApplicationId);
mailAddress2 = new AddressModel();
addressCopier.copy(mailAddress, mailAddress2);

officeAddress =
loanAddressDao.getOfficeAddressByApplicationId(loanApplicationId);
officeAddress2 = new AddressModel();
addressCopier.copy(officeAddress, officeAddress2);
}

Here's the stack trace

[ERROR] ioc.Registry Failure reading parameter 'source' of component
common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0.loop:
Parameter 'object' of component
common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0 is bound
to null. This parameter is not allowed to be null.
[ERROR] ioc.Registry Operations trace:
[ERROR] ioc.Registry [ 1] Handling traditional 'action' component event
request for common/loan/ApplicationSummary:form.
[ERROR] ioc.Registry [ 2] Triggering event 'action' on
common/loan/ApplicationSummary:form
[ERROR] TapestryModule.RequestExceptionHandler Processing of request failed
with uncaught exception:
org.apache.tapestry5.ioc.internal.OperationException: Failure reading
parameter 'source' of component
common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0.loop:
Parameter 'object' of component
common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0 is bound
to null. This parameter is not allowed to be null. [at
classpath:net/mreunionlabs/gri/server/pages/common/loan/LoanApplicationSummary.tml,
line 63]
org.apache.tapestry5.ioc.internal.OperationException: Failure reading
parameter 'source' of component
common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0.loop:
Parameter 'object' of component
common/loan/ApplicationSummary:loanbundleedittabs2.beandisplay_0 is bound
to null. This parameter is not allowed to be null. [at
classpath:net/mreunionlabs/gri/server/pages/common/loan/LoanApplicationSummary.tml,
line 63]
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:186)
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:90)
at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:72)
at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1260)
at
org.apache.tapestry5.internal

Re: Get link to the page that contains custom component

2018-10-27 Thread abangkis
Apparently environmental only available during rendering.

https://www.mail-archive.com/users@tapestry.apache.org/msg56293.html

Yeah. I guess I still doesn't understand how to use Environmental
Correctly. Would try passing it as a parameter instead.

Thanks.



On Sat, Oct 27, 2018 at 6:48 PM Mats Andersson 
wrote:

> What do you think about passing the model as a component argument instead?
> That way you are not depending on the order of the calls. See also:
> http://jumpstart.doublenegative.com.au/jumpstart6/examples/navigation/whatiscalledandwhen
> for an explanation.
>
>
> --
> -- Mats Andersson | Ronsoft AB | +46(0)73 368 79 82
>
>
> On 2018-10-27 05:00, abangkis wrote:
>
> Sorry, still having some problems with custom component. I need to pass a
> logged in user object to the component.
>
> So I push the wrapper class from the page to the environment
>
> @BeginRender
> void beginRender() {
>   LoanBundleModel model = new LoanBundleModel();
>   model.setUserId(getCurrentUser().getId());
>   environment.push(LoanBundleModel.class, model);
> }
> And then retrieve it in the component by using environmental
>
> @Environmental
> private LoanBundleModel model;
>
> And use it in a method like this:
> @CommitAfter
> @OnEvent("DeleteDoc")
> void deleteDoc(Long loanDocumentId) {
>   User user = userManager.get(model.getUserId());
>   String message =
> loanDocumentService.deleteLoanApplicationDoc(loanDocumentId, user);
> if (message != null) {
>   validationTracker.recordError(message);
> }
> }
>
> But i keep getting. No object of type
> net.mreunionlabs.gri.server.compmodel.gri.LoanBundleModel is available from
> the Environment.
>
> What did I do wrong?
>
> Thanks
>
> On Sat, Oct 27, 2018 at 7:02 AM abangkis  
>  wrote:
>
>
> I see. Thanks Dmitry.
>
> On Sat, Oct 27, 2018 at 12:23 AM Dmitry Gusev  
> 
> wrote:
>
>
> For forms you can use:
>
> @Environmental
> private ValidationTracker validationTracker;
>
> and then
>
> validationTracker.recordError(...)
>
>
> On Fri, Oct 26, 2018 at 6:45 PM abangkis  
>  wrote:
>
>
> 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  
> 
> 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  
>  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/> 
> <http://www.mreunion-labs.net/>
> twitter : @mreunionlabs @abangkis
> page : https://plus.google.com/104168782385184990771
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Teamhttp://anjlab.com
>
>
>
> --http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/> 
> <http://www.mreunion-labs.net/>
> twitter : @mreunionlabs @abangkis
> page : https://plus.google.com/104168782385184990771
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Teamhttp://anjlab.com
>
>
>
> --http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/> 
> <http://www.mreunion-labs.net/>
> twitter : @mreunionlabs @abangkis
> page : https://plus.google.com/104168782385184990771
>
>
>

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


Re: Get link to the page that contains custom component

2018-10-27 Thread Mats Andersson
What do you think about passing the model as a component argument 
instead? That way you are not depending on the order of the calls. See 
also: 
http://jumpstart.doublenegative.com.au/jumpstart6/examples/navigation/whatiscalledandwhen 
for an explanation.



--
-- Mats Andersson | Ronsoft AB | +46(0)73 368 79 82


On 2018-10-27 05:00, abangkis wrote:

Sorry, still having some problems with custom component. I need to pass a
logged in user object to the component.

So I push the wrapper class from the page to the environment

@BeginRender
void beginRender() {
   LoanBundleModel model = new LoanBundleModel();
   model.setUserId(getCurrentUser().getId());
   environment.push(LoanBundleModel.class, model);
}
And then retrieve it in the component by using environmental

@Environmental
private LoanBundleModel model;

And use it in a method like this:
@CommitAfter
@OnEvent("DeleteDoc")
void deleteDoc(Long loanDocumentId) {
   User user = userManager.get(model.getUserId());
   String message =
loanDocumentService.deleteLoanApplicationDoc(loanDocumentId, user);
 if (message != null) {
   validationTracker.recordError(message);
 }
}

But i keep getting. No object of type
net.mreunionlabs.gri.server.compmodel.gri.LoanBundleModel is available from
the Environment.

What did I do wrong?

Thanks

On Sat, Oct 27, 2018 at 7:02 AM abangkis  wrote:


I see. Thanks Dmitry.

On Sat, Oct 27, 2018 at 12:23 AM Dmitry Gusev 
wrote:


For forms you can use:

 @Environmental
 private ValidationTracker validationTracker;

and then

 validationTracker.recordError(...)


On Fri, Oct 26, 2018 at 6:45 PM abangkis  wrote:


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 
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  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



--
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





Re: Get link to the page that contains custom component

2018-10-26 Thread abangkis
Sorry, still having some problems with custom component. I need to pass a
logged in user object to the component.

So I push the wrapper class from the page to the environment

@BeginRender
void beginRender() {
  LoanBundleModel model = new LoanBundleModel();
  model.setUserId(getCurrentUser().getId());
  environment.push(LoanBundleModel.class, model);
}
And then retrieve it in the component by using environmental

@Environmental
private LoanBundleModel model;

And use it in a method like this:
@CommitAfter
@OnEvent("DeleteDoc")
void deleteDoc(Long loanDocumentId) {
  User user = userManager.get(model.getUserId());
  String message =
loanDocumentService.deleteLoanApplicationDoc(loanDocumentId, user);
if (message != null) {
  validationTracker.recordError(message);
}
}

But i keep getting. No object of type
net.mreunionlabs.gri.server.compmodel.gri.LoanBundleModel is available from
the Environment.

What did I do wrong?

Thanks

On Sat, Oct 27, 2018 at 7:02 AM abangkis  wrote:

> I see. Thanks Dmitry.
>
> On Sat, Oct 27, 2018 at 12:23 AM Dmitry Gusev 
> wrote:
>
>> For forms you can use:
>>
>> @Environmental
>> private ValidationTracker validationTracker;
>>
>> and then
>>
>> validationTracker.recordError(...)
>>
>>
>> On Fri, Oct 26, 2018 at 6:45 PM abangkis  wrote:
>>
>> > 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 
>> > 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  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
>> >
>>
>>
>> --
>> 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
>


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


Re: Get link to the page that contains custom component

2018-10-26 Thread abangkis
I see. Thanks Dmitry.

On Sat, Oct 27, 2018 at 12:23 AM Dmitry Gusev 
wrote:

> For forms you can use:
>
> @Environmental
> private ValidationTracker validationTracker;
>
> and then
>
> validationTracker.recordError(...)
>
>
> On Fri, Oct 26, 2018 at 6:45 PM abangkis  wrote:
>
> > 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 
> > 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  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
> >
>
>
> --
> 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


Re: Get link to the page that contains custom component

2018-10-26 Thread Dmitry Gusev
For forms you can use:

@Environmental
private ValidationTracker validationTracker;

and then

validationTracker.recordError(...)


On Fri, Oct 26, 2018 at 6:45 PM abangkis  wrote:

> 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 
> 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  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
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Get link to the page that contains custom component

2018-10-26 Thread abangkis
Hi mats, thanks. Using componentResources.getPageName work great.


On Fri, Oct 26, 2018 at 8:57 PM Mats Andersson 
wrote:

> Hi,
>
> I think you should use ComponentResources to create an event link to your
> new component. The link will include the current page.
>
> Another solution is the getPageName method of ComponentResources.
>
>
> --
> -- Mats Andersson | Ronsoft AB | +46(0)73 368 79 82
>
> On 2018-10-26 13:07, abangkis 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


Re: Get link to the page that contains custom component

2018-10-26 Thread abangkis
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  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  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


Re: Get link to the page that contains custom component

2018-10-26 Thread Mats Andersson

Hi,

I think you should use ComponentResources to create an event link to 
your new component. The link will include the current page.


Another solution is the getPageName method of ComponentResources.


--
-- Mats Andersson | Ronsoft AB | +46(0)73 368 79 82


On 2018-10-26 13:07, abangkis 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



Re: Get link to the page that contains custom component

2018-10-26 Thread Dmitry Gusev
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  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


Get link to the page that contains custom component

2018-10-26 Thread abangkis
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


Fwd: Custom component not rendering

2016-08-22 Thread Matthew Bush
I think this my mistake, folder structure issue, please disregard.

Thanks,
Matthew Bush


> Begin forwarded message:
> 
> From: Matthew Bush 
> Subject: Custom component not rendering 
> Date: 23 August 2016 at 10:43:37 AM AEST
> To: users@tapestry.apache.org
> 
> Hello.
> 
> Problem - Custom component rendering multiple text fields is not rendering 
> and no error produced.
> 
> I am wishing to create a custom tapestry component which uses a *.tml 
> template.  This custom component is to provide data entry for Address 
> entities.  So includes normal/typcial address fields.  I have tried to use 
> various *.tml syntax such as:
> 
> http://tapestry.apache.org/schema/tapestry_5_4.xsd 
> <http://tapestry.apache.org/schema/tapestry_5_4.xsd>”>
> http://tapestry.apache.org/schema/tapestry_5_4.xsd 
> <http://tapestry.apache.org/schema/tapestry_5_4.xsd>”> 
> with either   xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd 
> <http://tapestry.apache.org/schema/tapestry_5_4.xsd>”>
> 
> My package structure/location is -
> 
> java package au.com.xxx.web.components.technology.common
> tmp under resources at au.com.xxx.web.components.technology.common
> 
> And the page where I use this component references the component like this -
> 
> tml template -  value="account.billingAddress" />
> java - 
> 
>  @InjectComponent("billingAddressEntry")
> private AddressEntry billingAddressEntry;
> 
> If needed I can attach source for both the custom component and usage page.  
> 
> Can custom components handle rendering multiple fields and do this using the 
> *.tml rather than manually doing layout using beginRender method?
> 
> 
> Cheers,
> Matt Bush
> 
> 
> 
> 



Custom component not rendering

2016-08-22 Thread Matthew Bush
Hello.

Problem - Custom component rendering multiple text fields is not rendering and 
no error produced.

I am wishing to create a custom tapestry component which uses a *.tml template. 
 This custom component is to provide data entry for Address entities.  So 
includes normal/typcial address fields.  I have tried to use various *.tml 
syntax such as:

http://tapestry.apache.org/schema/tapestry_5_4.xsd”>
http://tapestry.apache.org/schema/tapestry_5_4.xsd”> 
with either http://tapestry.apache.org/schema/tapestry_5_4.xsd”>

My package structure/location is -

java package au.com.xxx.web.components.technology.common
tmp under resources at au.com.xxx.web.components.technology.common

And the page where I use this component references the component like this -

tml template - 
java - 

 @InjectComponent("billingAddressEntry")
private AddressEntry billingAddressEntry;

If needed I can attach source for both the custom component and usage page.  

Can custom components handle rendering multiple fields and do this using the 
*.tml rather than manually doing layout using beginRender method?


Cheers,
Matt Bush






Re: guidance with integrating yet another js library as custom component

2013-07-09 Thread Lance Java
You might be able to use the onEvent mixin to attach a clientside event to
a serverside event.
http://tapestry-stitch.uklance.cloudbees.net/oneventdemo

If not, the code should help.
On 9 Jul 2013 18:59, "George Ludwig"  wrote:

> I've got this working pretty well now, but I want to take it to the next
> level.
>
> When the user clicks on a node of the graph, I want to trigger a callback
> function on the java side. I assume this means attaching a click handler
> method in javascript to the nodes...but how do I wire it up so when the js
> click handler is invoked, it calls a server side java method?
>
> Looking at this example: http://sigmajs.org/examples/hidden_nodes.html
>
> When a node is clicked, I'd like to execute a server side java call that
> receives the node name.
>
> Is there a clear example of this type of integration anywhere I can take a
> look at?
>
> -George
>
>
> On Tue, Jul 9, 2013 at 10:53 AM, George Ludwig  >wrote:
>
> > Thanks for those links!
> >
> >
> > On Sun, Jul 7, 2013 at 11:00 PM, Geoff Callender <
> > geoff.callender.jumpst...@gmail.com> wrote:
> >
> >> These examples describe the pros and cons of addScript() and
> >> addInitializerCall():
> >>
> >> -
> >>
> >>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/javascript
> >> -
> >>
> >>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/reusable
> >> -
> >>
> >>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/robust
> >>
> >> HTH,
> >>
> >> Geoff
> >>
> >>
> >> On 3 July 2013 06:25, George Ludwig  wrote:
> >>
> >> > Thanks for the info Thiago!
> >> >
> >> > >>  Couldn't you just @Import to get the JS files included and
> >> > JavaScriptSupport.addScript() to invoke JS functions?
> >> >
> >> > That's the route I ended up taking to import the necessary js files,
> but
> >> > I'm still unclear on exactly how to use  JavaScriptSupport.addScript()
> >> to
> >> > create an instance of the sigma viewer. For example, I don't
> understand
> >> > when it's appropriate to use JavaScriptSupport.addInitializerCall()
> >> > vs. JavaScriptSupport.addScript()
> >> >
> >> >
> >> >
> >> > On Tue, Jul 2, 2013 at 12:01 PM, Thiago H de Paula Figueiredo <
> >> > thiag...@gmail.com> wrote:
> >> >
> >> > > On Tue, 02 Jul 2013 15:35:20 -0300, George Ludwig <
> >> > georgelud...@gmail.com>
> >> > > wrote:
> >> > >
> >> > >  I'm working on a custom component of the SigmaJS visualization
> >> library (
> >> > >> http://sigmajs.org).
> >> > >> Specifically, this example: http://sigmajs.org/examples/**
> >> > >> gexf_example.html <http://sigmajs.org/examples/gexf_example.html>
> >> > >>
> >> > >
> >> > > Interesting!
> >> > >
> >> > >
> >> > >  I've been studying the got5 examples of js library integration, and
> >> they
> >> > >> are all pretty complex, and it's a challenge to figure out what I
> >> really
> >> > >> need to do.
> >> > >>
> >> > >
> >> > > They are complex because the project tapestry-jquery is about
> >> > > reimplementing Tapestry's built-in Java in jQuery. You're thinking
> >> what
> >> > you
> >> > > need to do in your example is way too complex than reality. Couldn't
> >> you
> >> > > just @Import to get the JS files included and
> >> > JavaScriptSupport.addScript()
> >> > > to invoke JS functions?
> >> > >
> >> > >
> >> > >  I've been working form this tutorial:
> >> > >>
> >> http://wiki.apache.org/**tapestry/**Tapestry5AndJavaScriptExplaine**d<
> >> > http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained
> >> >however,
> >> > >> it's for a mixin and I'm unclear if there is a material difference
> >> > >> between creating a component vs. a mixin.
> >> > >>
> >> > >
> >> > > For the JavaScript part, it's absolutely the same in pages,
> components
> >> > and
> >> > > mixins.
> >> > >
> >> > >
> >> > >
> >> > >> Any guidance is much appreciated!
> >> > >>
> >> > >> -George
> >> > >>
> >> > >
> >> > >
> >> > > --
> >> > > Thiago H. de Paula Figueiredo
> >> > >
> >> > >
> >>
> --**--**-
> >> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<
> >> > users-unsubscr...@tapestry.apache.org>
> >> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> >> > >
> >> > >
> >> >
> >>
> >
> >
>


Re: guidance with integrating yet another js library as custom component

2013-07-09 Thread Thiago H de Paula Figueiredo
On Tue, 09 Jul 2013 14:59:24 -0300, George Ludwig   
wrote:



I've got this working pretty well now, but I want to take it to the next
level.

When the user clicks on a node of the graph, I want to trigger a callback
function on the java side. I assume this means attaching a click handler
method in javascript to the nodes...but how do I wire it up so when the  
js click handler is invoked, it calls a server side java method?


Easy!

@Inject
private ComponentResources resources;

...
Link eventLink = resources.createEventLink("someEventName");
...

Objet onSomeEventName() {
...
}

Now pass eventLink.toClientURL(); to your JavaScript code through some  
JavaScriptSupport method. Use this URL as the target of an AJAX request.  
Pass any data you want as query parameters.


--
Thiago H. de Paula Figueiredo

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



Re: guidance with integrating yet another js library as custom component

2013-07-09 Thread George Ludwig
I've got this working pretty well now, but I want to take it to the next
level.

When the user clicks on a node of the graph, I want to trigger a callback
function on the java side. I assume this means attaching a click handler
method in javascript to the nodes...but how do I wire it up so when the js
click handler is invoked, it calls a server side java method?

Looking at this example: http://sigmajs.org/examples/hidden_nodes.html

When a node is clicked, I'd like to execute a server side java call that
receives the node name.

Is there a clear example of this type of integration anywhere I can take a
look at?

-George


On Tue, Jul 9, 2013 at 10:53 AM, George Ludwig wrote:

> Thanks for those links!
>
>
> On Sun, Jul 7, 2013 at 11:00 PM, Geoff Callender <
> geoff.callender.jumpst...@gmail.com> wrote:
>
>> These examples describe the pros and cons of addScript() and
>> addInitializerCall():
>>
>> -
>>
>> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/javascript
>> -
>>
>> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/reusable
>> -
>>
>> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/robust
>>
>> HTH,
>>
>> Geoff
>>
>>
>> On 3 July 2013 06:25, George Ludwig  wrote:
>>
>> > Thanks for the info Thiago!
>> >
>> > >>  Couldn't you just @Import to get the JS files included and
>> > JavaScriptSupport.addScript() to invoke JS functions?
>> >
>> > That's the route I ended up taking to import the necessary js files, but
>> > I'm still unclear on exactly how to use  JavaScriptSupport.addScript()
>> to
>> > create an instance of the sigma viewer. For example, I don't understand
>> > when it's appropriate to use JavaScriptSupport.addInitializerCall()
>> > vs. JavaScriptSupport.addScript()
>> >
>> >
>> >
>> > On Tue, Jul 2, 2013 at 12:01 PM, Thiago H de Paula Figueiredo <
>> > thiag...@gmail.com> wrote:
>> >
>> > > On Tue, 02 Jul 2013 15:35:20 -0300, George Ludwig <
>> > georgelud...@gmail.com>
>> > > wrote:
>> > >
>> > >  I'm working on a custom component of the SigmaJS visualization
>> library (
>> > >> http://sigmajs.org).
>> > >> Specifically, this example: http://sigmajs.org/examples/**
>> > >> gexf_example.html <http://sigmajs.org/examples/gexf_example.html>
>> > >>
>> > >
>> > > Interesting!
>> > >
>> > >
>> > >  I've been studying the got5 examples of js library integration, and
>> they
>> > >> are all pretty complex, and it's a challenge to figure out what I
>> really
>> > >> need to do.
>> > >>
>> > >
>> > > They are complex because the project tapestry-jquery is about
>> > > reimplementing Tapestry's built-in Java in jQuery. You're thinking
>> what
>> > you
>> > > need to do in your example is way too complex than reality. Couldn't
>> you
>> > > just @Import to get the JS files included and
>> > JavaScriptSupport.addScript()
>> > > to invoke JS functions?
>> > >
>> > >
>> > >  I've been working form this tutorial:
>> > >>
>> http://wiki.apache.org/**tapestry/**Tapestry5AndJavaScriptExplaine**d<
>> > http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained
>> >however,
>> > >> it's for a mixin and I'm unclear if there is a material difference
>> > >> between creating a component vs. a mixin.
>> > >>
>> > >
>> > > For the JavaScript part, it's absolutely the same in pages, components
>> > and
>> > > mixins.
>> > >
>> > >
>> > >
>> > >> Any guidance is much appreciated!
>> > >>
>> > >> -George
>> > >>
>> > >
>> > >
>> > > --
>> > > Thiago H. de Paula Figueiredo
>> > >
>> > >
>> --**--**-
>> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<
>> > users-unsubscr...@tapestry.apache.org>
>> > > For additional commands, e-mail: users-h...@tapestry.apache.org
>> > >
>> > >
>> >
>>
>
>


Re: guidance with integrating yet another js library as custom component

2013-07-09 Thread George Ludwig
Thanks for those links!


On Sun, Jul 7, 2013 at 11:00 PM, Geoff Callender <
geoff.callender.jumpst...@gmail.com> wrote:

> These examples describe the pros and cons of addScript() and
> addInitializerCall():
>
> -
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/javascript
> -
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/reusable
> -
> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/robust
>
> HTH,
>
> Geoff
>
>
> On 3 July 2013 06:25, George Ludwig  wrote:
>
> > Thanks for the info Thiago!
> >
> > >>  Couldn't you just @Import to get the JS files included and
> > JavaScriptSupport.addScript() to invoke JS functions?
> >
> > That's the route I ended up taking to import the necessary js files, but
> > I'm still unclear on exactly how to use  JavaScriptSupport.addScript() to
> > create an instance of the sigma viewer. For example, I don't understand
> > when it's appropriate to use JavaScriptSupport.addInitializerCall()
> > vs. JavaScriptSupport.addScript()
> >
> >
> >
> > On Tue, Jul 2, 2013 at 12:01 PM, Thiago H de Paula Figueiredo <
> > thiag...@gmail.com> wrote:
> >
> > > On Tue, 02 Jul 2013 15:35:20 -0300, George Ludwig <
> > georgelud...@gmail.com>
> > > wrote:
> > >
> > >  I'm working on a custom component of the SigmaJS visualization
> library (
> > >> http://sigmajs.org).
> > >> Specifically, this example: http://sigmajs.org/examples/**
> > >> gexf_example.html <http://sigmajs.org/examples/gexf_example.html>
> > >>
> > >
> > > Interesting!
> > >
> > >
> > >  I've been studying the got5 examples of js library integration, and
> they
> > >> are all pretty complex, and it's a challenge to figure out what I
> really
> > >> need to do.
> > >>
> > >
> > > They are complex because the project tapestry-jquery is about
> > > reimplementing Tapestry's built-in Java in jQuery. You're thinking what
> > you
> > > need to do in your example is way too complex than reality. Couldn't
> you
> > > just @Import to get the JS files included and
> > JavaScriptSupport.addScript()
> > > to invoke JS functions?
> > >
> > >
> > >  I've been working form this tutorial:
> > >> http://wiki.apache.org/**tapestry/**Tapestry5AndJavaScriptExplaine**d
> <
> > http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained>however,
> > >> it's for a mixin and I'm unclear if there is a material difference
> > >> between creating a component vs. a mixin.
> > >>
> > >
> > > For the JavaScript part, it's absolutely the same in pages, components
> > and
> > > mixins.
> > >
> > >
> > >
> > >> Any guidance is much appreciated!
> > >>
> > >> -George
> > >>
> > >
> > >
> > > --
> > > Thiago H. de Paula Figueiredo
> > >
> > >
> --**--**-
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<
> > users-unsubscr...@tapestry.apache.org>
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >
> >
>


Re: guidance with integrating yet another js library as custom component

2013-07-09 Thread George Ludwig
Lance,

I've been using, for example:

@Inject @Path("context:/data/filename.gexf")
@Property
private Asset file;

And then I pass this to the JS function:

String ret= file.getResource().getPath();

It's working fine...but is toClientURL() the preferred method?




On Mon, Jul 8, 2013 at 4:44 AM, Lance Java wrote:

> I think you want to @Inject the AssetSource to lookup the Asset. You can
> then call Asset.toClientUrl() to get an href for the asset which you can
> pass to your js library to use.
> On 4 Jul 2013 23:32, "George Ludwig"  wrote:
>
> > Thiago,
> >
> > You're definitely right, it's now a JS issue. I figured out that somehow
> I
> > had downloaded a garbled sigma.parseGexf.js file, which was part of the
> > problem.
> >
> > Quick javascript question: when I pass the filename for parsing to the
> gexf
> > parser, I currently pass it with relationship to the webapp root...but
> > since it still does not render (and everything else looks good right
> now),
> > I'm assuming that I the JS needs a fully qualified local path.
> >
> > Thanks again for your input...
> >
> > -George
> >
> >
> > On Thu, Jul 4, 2013 at 4:22 AM, Thiago H de Paula Figueiredo <
> > thiag...@gmail.com> wrote:
> >
> > > Uncaught SyntaxError: Unexpected token < sigma.parseGexf.js:3
> > >> Uncaught TypeError: Object # has no method 'parseGexf'
> > tap5-sigma.js:24
> > >>
> > >
> > > Are you sure sigma.parseGexf.js is correct? What's in line 24 of
> > > tap5-sigma.js? Anyway, it seems that now this error is completely about
> > > Sigma and JavaScript and not about Tapestry itself. What Tapestry
> version
> > > are you using? JavaScript minification is enabled?
> > >
> > >
> > > On Thu, 04 Jul 2013 01:36:04 -0300, George Ludwig <
> > georgelud...@gmail.com>
> > > wrote:
> > >
> > >  I'm at a point where it seems to me that it really should be working,
> > yet
> > >> I
> > >> get this error in the javascript console:
> > >>
> > >>
> > >> The method it can't find, parseGexf, is in the file
> sigma.parseGexf.js,
> > >> and
> > >> I've included it in the component's java file:
> > >>
> > >> @Import(library={"classpath:**com/intuit/tapestry5/sigmajs/**
> > >> asset/sigma.min.js",
> > >>
>  "classpath:com/intuit/**tapestry5/sigmajs/asset/sigma.**parseGexf.js",
> > >>  "classpath:com/intuit/**tapestry5/sigmajs/asset/tap5-**sigma.js"})
> > >>
> > >>
> > >> Here is the complete javascript file that is being executed in order
> to
> > do
> > >> the initialization:
> > >>
> > >> var sigmajs = Class.create();
> > >> sigmajs.prototype = {
> > >> initialize : function(id, gexfFile) {
> > >>  // Instantiate sigma.js and customize rendering
> > >> var sigInst = sigma.init(document.**getElementById(id)).**
> > >> drawingProperties({
> > >>  <<--- no error is thrown here
> > >> defaultLabelColor : '#fff',
> > >> defaultLabelSize : 14,
> > >> defaultLabelBGColor : '#fff',
> > >> defaultLabelHoverColor : '#000',
> > >> labelThreshold : 6,
> > >> defaultEdgeType : 'curve'
> > >> }).graphProperties({
> > >> minNodeSize : 0.5,
> > >> maxNodeSize : 5,
> > >> minEdgeSize : 1,
> > >> maxEdgeSize : 1
> > >> }).mouseProperties({
> > >> maxRatio : 32
> > >> });
> > >>
> > >> // Parse a GEXF encoded file to fill the graph
> > >> sigInst.parseGexf(gexfFile); <<--- error is thrown
> > >> here
> > >>
> > >> // Draw the graph :
> > >> sigInst.draw();
> > >> }
> > >> }
> > >>
> > >> This seems to be a load order issue, yet I tried swapping the order of
> > >> declaration of sigma.parseGexf.js and sigma.min.js, with the same
> > result.
> > >>
> > >> Any thoughts?
> > >>
> > >> -George
> > >>
> > >>
> > >> On Tue, Jul 2, 2013 at 5:43 PM, George Ludwig  > >> >wrote:
> > >>
> > >>  Cool, thanks a lot!
> > >>>
> > >>>
> > >>> On Tue, Jul 2, 2013 at 3:50 PM, Thiago H de Paula Figueiredo <
> > >>> thiag...@gmail.com> wrote:
> > >>>
> > >>>  On Tue, 02 Jul 2013 19:47:14 -0300, George Ludwig <
> >  georgelud...@gmail.com>
> >  wrote:
> > 
> >   I think I got it...so to initialize my graph I need to pas it a
> file
> > 
> > > name...is it most appropriate to use JavaScriptSupport.**
> > >
> > > addInitializerCall()
> > > so that the name of the file can be pulled from the @parameter of
> the
> > > component?
> > >
> > >
> >  For the parameter, it will make no difference. Regardless of using
> >  addScript() or addInitializerCall() you'll need to pass the file
> name
> > in
> >  the parameters of these methods. As you've never did this before,
> use
> >  addScript(), which is easier.
> > 
> > 
> >  --
> >  Thiago H. de Paula Figueiredo
> > 
> >  --**
> >  --**-
> >  To unsubscribe, e-mail: users-unsubscribe@tapestry.**a**pache.org<
> > http://apache.org>
> >   > users-unsubscr...@tapestry.apache.org>
> >  >
> > 
> >  For additional commands, e-mail: users-h...@tapestry.apache.org

Re: guidance with integrating yet another js library as custom component

2013-07-09 Thread George Ludwig
You were totally right...my brainfart didn't notice that the data files
were in the wrong directory.


On Mon, Jul 8, 2013 at 5:09 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Sun, 07 Jul 2013 16:59:18 -0300, George Ludwig 
> wrote:
>
>  Here's my final (I hope block):
>>
>> What is happening is that when I try to load anyfile.anyextension using
>> javascript, the tapestry app always returns the contents of index page,
>> rather than the contents of the requested file.
>>
>> I also tried loading the file straight from the browser (i.e.,
>> http://localhost:8080/myfile.**ext )
>> and it still returns the contents of the
>> index page. It returns the same thing even when I type in a URL for a
>> non-existent file.
>>
>> Is this a tapestry or jetty setting that I've missed?
>>
>
> Are you sure the files is really available at that URL? I don't think
> so.When Tapestry doesn't find a file matching a request, it treats it as a
> page request (render or event). As you probably don't have a page named
> 'myfile', Tapestry thinks you're doing an event request to the Index page.
>
> Make sure you have a correct, valid URL to the file before going ahead.
>
>
> --
> Thiago H. de Paula Figueiredo
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: guidance with integrating yet another js library as custom component

2013-07-08 Thread Thiago H de Paula Figueiredo
On Sun, 07 Jul 2013 16:59:18 -0300, George Ludwig   
wrote:



Here's my final (I hope block):

What is happening is that when I try to load anyfile.anyextension using
javascript, the tapestry app always returns the contents of index page,
rather than the contents of the requested file.

I also tried loading the file straight from the browser (i.e.,
http://localhost:8080/myfile.ext) and it still returns the contents of  
the

index page. It returns the same thing even when I type in a URL for a
non-existent file.

Is this a tapestry or jetty setting that I've missed?


Are you sure the files is really available at that URL? I don't think  
so.When Tapestry doesn't find a file matching a request, it treats it as a  
page request (render or event). As you probably don't have a page named  
'myfile', Tapestry thinks you're doing an event request to the Index page.


Make sure you have a correct, valid URL to the file before going ahead.

--
Thiago H. de Paula Figueiredo

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



Re: guidance with integrating yet another js library as custom component

2013-07-08 Thread Lance Java
I think you want to @Inject the AssetSource to lookup the Asset. You can
then call Asset.toClientUrl() to get an href for the asset which you can
pass to your js library to use.
On 4 Jul 2013 23:32, "George Ludwig"  wrote:

> Thiago,
>
> You're definitely right, it's now a JS issue. I figured out that somehow I
> had downloaded a garbled sigma.parseGexf.js file, which was part of the
> problem.
>
> Quick javascript question: when I pass the filename for parsing to the gexf
> parser, I currently pass it with relationship to the webapp root...but
> since it still does not render (and everything else looks good right now),
> I'm assuming that I the JS needs a fully qualified local path.
>
> Thanks again for your input...
>
> -George
>
>
> On Thu, Jul 4, 2013 at 4:22 AM, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > Uncaught SyntaxError: Unexpected token < sigma.parseGexf.js:3
> >> Uncaught TypeError: Object # has no method 'parseGexf'
> tap5-sigma.js:24
> >>
> >
> > Are you sure sigma.parseGexf.js is correct? What's in line 24 of
> > tap5-sigma.js? Anyway, it seems that now this error is completely about
> > Sigma and JavaScript and not about Tapestry itself. What Tapestry version
> > are you using? JavaScript minification is enabled?
> >
> >
> > On Thu, 04 Jul 2013 01:36:04 -0300, George Ludwig <
> georgelud...@gmail.com>
> > wrote:
> >
> >  I'm at a point where it seems to me that it really should be working,
> yet
> >> I
> >> get this error in the javascript console:
> >>
> >>
> >> The method it can't find, parseGexf, is in the file sigma.parseGexf.js,
> >> and
> >> I've included it in the component's java file:
> >>
> >> @Import(library={"classpath:**com/intuit/tapestry5/sigmajs/**
> >> asset/sigma.min.js",
> >>  "classpath:com/intuit/**tapestry5/sigmajs/asset/sigma.**parseGexf.js",
> >>  "classpath:com/intuit/**tapestry5/sigmajs/asset/tap5-**sigma.js"})
> >>
> >>
> >> Here is the complete javascript file that is being executed in order to
> do
> >> the initialization:
> >>
> >> var sigmajs = Class.create();
> >> sigmajs.prototype = {
> >> initialize : function(id, gexfFile) {
> >>  // Instantiate sigma.js and customize rendering
> >> var sigInst = sigma.init(document.**getElementById(id)).**
> >> drawingProperties({
> >>  <<--- no error is thrown here
> >> defaultLabelColor : '#fff',
> >> defaultLabelSize : 14,
> >> defaultLabelBGColor : '#fff',
> >> defaultLabelHoverColor : '#000',
> >> labelThreshold : 6,
> >> defaultEdgeType : 'curve'
> >> }).graphProperties({
> >> minNodeSize : 0.5,
> >> maxNodeSize : 5,
> >> minEdgeSize : 1,
> >> maxEdgeSize : 1
> >> }).mouseProperties({
> >> maxRatio : 32
> >> });
> >>
> >> // Parse a GEXF encoded file to fill the graph
> >> sigInst.parseGexf(gexfFile); <<--- error is thrown
> >> here
> >>
> >> // Draw the graph :
> >> sigInst.draw();
> >> }
> >> }
> >>
> >> This seems to be a load order issue, yet I tried swapping the order of
> >> declaration of sigma.parseGexf.js and sigma.min.js, with the same
> result.
> >>
> >> Any thoughts?
> >>
> >> -George
> >>
> >>
> >> On Tue, Jul 2, 2013 at 5:43 PM, George Ludwig  >> >wrote:
> >>
> >>  Cool, thanks a lot!
> >>>
> >>>
> >>> On Tue, Jul 2, 2013 at 3:50 PM, Thiago H de Paula Figueiredo <
> >>> thiag...@gmail.com> wrote:
> >>>
> >>>  On Tue, 02 Jul 2013 19:47:14 -0300, George Ludwig <
>  georgelud...@gmail.com>
>  wrote:
> 
>   I think I got it...so to initialize my graph I need to pas it a file
> 
> > name...is it most appropriate to use JavaScriptSupport.**
> >
> > addInitializerCall()
> > so that the name of the file can be pulled from the @parameter of the
> > component?
> >
> >
>  For the parameter, it will make no difference. Regardless of using
>  addScript() or addInitializerCall() you'll need to pass the file name
> in
>  the parameters of these methods. As you've never did this before, use
>  addScript(), which is easier.
> 
> 
>  --
>  Thiago H. de Paula Figueiredo
> 
>  --**
>  --**-
>  To unsubscribe, e-mail: users-unsubscribe@tapestry.**a**pache.org<
> http://apache.org>
>   users-unsubscr...@tapestry.apache.org>
>  >
> 
>  For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 
> >>>
> >
> > --
> > Thiago H. de Paula Figueiredo
> >
> > --**--**-
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<
> users-unsubscr...@tapestry.apache.org>
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>


Re: guidance with integrating yet another js library as custom component

2013-07-07 Thread Geoff Callender
These examples describe the pros and cons of addScript() and
addInitializerCall():

-
http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/javascript
-
http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/reusable
-
http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/robust

HTH,

Geoff


On 3 July 2013 06:25, George Ludwig  wrote:

> Thanks for the info Thiago!
>
> >>  Couldn't you just @Import to get the JS files included and
> JavaScriptSupport.addScript() to invoke JS functions?
>
> That's the route I ended up taking to import the necessary js files, but
> I'm still unclear on exactly how to use  JavaScriptSupport.addScript() to
> create an instance of the sigma viewer. For example, I don't understand
> when it's appropriate to use JavaScriptSupport.addInitializerCall()
> vs. JavaScriptSupport.addScript()
>
>
>
> On Tue, Jul 2, 2013 at 12:01 PM, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Tue, 02 Jul 2013 15:35:20 -0300, George Ludwig <
> georgelud...@gmail.com>
> > wrote:
> >
> >  I'm working on a custom component of the SigmaJS visualization library (
> >> http://sigmajs.org).
> >> Specifically, this example: http://sigmajs.org/examples/**
> >> gexf_example.html <http://sigmajs.org/examples/gexf_example.html>
> >>
> >
> > Interesting!
> >
> >
> >  I've been studying the got5 examples of js library integration, and they
> >> are all pretty complex, and it's a challenge to figure out what I really
> >> need to do.
> >>
> >
> > They are complex because the project tapestry-jquery is about
> > reimplementing Tapestry's built-in Java in jQuery. You're thinking what
> you
> > need to do in your example is way too complex than reality. Couldn't you
> > just @Import to get the JS files included and
> JavaScriptSupport.addScript()
> > to invoke JS functions?
> >
> >
> >  I've been working form this tutorial:
> >> http://wiki.apache.org/**tapestry/**Tapestry5AndJavaScriptExplaine**d<
> http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained>however,
> >> it's for a mixin and I'm unclear if there is a material difference
> >> between creating a component vs. a mixin.
> >>
> >
> > For the JavaScript part, it's absolutely the same in pages, components
> and
> > mixins.
> >
> >
> >
> >> Any guidance is much appreciated!
> >>
> >> -George
> >>
> >
> >
> > --
> > Thiago H. de Paula Figueiredo
> >
> > --**--**-
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<
> users-unsubscr...@tapestry.apache.org>
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>


Re: guidance with integrating yet another js library as custom component

2013-07-07 Thread George Ludwig
Here's my final (I hope block):

What is happening is that when I try to load anyfile.anyextension using
javascript, the tapestry app always returns the contents of index page,
rather than the contents of the requested file.

I also tried loading the file straight from the browser (i.e.,
http://localhost:8080/myfile.ext) and it still returns the contents of the
index page. It returns the same thing even when I type in a URL for a
non-existent file.

Is this a tapestry or jetty setting that I've missed?


On Thu, Jul 4, 2013 at 3:32 PM, George Ludwig wrote:

> Thiago,
>
> You're definitely right, it's now a JS issue. I figured out that somehow I
> had downloaded a garbled sigma.parseGexf.js file, which was part of the
> problem.
>
> Quick javascript question: when I pass the filename for parsing to the
> gexf parser, I currently pass it with relationship to the webapp root...but
> since it still does not render (and everything else looks good right now),
> I'm assuming that I the JS needs a fully qualified local path.
>
> Thanks again for your input...
>
> -George
>
>
> On Thu, Jul 4, 2013 at 4:22 AM, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
>> Uncaught SyntaxError: Unexpected token < sigma.parseGexf.js:3
>>> Uncaught TypeError: Object # has no method 'parseGexf'
>>> tap5-sigma.js:24
>>>
>>
>> Are you sure sigma.parseGexf.js is correct? What's in line 24 of
>> tap5-sigma.js? Anyway, it seems that now this error is completely about
>> Sigma and JavaScript and not about Tapestry itself. What Tapestry version
>> are you using? JavaScript minification is enabled?
>>
>>
>> On Thu, 04 Jul 2013 01:36:04 -0300, George Ludwig 
>> wrote:
>>
>>  I'm at a point where it seems to me that it really should be working,
>>> yet I
>>> get this error in the javascript console:
>>>
>>>
>>> The method it can't find, parseGexf, is in the file sigma.parseGexf.js,
>>> and
>>> I've included it in the component's java file:
>>>
>>> @Import(library={"classpath:**com/intuit/tapestry5/sigmajs/**
>>> asset/sigma.min.js",
>>>  "classpath:com/intuit/**tapestry5/sigmajs/asset/sigma.**parseGexf.js",
>>>  "classpath:com/intuit/**tapestry5/sigmajs/asset/tap5-**sigma.js"})
>>>
>>>
>>> Here is the complete javascript file that is being executed in order to
>>> do
>>> the initialization:
>>>
>>> var sigmajs = Class.create();
>>> sigmajs.prototype = {
>>> initialize : function(id, gexfFile) {
>>>  // Instantiate sigma.js and customize rendering
>>> var sigInst = sigma.init(document.**getElementById(id)).**
>>> drawingProperties({
>>>  <<--- no error is thrown here
>>> defaultLabelColor : '#fff',
>>> defaultLabelSize : 14,
>>> defaultLabelBGColor : '#fff',
>>> defaultLabelHoverColor : '#000',
>>> labelThreshold : 6,
>>> defaultEdgeType : 'curve'
>>> }).graphProperties({
>>> minNodeSize : 0.5,
>>> maxNodeSize : 5,
>>> minEdgeSize : 1,
>>> maxEdgeSize : 1
>>> }).mouseProperties({
>>> maxRatio : 32
>>> });
>>>
>>> // Parse a GEXF encoded file to fill the graph
>>> sigInst.parseGexf(gexfFile); <<--- error is thrown
>>> here
>>>
>>> // Draw the graph :
>>> sigInst.draw();
>>> }
>>> }
>>>
>>> This seems to be a load order issue, yet I tried swapping the order of
>>> declaration of sigma.parseGexf.js and sigma.min.js, with the same result.
>>>
>>> Any thoughts?
>>>
>>> -George
>>>
>>>
>>> On Tue, Jul 2, 2013 at 5:43 PM, George Ludwig >> >wrote:
>>>
>>>  Cool, thanks a lot!


 On Tue, Jul 2, 2013 at 3:50 PM, Thiago H de Paula Figueiredo <
 thiag...@gmail.com> wrote:

  On Tue, 02 Jul 2013 19:47:14 -0300, George Ludwig <
> georgelud...@gmail.com>
> wrote:
>
>  I think I got it...so to initialize my graph I need to pas it a file
>
>> name...is it most appropriate to use JavaScriptSupport.**
>>
>> addInitializerCall()
>> so that the name of the file can be pulled from the @parameter of the
>> component?
>>
>>
> For the parameter, it will make no difference. Regardless of using
> addScript() or addInitializerCall() you'll need to pass the file name
> in
> the parameters of these methods. As you've never did this before, use
> addScript(), which is easier.
>
>
> --
> Thiago H. de Paula Figueiredo
>
> --**
> --**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**a**pache.org
> 
> >
>
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
>

>>
>> --
>> Thiago H. de Paula Figueiredo
>>
>> --**--**-
>> To unsubscribe, e-mail: 
>> users-unsubscribe@tapestry.**apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>


Re: guidance with integrating yet another js library as custom component

2013-07-04 Thread George Ludwig
Thiago,

You're definitely right, it's now a JS issue. I figured out that somehow I
had downloaded a garbled sigma.parseGexf.js file, which was part of the
problem.

Quick javascript question: when I pass the filename for parsing to the gexf
parser, I currently pass it with relationship to the webapp root...but
since it still does not render (and everything else looks good right now),
I'm assuming that I the JS needs a fully qualified local path.

Thanks again for your input...

-George


On Thu, Jul 4, 2013 at 4:22 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Uncaught SyntaxError: Unexpected token < sigma.parseGexf.js:3
>> Uncaught TypeError: Object # has no method 'parseGexf' tap5-sigma.js:24
>>
>
> Are you sure sigma.parseGexf.js is correct? What's in line 24 of
> tap5-sigma.js? Anyway, it seems that now this error is completely about
> Sigma and JavaScript and not about Tapestry itself. What Tapestry version
> are you using? JavaScript minification is enabled?
>
>
> On Thu, 04 Jul 2013 01:36:04 -0300, George Ludwig 
> wrote:
>
>  I'm at a point where it seems to me that it really should be working, yet
>> I
>> get this error in the javascript console:
>>
>>
>> The method it can't find, parseGexf, is in the file sigma.parseGexf.js,
>> and
>> I've included it in the component's java file:
>>
>> @Import(library={"classpath:**com/intuit/tapestry5/sigmajs/**
>> asset/sigma.min.js",
>>  "classpath:com/intuit/**tapestry5/sigmajs/asset/sigma.**parseGexf.js",
>>  "classpath:com/intuit/**tapestry5/sigmajs/asset/tap5-**sigma.js"})
>>
>>
>> Here is the complete javascript file that is being executed in order to do
>> the initialization:
>>
>> var sigmajs = Class.create();
>> sigmajs.prototype = {
>> initialize : function(id, gexfFile) {
>>  // Instantiate sigma.js and customize rendering
>> var sigInst = sigma.init(document.**getElementById(id)).**
>> drawingProperties({
>>  <<--- no error is thrown here
>> defaultLabelColor : '#fff',
>> defaultLabelSize : 14,
>> defaultLabelBGColor : '#fff',
>> defaultLabelHoverColor : '#000',
>> labelThreshold : 6,
>> defaultEdgeType : 'curve'
>> }).graphProperties({
>> minNodeSize : 0.5,
>> maxNodeSize : 5,
>> minEdgeSize : 1,
>> maxEdgeSize : 1
>> }).mouseProperties({
>> maxRatio : 32
>> });
>>
>> // Parse a GEXF encoded file to fill the graph
>> sigInst.parseGexf(gexfFile); <<--- error is thrown
>> here
>>
>> // Draw the graph :
>> sigInst.draw();
>> }
>> }
>>
>> This seems to be a load order issue, yet I tried swapping the order of
>> declaration of sigma.parseGexf.js and sigma.min.js, with the same result.
>>
>> Any thoughts?
>>
>> -George
>>
>>
>> On Tue, Jul 2, 2013 at 5:43 PM, George Ludwig > >wrote:
>>
>>  Cool, thanks a lot!
>>>
>>>
>>> On Tue, Jul 2, 2013 at 3:50 PM, Thiago H de Paula Figueiredo <
>>> thiag...@gmail.com> wrote:
>>>
>>>  On Tue, 02 Jul 2013 19:47:14 -0300, George Ludwig <
 georgelud...@gmail.com>
 wrote:

  I think I got it...so to initialize my graph I need to pas it a file

> name...is it most appropriate to use JavaScriptSupport.**
>
> addInitializerCall()
> so that the name of the file can be pulled from the @parameter of the
> component?
>
>
 For the parameter, it will make no difference. Regardless of using
 addScript() or addInitializerCall() you'll need to pass the file name in
 the parameters of these methods. As you've never did this before, use
 addScript(), which is easier.


 --
 Thiago H. de Paula Figueiredo

 --**
 --**-
 To unsubscribe, e-mail: 
 users-unsubscribe@tapestry.**a**pache.org
 
 >

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



>>>
>
> --
> Thiago H. de Paula Figueiredo
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: guidance with integrating yet another js library as custom component

2013-07-04 Thread Thiago H de Paula Figueiredo

Uncaught SyntaxError: Unexpected token < sigma.parseGexf.js:3
Uncaught TypeError: Object # has no method 'parseGexf'  
tap5-sigma.js:24


Are you sure sigma.parseGexf.js is correct? What's in line 24 of  
tap5-sigma.js? Anyway, it seems that now this error is completely about  
Sigma and JavaScript and not about Tapestry itself. What Tapestry version  
are you using? JavaScript minification is enabled?


On Thu, 04 Jul 2013 01:36:04 -0300, George Ludwig   
wrote:


I'm at a point where it seems to me that it really should be working,  
yet I

get this error in the javascript console:


The method it can't find, parseGexf, is in the file sigma.parseGexf.js,  
and

I've included it in the component's java file:

@Import(library={"classpath:com/intuit/tapestry5/sigmajs/asset/sigma.min.js",
 "classpath:com/intuit/tapestry5/sigmajs/asset/sigma.parseGexf.js",
 "classpath:com/intuit/tapestry5/sigmajs/asset/tap5-sigma.js"})


Here is the complete javascript file that is being executed in order to  
do

the initialization:

var sigmajs = Class.create();
sigmajs.prototype = {
initialize : function(id, gexfFile) {
 // Instantiate sigma.js and customize rendering
var sigInst = sigma.init(document.getElementById(id)).drawingProperties({
 <<--- no error is thrown here
defaultLabelColor : '#fff',
defaultLabelSize : 14,
defaultLabelBGColor : '#fff',
defaultLabelHoverColor : '#000',
labelThreshold : 6,
defaultEdgeType : 'curve'
}).graphProperties({
minNodeSize : 0.5,
maxNodeSize : 5,
minEdgeSize : 1,
maxEdgeSize : 1
}).mouseProperties({
maxRatio : 32
});

// Parse a GEXF encoded file to fill the graph
sigInst.parseGexf(gexfFile); <<--- error is thrown  
here


// Draw the graph :
sigInst.draw();
}
}

This seems to be a load order issue, yet I tried swapping the order of
declaration of sigma.parseGexf.js and sigma.min.js, with the same result.

Any thoughts?

-George


On Tue, Jul 2, 2013 at 5:43 PM, George Ludwig  
wrote:



Cool, thanks a lot!


On Tue, Jul 2, 2013 at 3:50 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

On Tue, 02 Jul 2013 19:47:14 -0300, George Ludwig  


wrote:

 I think I got it...so to initialize my graph I need to pas it a file

name...is it most appropriate to use JavaScriptSupport.**
addInitializerCall()
so that the name of the file can be pulled from the @parameter of the
component?



For the parameter, it will make no difference. Regardless of using
addScript() or addInitializerCall() you'll need to pass the file name  
in

the parameters of these methods. As you've never did this before, use
addScript(), which is easier.


--
Thiago H. de Paula Figueiredo

--**--**-
To unsubscribe, e-mail:  
users-unsubscribe@tapestry.**apache.org

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







--
Thiago H. de Paula Figueiredo

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



Re: guidance with integrating yet another js library as custom component

2013-07-03 Thread George Ludwig
I'm at a point where it seems to me that it really should be working, yet I
get this error in the javascript console:

Uncaught SyntaxError: Unexpected token < sigma.parseGexf.js:3
Uncaught TypeError: Object # has no method 'parseGexf' tap5-sigma.js:24

The method it can't find, parseGexf, is in the file sigma.parseGexf.js, and
I've included it in the component's java file:

@Import(library={"classpath:com/intuit/tapestry5/sigmajs/asset/sigma.min.js",
 "classpath:com/intuit/tapestry5/sigmajs/asset/sigma.parseGexf.js",
 "classpath:com/intuit/tapestry5/sigmajs/asset/tap5-sigma.js"})


Here is the complete javascript file that is being executed in order to do
the initialization:

var sigmajs = Class.create();
sigmajs.prototype = {
initialize : function(id, gexfFile) {
 // Instantiate sigma.js and customize rendering
var sigInst = sigma.init(document.getElementById(id)).drawingProperties({
 <<--- no error is thrown here
defaultLabelColor : '#fff',
defaultLabelSize : 14,
defaultLabelBGColor : '#fff',
defaultLabelHoverColor : '#000',
labelThreshold : 6,
defaultEdgeType : 'curve'
}).graphProperties({
minNodeSize : 0.5,
maxNodeSize : 5,
minEdgeSize : 1,
maxEdgeSize : 1
}).mouseProperties({
maxRatio : 32
});

// Parse a GEXF encoded file to fill the graph
sigInst.parseGexf(gexfFile); <<--- error is thrown here

// Draw the graph :
sigInst.draw();
}
}

This seems to be a load order issue, yet I tried swapping the order of
declaration of sigma.parseGexf.js and sigma.min.js, with the same result.

Any thoughts?

-George


On Tue, Jul 2, 2013 at 5:43 PM, George Ludwig wrote:

> Cool, thanks a lot!
>
>
> On Tue, Jul 2, 2013 at 3:50 PM, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
>> On Tue, 02 Jul 2013 19:47:14 -0300, George Ludwig 
>> wrote:
>>
>>  I think I got it...so to initialize my graph I need to pas it a file
>>> name...is it most appropriate to use JavaScriptSupport.**
>>> addInitializerCall()
>>> so that the name of the file can be pulled from the @parameter of the
>>> component?
>>>
>>
>> For the parameter, it will make no difference. Regardless of using
>> addScript() or addInitializerCall() you'll need to pass the file name in
>> the parameters of these methods. As you've never did this before, use
>> addScript(), which is easier.
>>
>>
>> --
>> Thiago H. de Paula Figueiredo
>>
>> --**--**-
>> To unsubscribe, e-mail: 
>> users-unsubscribe@tapestry.**apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>


Re: guidance with integrating yet another js library as custom component

2013-07-02 Thread George Ludwig
Cool, thanks a lot!


On Tue, Jul 2, 2013 at 3:50 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Tue, 02 Jul 2013 19:47:14 -0300, George Ludwig 
> wrote:
>
>  I think I got it...so to initialize my graph I need to pas it a file
>> name...is it most appropriate to use JavaScriptSupport.**
>> addInitializerCall()
>> so that the name of the file can be pulled from the @parameter of the
>> component?
>>
>
> For the parameter, it will make no difference. Regardless of using
> addScript() or addInitializerCall() you'll need to pass the file name in
> the parameters of these methods. As you've never did this before, use
> addScript(), which is easier.
>
>
> --
> Thiago H. de Paula Figueiredo
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: guidance with integrating yet another js library as custom component

2013-07-02 Thread Thiago H de Paula Figueiredo
On Tue, 02 Jul 2013 19:47:14 -0300, George Ludwig   
wrote:



I think I got it...so to initialize my graph I need to pas it a file
name...is it most appropriate to use  
JavaScriptSupport.addInitializerCall()

so that the name of the file can be pulled from the @parameter of the
component?


For the parameter, it will make no difference. Regardless of using  
addScript() or addInitializerCall() you'll need to pass the file name in  
the parameters of these methods. As you've never did this before, use  
addScript(), which is easier.


--
Thiago H. de Paula Figueiredo

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



Re: guidance with integrating yet another js library as custom component

2013-07-02 Thread George Ludwig
I think I got it...so to initialize my graph I need to pas it a file
name...is it most appropriate to use JavaScriptSupport.addInitializerCall()
so that the name of the file can be pulled from the @parameter of the
component?


On Tue, Jul 2, 2013 at 3:42 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Tue, 02 Jul 2013 17:25:14 -0300, George Ludwig 
> wrote:
>
>  Thanks for the info Thiago!
>>
>>   Couldn't you just @Import to get the JS files included and

>>> JavaScriptSupport.addScript() to invoke JS functions?
>>
>> That's the route I ended up taking to import the necessary js files, but
>> I'm still unclear on exactly how to use  JavaScriptSupport.addScript() to
>> create an instance of the sigma viewer.
>>
>
> Whatever you pass to addScript() is added inside a  tag
> inside the HTML as is. So, if the function that sets up your code in
> JavaScript is initializeGraphs(), for example, call
> JavaScriptSupport.addScript("**initializeGraphs()");. If you need to pass
> some data to it, remember that addScript() follows the String.format()
> format.
>
>
>  For example, I don't understand
>> when it's appropriate to use JavaScriptSupport.**addInitializerCall()
>> vs. JavaScriptSupport.addScript()
>>
>
> Initializer calls are just another way of doing the same, a better one
> than addScript(), but in a harder way. addScript() takes raw JavaScript and
> adds it to the page. An initializer is a function added to the
> Tapestry.Initializer object. addInitializerCall() takes the name of this
> function and the value of the parameters you'll pass to it.
>
>
> --
> Thiago H. de Paula Figueiredo
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: guidance with integrating yet another js library as custom component

2013-07-02 Thread Thiago H de Paula Figueiredo
On Tue, 02 Jul 2013 17:25:14 -0300, George Ludwig   
wrote:



Thanks for the info Thiago!


 Couldn't you just @Import to get the JS files included and

JavaScriptSupport.addScript() to invoke JS functions?

That's the route I ended up taking to import the necessary js files, but
I'm still unclear on exactly how to use  JavaScriptSupport.addScript() to
create an instance of the sigma viewer.


Whatever you pass to addScript() is added inside a  tag  
inside the HTML as is. So, if the function that sets up your code in  
JavaScript is initializeGraphs(), for example, call  
JavaScriptSupport.addScript("initializeGraphs()");. If you need to pass  
some data to it, remember that addScript() follows the String.format()  
format.



For example, I don't understand
when it's appropriate to use JavaScriptSupport.addInitializerCall()
vs. JavaScriptSupport.addScript()


Initializer calls are just another way of doing the same, a better one  
than addScript(), but in a harder way. addScript() takes raw JavaScript  
and adds it to the page. An initializer is a function added to the  
Tapestry.Initializer object. addInitializerCall() takes the name of this  
function and the value of the parameters you'll pass to it.


--
Thiago H. de Paula Figueiredo

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



Re: guidance with integrating yet another js library as custom component

2013-07-02 Thread George Ludwig
Thanks for the info Thiago!

>>  Couldn't you just @Import to get the JS files included and
JavaScriptSupport.addScript() to invoke JS functions?

That's the route I ended up taking to import the necessary js files, but
I'm still unclear on exactly how to use  JavaScriptSupport.addScript() to
create an instance of the sigma viewer. For example, I don't understand
when it's appropriate to use JavaScriptSupport.addInitializerCall()
vs. JavaScriptSupport.addScript()



On Tue, Jul 2, 2013 at 12:01 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Tue, 02 Jul 2013 15:35:20 -0300, George Ludwig 
> wrote:
>
>  I'm working on a custom component of the SigmaJS visualization library (
>> http://sigmajs.org).
>> Specifically, this example: http://sigmajs.org/examples/**
>> gexf_example.html <http://sigmajs.org/examples/gexf_example.html>
>>
>
> Interesting!
>
>
>  I've been studying the got5 examples of js library integration, and they
>> are all pretty complex, and it's a challenge to figure out what I really
>> need to do.
>>
>
> They are complex because the project tapestry-jquery is about
> reimplementing Tapestry's built-in Java in jQuery. You're thinking what you
> need to do in your example is way too complex than reality. Couldn't you
> just @Import to get the JS files included and JavaScriptSupport.addScript()
> to invoke JS functions?
>
>
>  I've been working form this tutorial:
>> http://wiki.apache.org/**tapestry/**Tapestry5AndJavaScriptExplaine**d<http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained>however,
>> it's for a mixin and I'm unclear if there is a material difference
>> between creating a component vs. a mixin.
>>
>
> For the JavaScript part, it's absolutely the same in pages, components and
> mixins.
>
>
>
>> Any guidance is much appreciated!
>>
>> -George
>>
>
>
> --
> Thiago H. de Paula Figueiredo
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: guidance with integrating yet another js library as custom component

2013-07-02 Thread Thiago H de Paula Figueiredo
On Tue, 02 Jul 2013 15:35:20 -0300, George Ludwig   
wrote:



I'm working on a custom component of the SigmaJS visualization library (
http://sigmajs.org).
Specifically, this example: http://sigmajs.org/examples/gexf_example.html


Interesting!


I've been studying the got5 examples of js library integration, and they
are all pretty complex, and it's a challenge to figure out what I really
need to do.


They are complex because the project tapestry-jquery is about  
reimplementing Tapestry's built-in Java in jQuery. You're thinking what  
you need to do in your example is way too complex than reality. Couldn't  
you just @Import to get the JS files included and  
JavaScriptSupport.addScript() to invoke JS functions?



I've been working form this tutorial:
http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained however,
it's for a mixin and I'm unclear if there is a material difference  
between creating a component vs. a mixin.


For the JavaScript part, it's absolutely the same in pages, components and  
mixins.




Any guidance is much appreciated!

-George



--
Thiago H. de Paula Figueiredo

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



guidance with integrating yet another js library as custom component

2013-07-02 Thread George Ludwig
I'm working on a custom component of the SigmaJS visualization library (
http://sigmajs.org).

Specifically, this example: http://sigmajs.org/examples/gexf_example.html

I'm starting with the simplest use case, which is to create a sigma viewer,
passing it a single parameter, which is the name of a GEXF file for it to
parse and display.

I've been studying the got5 examples of js library integration, and they
are all pretty complex, and it's a challenge to figure out what I really
need to do.

I've been working form this tutorial:
http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained however,
it's for a mixin and I'm unclear if there is a material difference between
creating a component vs. a mixin.

Any guidance is much appreciated!

-George


How to access a component(any text field) from custom component

2012-12-17 Thread SAMPY
Issue is related to Tapestry 4 validation issue.
HTML :





where this PaymentSelection is component, that renders the html dynamically
that consist of code as text field. 

Validation Java Code : 

FormBean bean = this.getHotelsFormBean(); 
IValidationDelegate delegate = this.getValidationDelegate(); 

boolean isValid = super.validateForm(bean, delegate); 

try { 
if(Utils.isNullOrEmpty(bean.getHotelName())) { 
String message = this.getMessages().getMessage("bb_ERR5"); 
this.error(delegate, (IFormComponent)
this.getComponent("hotelName"), message, 
   ValidationConstraint.REQUIRED); 
isValid = false; 
} 


 message =  this.getMessage("valid", new String[] { "cardnum" }); 
 this.error(delegate, (IFormComponent)
this.getComponent("paymentSelectionComponent").getComponent("code"),
message, 
 ValidationConstraint.REQUIRED); 

this.getComponent("paymentSelectionComponent").getComponent("code") : this
says as component out of the particular page. but it doesn't bind the error
to the component.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-access-a-component-any-text-field-from-custom-component-tp5718802.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Custom Component Id Other than Class Name

2012-10-14 Thread Lance Java
If you knew what you were doing, you could decorate the
ComponentClassResolver. Warning: experts only ;)
I suggest you download the tapestry sources and take a look at
ComponentClassResolverImpl before attempting this.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Custom-Component-Id-Other-than-Class-Name-tp5716882p5716884.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Custom Component Id Other than Class Name

2012-10-13 Thread Dragan Sahpaski
I guess it's possible that you put components into different "virtual
folders"/packages and then make different library mapping names for
them.
http://tapestry.apache.org/component-libraries.html#ComponentLibraries-Step4%3AConfigurethevirtualfolder

Cheers,
Dragan Sahpaski


On Sun, Oct 14, 2012 at 12:04 AM, Bob Obringer  wrote:
> I've created a library of custom Tapestry components and have been unable to 
> figure out how to use an ID other than class name to reference those 
> components.
>
> The library I'm creating is part of a much larger framework and as such I 
> have requirements for class names.  These names are not what I would like to 
> use for the component ID and I've searched everywhere for a way to customize 
> the ID.
>
> I assume the answer I'm looking for will be "no it's not possible" or "yes, 
> here's a simple solution" but have been unable to find that answer.
>
>
> Thanks,
>
> Bob Obringer
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
>

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



Custom Component Id Other than Class Name

2012-10-13 Thread Bob Obringer
I've created a library of custom Tapestry components and have been unable to 
figure out how to use an ID other than class name to reference those 
components. 

The library I'm creating is part of a much larger framework and as such I have 
requirements for class names.  These names are not what I would like to use for 
the component ID and I've searched everywhere for a way to customize the ID.

I assume the answer I'm looking for will be "no it's not possible" or "yes, 
here's a simple solution" but have been unable to find that answer.


Thanks, 

Bob Obringer
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)



Use page message catalog in custom component

2012-04-17 Thread Beat Durrer
Hi all

I am refactoring some page which have very similar forms.
I thought it would be clever to make a custom component, which
contains a collection of preconfigured form elements.
Some of those fields need page specific field names (the field stay the same).

How can I make page specific messages but still use a component?


- If there is a textfield directly in the page template, I use the
page's message catalog
- If the textfield is put into a component, the page's message catalog
is not applied anymore, only the components catalog.


Cheers.

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



Re: Give Custom Component a "context" that is not Ljava.lang.Object;@828642

2012-04-13 Thread Chris Mylonas

On 13/04/2012, at 11:02 PM, Thiago H. de Paula Figueiredo wrote:

> On Fri, 13 Apr 2012 09:46:04 -0300, Chris Mylonas  wrote:
> 
>> I need to convert from Ljava.lang.Object@234141 to "string representation" 
>> or what value it is (which happens to be a string) I set during render (so 
>> the HTML that is output is good enough for me).
> 
> It seems to me that you haven't understood what I said: if you pass the 
> context parameter without the expansion, your component will receive the 
> original object of type Object[], not a String, so you don't need to convert 
> a String to an Object[]. In your event handler method, the parameter must be 
> an Object[], or, betetr yet, an EventContext.

I think I understood - I was just being stubborn!   Thanks for caring :)
I needed to convert to String, or the ID because of below.

below.
My problem is at render time, everything is fine.
At event time (because it's drag and drop) the context is lost.  Even the 
"value" is lost.
The dragged component has a context, and I retrieve this at event processing.
But I have no idea where the dragged component got dropped - unless I access 
the DOM I guess.
WIth a "context" or something, I can at least iterate through my list until I 
get a match.


I might call it a night - it's just past 11pm here and the coffee will shortly 
wear off :)
-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Give Custom Component a "context" that is not Ljava.lang.Object;@828642

2012-04-13 Thread Thiago H. de Paula Figueiredo
On Fri, 13 Apr 2012 09:46:04 -0300, Chris Mylonas   
wrote:


I need to convert from Ljava.lang.Object@234141 to "string  
representation" or what value it is (which happens to be a string) I set  
during render (so the HTML that is output is good enough for me).


It seems to me that you haven't understood what I said: if you pass the  
context parameter without the expansion, your component will receive the  
original object of type Object[], not a String, so you don't need to  
convert a String to an Object[]. In your event handler method, the  
parameter must be an Object[], or, betetr yet, an EventContext.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Give Custom Component a "context" that is not Ljava.lang.Object;@828642

2012-04-13 Thread Chris Mylonas
bugger.  i think it's null anyway...which is probably what you were both 
leading me to.
i had another field in the event method named context anywaywhich was the 
URL of the event in the form of an Object[]

i'm still back at square one - will review what i have done.

thanks


On 13/04/2012, at 10:33 PM, Thiago H. de Paula Figueiredo wrote:

> On Fri, 13 Apr 2012 08:50:26 -0300, Taha Hafeez Siddiqi 
>  wrote:
> 
>> Hi
> 
> Hi!
> 
>> Try
>> 
>> t:context='currentExtension.number' instead of 
>> t:context='${currentExtension.number}'
> 
> Never never never ever use expansions when passing parameter values. :) 
> Expansions always coerce the value to String and are meant to be used to 
> output values to HTML, never to component parameters.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and 
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


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



Re: Give Custom Component a "context" that is not Ljava.lang.Object;@828642

2012-04-13 Thread Chris Mylonas
never never never ... thanks for the tip.  String is fine for me - it's not the 
most efficient way, but I've got a bit of a problem finding out where my 
dragged (and known) component got dropped.

I need to convert from Ljava.lang.Object@234141 to "string representation" or 
what value it is (which happens to be a string) I set during render (so the 
HTML that is output is good enough for me).


Doing it the never never never way - I can (I think safely) get the string 
value, then look it up in my list when the event is triggered (dropped in this 
case).
The dragged object has a parameter that is received, but the droppedOn 
component can only be retrieved with the @OnEvent annotation - which is good 
for a single page full of components -

I have two custom components - 1.  uses draggable, the other uses droppable.  I 
need to know what gets dropped onto what.

It would be like having two grids with one grid full of draggable rows and the 
other grid with droppable rows.
If I can get the string value of the droppable row, I know which object it is 
(my objects have unique string values so I'm safe in that respect).



On 13/04/2012, at 10:33 PM, Thiago H. de Paula Figueiredo wrote:

> On Fri, 13 Apr 2012 08:50:26 -0300, Taha Hafeez Siddiqi 
>  wrote:
> 
>> Hi
> 
> Hi!
> 
>> Try
>> 
>> t:context='currentExtension.number' instead of 
>> t:context='${currentExtension.number}'
> 
> Never never never ever use expansions when passing parameter values. :) 
> Expansions always coerce the value to String and are meant to be used to 
> output values to HTML, never to component parameters.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and 
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


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



Re: Give Custom Component a "context" that is not Ljava.lang.Object;@828642

2012-04-13 Thread Thiago H. de Paula Figueiredo
On Fri, 13 Apr 2012 08:50:26 -0300, Taha Hafeez Siddiqi  
 wrote:



Hi


Hi!


Try

t:context='currentExtension.number' instead of  
t:context='${currentExtension.number}'


Never never never ever use expansions when passing parameter values. :)  
Expansions always coerce the value to String and are meant to be used to  
output values to HTML, never to component parameters.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Give Custom Component a "context" that is not Ljava.lang.Object;@828642

2012-04-13 Thread Chris Mylonas
Nope.  Tried both context and t:context


HTML came out:
http://tapestry.apache.org/schema/tapestry_5_3.xsd";>

The prop expansion worked ok for html before (below)
Still get [Ljava.lang.Object@34255245 on the event both ways.


I see that using your suggestion is what happens in the Hi-Lo game, when a 
page's template passes a context to the component.
In my case, I'm in the component template - if that makes a difference?


PS - just been reading your OAuth service blogs - hopefully get to 
understanding those things over the weekend - thanks




On 13/04/2012, at 9:50 PM, Taha Hafeez Siddiqi wrote:

> Hi 
> 
> Try 
> 
> t:context='currentExtension.number' instead of 
> t:context='${currentExtension.number}' 
> 
> regards
> Taha
> 
> On Apr 13, 2012, at 5:13 PM, Chris Mylonas wrote:
> 
>> Hi List,
>> 
>> I tried giving a custom component a context (just a String) but when I go to 
>> use it on an event, I get the output to be [Ljava.lang.Object;@783b110a 
>> instead of "1234" which is what is set during rendering.
>> 
>> The output html looks a little strange compared to the component's tml - 
>> like I'm missing something:
>> 
>> http://tapestry.apache.org/schema/tapestry_5_3.xsd";>
>> 
>>  
>> 
>> > xmlns:ns0="http://tapestry.apache.org/schema/tapestry_5_3.xsd";>
>> 
>> 
>> I'm looking at the PageLink component and it's way of getting a context is 
>> as an Object[] rather than a simple String.
>> I'm guessing when it creates the link, there's some magic that happens 
>> underneath to create the "context" into whatever is used in the template to 
>> a valid portion of a URL
>> 
>>   Link link = resources.createPageLink(page, 
>> resources.isBound("context"), context);
>> 
>>   writeLink(writer, link);
>> 
>> Given my above output "[Ljava.lang.Object;@783b110a" - what's the trick to 
>> turn this object for t:context="${currentExtension.number}" into 
>> context="1234" so that the URL that tapestry spits out during the component 
>> event look like 
>> /christest/draggable6.extension.1234.voicemailzone:zonedrop/ISDN1  (where 
>> 1234 is at the moment omitted)
>> 
>> Any hints would be very helpful!!
>> 
>> Cheers
>> Chris
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


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



Re: Give Custom Component a "context" that is not Ljava.lang.Object;@828642

2012-04-13 Thread Taha Hafeez Siddiqi
Hi 

Try 

t:context='currentExtension.number' instead of 
t:context='${currentExtension.number}' 

regards
Taha

On Apr 13, 2012, at 5:13 PM, Chris Mylonas wrote:

> Hi List,
> 
> I tried giving a custom component a context (just a String) but when I go to 
> use it on an event, I get the output to be [Ljava.lang.Object;@783b110a 
> instead of "1234" which is what is set during rendering.
> 
> The output html looks a little strange compared to the component's tml - like 
> I'm missing something:
> 
> http://tapestry.apache.org/schema/tapestry_5_3.xsd";>
> 
>   
> 
>  xmlns:ns0="http://tapestry.apache.org/schema/tapestry_5_3.xsd";>
> 
> 
> I'm looking at the PageLink component and it's way of getting a context is as 
> an Object[] rather than a simple String.
> I'm guessing when it creates the link, there's some magic that happens 
> underneath to create the "context" into whatever is used in the template to a 
> valid portion of a URL
> 
>Link link = resources.createPageLink(page, 
> resources.isBound("context"), context);
> 
>writeLink(writer, link);
> 
> Given my above output "[Ljava.lang.Object;@783b110a" - what's the trick to 
> turn this object for t:context="${currentExtension.number}" into 
> context="1234" so that the URL that tapestry spits out during the component 
> event look like 
> /christest/draggable6.extension.1234.voicemailzone:zonedrop/ISDN1  (where 
> 1234 is at the moment omitted)
> 
> Any hints would be very helpful!!
> 
> Cheers
> Chris


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



Give Custom Component a "context" that is not Ljava.lang.Object;@828642

2012-04-13 Thread Chris Mylonas
Hi List,

I tried giving a custom component a context (just a String) but when I go to 
use it on an event, I get the output to be [Ljava.lang.Object;@783b110a instead 
of "1234" which is what is set during rendering.

The output html looks a little strange compared to the component's tml - like 
I'm missing something:

http://tapestry.apache.org/schema/tapestry_5_3.xsd";>



http://tapestry.apache.org/schema/tapestry_5_3.xsd";>


I'm looking at the PageLink component and it's way of getting a context is as 
an Object[] rather than a simple String.
I'm guessing when it creates the link, there's some magic that happens 
underneath to create the "context" into whatever is used in the template to a 
valid portion of a URL

Link link = resources.createPageLink(page, 
resources.isBound("context"), context);

writeLink(writer, link);

Given my above output "[Ljava.lang.Object;@783b110a" - what's the trick to turn 
this object for t:context="${currentExtension.number}" into context="1234" so 
that the URL that tapestry spits out during the component event look like 
/christest/draggable6.extension.1234.voicemailzone:zonedrop/ISDN1  (where 1234 
is at the moment omitted)

Any hints would be very helpful!!

Cheers
Chris

Re: First Custom Component -> Confused; source = null, but values populated mysteriously

2012-04-04 Thread Az Madu
Are you sure you're not him?  You do have pity on us fools though ;-)



Look at all that Tapestry 'bling'.

Sorry for off topic, but just to also say Thanks to Mr T for answering
everyone's questions and generally being helpful.  I'm still learning lots
of stuff and more so from other users' questions.

" If you have a problem...if no one else can help...and if you can find
them...maybe you can hire...The T- Team."

Regards

Az

On Tue, Apr 3, 2012 at 2:57 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Tue, 03 Apr 2012 10:06:38 -0300, Chris Mylonas 
> wrote:
>
>  thanks again Mr T
>>
>
> heheheh I don't look like him much, but I sometimes read some questions in
> this mailing lists (fortunately, just a few) and think "what's this
> jibber-jabber you're talking?", hehehe
>
>
>  tapestry could benefit from a "rosetta stone" of the equivalent methods
>> of doing the same thing.
>>
>
> That's a good documentation suggestions . . . JIRA please? :) Usually,
> Tapestry avoids to provide more than one way of doing the same thing. On
> the other hand, sometimes the Tapestry flexibility and architecture ends up
> providing alternatives.
>
>
>  i've spent a few hours today templating my first component with
>> MarkupWriter.element()/end(), writeRaw() and .tml files.
>> Each have their strengths.
>>
>
> Yep. Templates are generally easier to read and write, but MarkupWriter is
> better when you have more complex logic and attributes that may or may not
> be added. In addition, MarkupWriter supports recursion (it's just Java
> code, after all), while templates don't.
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: First Custom Component -> Confused; source = null, but values populated mysteriously

2012-04-03 Thread Chris Mylonas
>> tapestry could benefit from a "rosetta stone" of the equivalent methods of 
>> doing the same thing.
> 
> That's a good documentation suggestions . . . JIRA please? :) Usually, 
> Tapestry avoids to provide more than one way of doing the same thing. On the 
> other hand, sometimes the Tapestry flexibility and architecture ends up 
> providing alternatives.


Created fool!  (MR T reference of course)

https://issues.apache.org/jira/browse/TAP5-1894




Re: First Custom Component -> Confused; source = null, but values populated mysteriously

2012-04-03 Thread Thiago H. de Paula Figueiredo
On Tue, 03 Apr 2012 10:06:38 -0300, Chris Mylonas   
wrote:



thanks again Mr T


heheheh I don't look like him much, but I sometimes read some questions in  
this mailing lists (fortunately, just a few) and think "what's this  
jibber-jabber you're talking?", hehehe


tapestry could benefit from a "rosetta stone" of the equivalent methods  
of doing the same thing.


That's a good documentation suggestions . . . JIRA please? :) Usually,  
Tapestry avoids to provide more than one way of doing the same thing. On  
the other hand, sometimes the Tapestry flexibility and architecture ends  
up providing alternatives.


i've spent a few hours today templating my first component with  
MarkupWriter.element()/end(), writeRaw() and .tml files.

Each have their strengths.


Yep. Templates are generally easier to read and write, but MarkupWriter is  
better when you have more complex logic and attributes that may or may not  
be added. In addition, MarkupWriter supports recursion (it's just Java  
code, after all), while templates don't.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: First Custom Component -> Confused; source = null, but values populated mysteriously

2012-04-03 Thread Chris Mylonas
thanks again Mr T

tapestry could benefit from a "rosetta stone" of the equivalent methods of 
doing the same thing.
i've spent a few hours today templating my first component with 
MarkupWriter.element()/end(), writeRaw() and .tml files.
Each have their strengths.

In this case

e.g.

VM arguments
-Dtapestry.production-mode=false -Dtapestry.compress-whitespace=false

VS

AppModule.contributeApplicationDefaults()
configuration.add("tapestry.production-mode", false);
configuration.add("tapestry.compress-whitespace", false) ;


I guess more of the same from here http://tapestry.apache.org/configuration.html


> On Tue, 03 Apr 2012 00:02:36 -0300, Chris Mylonas  wrote:
> 
>> That's awesome!!! Thanks a lot Thiago
>> 
>> VM arguments for the unwashed are:
>> -Dtapestry.production-mode=false -Dtapestry.compress-whitespace=false
> 
> You can use contributeApplicationDefaults() in your AppModule instead if you 
> want.
> 


Re: First Custom Component -> Confused; source = null, but values populated mysteriously

2012-04-03 Thread Thiago H. de Paula Figueiredo
On Tue, 03 Apr 2012 00:02:36 -0300, Chris Mylonas   
wrote:



That's awesome!!! Thanks a lot Thiago

VM arguments for the unwashed are:
-Dtapestry.production-mode=false -Dtapestry.compress-whitespace=false


You can use contributeApplicationDefaults() in your AppModule instead if  
you want.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: First Custom Component -> Confused; source = null, but values populated mysteriously

2012-04-02 Thread Chris Mylonas
That's awesome!!! Thanks a lot Thiago

VM arguments for the unwashed are:
-Dtapestry.production-mode=false -Dtapestry.compress-whitespace=false


On 03/04/2012, at 12:36 PM, Thiago H. de Paula Figueiredo wrote:

> On Mon, 02 Apr 2012 23:02:17 -0300, Chris Mylonas  wrote:
> 
>> Hello List,
> 
> Hi!
> 
>> When I changed my component's beginRender() on a whim to see if I get an 
>> exception, I was surprised to see the value that the Grid prints to the 
>> screen was available to my component - yet everything about it in the 
>> debugger says null - i.e. source = null, currentItem = null.
> 
> Which version are you using? What's the value of the configuration symbol 
> tapestry.production-mode? Since some not-so-recent version, when not in 
> production mode, Tapestry updates the field values so they can be seen in the 
> debugger.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and 
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br


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



Re: First Custom Component -> Confused; source = null, but values populated mysteriously

2012-04-02 Thread Chris Mylonas
oh!

sounds good.  I'm using 5.3.2 and my production mode symbol is the default 
because I've been ignorant to all that sort of stuff in the past, now it's 
biting me back.



On 03/04/2012, at 12:36 PM, Thiago H. de Paula Figueiredo wrote:

> On Mon, 02 Apr 2012 23:02:17 -0300, Chris Mylonas  wrote:
> 
>> Hello List,
> 
> Hi!
> 
>> When I changed my component's beginRender() on a whim to see if I get an 
>> exception, I was surprised to see the value that the Grid prints to the 
>> screen was available to my component - yet everything about it in the 
>> debugger says null - i.e. source = null, currentItem = null.
> 
> Which version are you using? What's the value of the configuration symbol 
> tapestry.production-mode? Since some not-so-recent version, when not in 
> production mode, Tapestry updates the field values so they can be seen in the 
> debugger.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and 
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br


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



Re: First Custom Component -> Confused; source = null, but values populated mysteriously

2012-04-02 Thread Thiago H. de Paula Figueiredo
On Mon, 02 Apr 2012 23:02:17 -0300, Chris Mylonas   
wrote:



Hello List,


Hi!

When I changed my component's beginRender() on a whim to see if I get an  
exception, I was surprised to see the value that the Grid prints to the  
screen was available to my component - yet everything about it in the  
debugger says null - i.e. source = null, currentItem = null.


Which version are you using? What's the value of the configuration symbol  
tapestry.production-mode? Since some not-so-recent version, when not in  
production mode, Tapestry updates the field values so they can be seen in  
the debugger.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



First Custom Component -> Confused; source = null, but values populated mysteriously

2012-04-02 Thread Chris Mylonas
Hello List,

I'm confused.  In setting up the debugger and carefully working through my code 
to watch the "source" and "currentItem" fields, I was always watching them set 
to null.
I've followed through Grid & Loop to find where the values are fetched 
(cachingDataSource for Grid) but there's a lot of null values in debugging as 
I'm used.

When I changed my component's beginRender() on a whim to see if I get an 
exception, I was surprised to see the value that the Grid prints to the screen 
was available to my component - yet everything about it in the debugger says 
null - i.e. source = null, currentItem = null.

Could someone help me understand how to I get my head around this?I think I 
understand that Tapestry wraps all my stuff up in "proxies" via conduits and 
workers and what have you, but it still seems a little odd to see null's in my 
debugger.


Any help will be graciously accepted whilst I try and get some js (jquery) no 
less to work with my component :)

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



Re: Custom Component - @BeforeRenderBody not rendering stuff

2012-04-02 Thread Chris Mylonas
Thanks

My "source" (and whatever the iterator returns) are always null...so I'll have 
to find out why that happens.

On 02/04/2012, at 10:14 PM, Lance Java wrote:

> Tapestry's own loop component might give you some inspiration too
> http://tapestry.apache.org/5.3/apidocs/src-html/org/apache/tapestry5/corelib/components/Loop.html
> 
> 
> On Monday, 2 April 2012, Lance Java  wrote:
>> 
>> Perhaps this diagram will help to debug
> http://tapestry.apache.org/component-rendering.html
>> 
>> On Monday, 2 April 2012, Chris Mylonas  wrote:
>>> Hi Tapestry List,
>>> 
>>> After spending a few hours with render phases and all that comes with it
> (heartbeat/resources) I'm in a bit of a jam that I don't know where to go
> next.
>>> I'm setting up a basic component called PhoneView that receives an
> ArrayList of Phone objects...similar to the Tree example on the wiki [1]
>>> 
>>> @CleanupRender & @BeforeRenderBody have the same code to make it easy
> for the beginner (me!) to see his progress...
>>> There are 2 items in the array list I have created using a BeanEditForm,
> so I presume I should see three lots of the div saying "CHRIS! This is your
> amazing test div - " with the render phase name.  (2 x BeforeRenderBody) +
> (1 x CleanupRender).
>>> 
>>> I'm not :(
>>> 
>>> Running your eye over this code/template...can you help me?
>>> 
>>> 
>>>   /**
>>>* Defines the source of the phones
>>>*/
>>>   @Parameter(required = true)
>>>   private ArrayList source ;
>>> 
>>>   /**
>>>* Iterator to go over the source (Phone) elements
>>>*/
>>>   private Iterator iterator;
>>> 
>>>   /**
>>>*
>>>*/
>>>   @Inject
>>>   private ComponentResources resources ;
>>> 
>>>   /**
>>>*
>>>*/
>>>   @Parameter
>>>   private Phone currentPhone ;
>>> 
>>>   /**
>>>*
>>>*/
>>>   @Parameter(defaultPrefix = BindingConstants.LITERAL)
>>>   private Block empty;
>>> 
>>>   /**
>>>*
>>>*/
>>>   @Environmental
>>>   private Heartbeat heartbeat ;
>>> 
>>>   /**
>>>* @return
>>>*/
>>>   @SetupRender
>>>   boolean SetupRender(){
>>>if( source == null ){
>>>return false ;
>>>}
>>>this.iterator = source.iterator();
>>>return (iterator.hasNext());
>>>   }
>>> 
>>>   @BeginRender
>>>   void beginRender(){
>>>   currentPhone = iterator.next();
>>>   heartbeat.begin();
>>>   }
>>> 
>>>   @BeforeRenderBody
>>>   void beforeRenderBody(MarkupWriter writer){
>>> 
>>>   Element cur = writer.element("div",
>>> 
> "class","userbackground").addClassName("adifferentbackground");
>>>   cur.text("CHRIS! This is your amazing test div -
> beforeRenderBody");
>>>   writer.end();
>>> 
>>> 
>>>   resources.renderInformalParameters(writer);
>>>   }
>>>   /**
>>>* @return
>>>*/
>>>   @AfterRender
>>>   boolean afterRender(){
>>>   heartbeat.end();
>>>   return (!iterator.hasNext());
>>>   }
>>> 
>>>   /**
>>>* @param writer
>>>*/
>>>   @CleanupRender
>>>   void cleanupRender(MarkupWriter writer){
>>>   Element cur = writer.element("div",
>>> 
> "class","userbackground").addClassName("adifferentbackground");
>>>   cur.text("CHRIS! This is your amazing test div -
> cleanupRender");
>>>   writer.end();
>>>   }
>>> 
>>> 
>>> And the tml snippet from Index.tml
>>> 
>>> 
>>> 
>>> Add Phone
>>> 
>>> Chris 1
>>> 
>>> 
>>> 
>>> Chris 2
>>> 
>>> 
>>> 
>>> Thanks
>>> Chris
>>> 
>>> 
>>> 
>>> [1] =
> https://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents


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



Re: Custom Component - @BeforeRenderBody not rendering stuff

2012-04-02 Thread Lance Java
Tapestry's own loop component might give you some inspiration too
http://tapestry.apache.org/5.3/apidocs/src-html/org/apache/tapestry5/corelib/components/Loop.html


On Monday, 2 April 2012, Lance Java  wrote:
>
> Perhaps this diagram will help to debug
http://tapestry.apache.org/component-rendering.html
>
> On Monday, 2 April 2012, Chris Mylonas  wrote:
>> Hi Tapestry List,
>>
>> After spending a few hours with render phases and all that comes with it
(heartbeat/resources) I'm in a bit of a jam that I don't know where to go
next.
>> I'm setting up a basic component called PhoneView that receives an
ArrayList of Phone objects...similar to the Tree example on the wiki [1]
>>
>> @CleanupRender & @BeforeRenderBody have the same code to make it easy
for the beginner (me!) to see his progress...
>> There are 2 items in the array list I have created using a BeanEditForm,
so I presume I should see three lots of the div saying "CHRIS! This is your
amazing test div - " with the render phase name.  (2 x BeforeRenderBody) +
(1 x CleanupRender).
>>
>> I'm not :(
>>
>> Running your eye over this code/template...can you help me?
>>
>>
>>/**
>> * Defines the source of the phones
>> */
>>@Parameter(required = true)
>>private ArrayList source ;
>>
>>/**
>> * Iterator to go over the source (Phone) elements
>> */
>>private Iterator iterator;
>>
>>/**
>> *
>> */
>>@Inject
>>private ComponentResources resources ;
>>
>>/**
>> *
>> */
>>@Parameter
>>private Phone currentPhone ;
>>
>>/**
>> *
>> */
>>@Parameter(defaultPrefix = BindingConstants.LITERAL)
>>private Block empty;
>>
>>/**
>> *
>> */
>>@Environmental
>>private Heartbeat heartbeat ;
>>
>>/**
>> * @return
>> */
>>@SetupRender
>>boolean SetupRender(){
>> if( source == null ){
>> return false ;
>> }
>> this.iterator = source.iterator();
>> return (iterator.hasNext());
>>}
>>
>>@BeginRender
>>void beginRender(){
>>currentPhone = iterator.next();
>>heartbeat.begin();
>>}
>>
>>@BeforeRenderBody
>>void beforeRenderBody(MarkupWriter writer){
>>
>>Element cur = writer.element("div",
>>
 "class","userbackground").addClassName("adifferentbackground");
>>cur.text("CHRIS! This is your amazing test div -
beforeRenderBody");
>>writer.end();
>>
>>
>>resources.renderInformalParameters(writer);
>>}
>>/**
>> * @return
>> */
>>@AfterRender
>>boolean afterRender(){
>>heartbeat.end();
>>return (!iterator.hasNext());
>>}
>>
>>/**
>> * @param writer
>> */
>>@CleanupRender
>>void cleanupRender(MarkupWriter writer){
>>Element cur = writer.element("div",
>>
 "class","userbackground").addClassName("adifferentbackground");
>>cur.text("CHRIS! This is your amazing test div -
cleanupRender");
>>writer.end();
>>}
>>
>>
>> And the tml snippet from Index.tml
>>
>> 
>> 
>> Add Phone
>> 
>> Chris 1
>> 
>> 
>> 
>> Chris 2
>>
>>
>>
>> Thanks
>> Chris
>>
>>
>>
>> [1] =
https://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents


Re: Custom Component - @BeforeRenderBody not rendering stuff

2012-04-02 Thread Lance Java
Perhaps this diagram will help to debug
http://tapestry.apache.org/component-rendering.html

On Monday, 2 April 2012, Chris Mylonas  wrote:
> Hi Tapestry List,
>
> After spending a few hours with render phases and all that comes with it
(heartbeat/resources) I'm in a bit of a jam that I don't know where to go
next.
> I'm setting up a basic component called PhoneView that receives an
ArrayList of Phone objects...similar to the Tree example on the wiki [1]
>
> @CleanupRender & @BeforeRenderBody have the same code to make it easy for
the beginner (me!) to see his progress...
> There are 2 items in the array list I have created using a BeanEditForm,
so I presume I should see three lots of the div saying "CHRIS! This is your
amazing test div - " with the render phase name.  (2 x BeforeRenderBody) +
(1 x CleanupRender).
>
> I'm not :(
>
> Running your eye over this code/template...can you help me?
>
>
>/**
> * Defines the source of the phones
> */
>@Parameter(required = true)
>private ArrayList source ;
>
>/**
> * Iterator to go over the source (Phone) elements
> */
>private Iterator iterator;
>
>/**
> *
> */
>@Inject
>private ComponentResources resources ;
>
>/**
> *
> */
>@Parameter
>private Phone currentPhone ;
>
>/**
> *
> */
>@Parameter(defaultPrefix = BindingConstants.LITERAL)
>private Block empty;
>
>/**
> *
> */
>@Environmental
>private Heartbeat heartbeat ;
>
>/**
> * @return
> */
>@SetupRender
>boolean SetupRender(){
> if( source == null ){
> return false ;
> }
> this.iterator = source.iterator();
> return (iterator.hasNext());
>}
>
>@BeginRender
>void beginRender(){
>currentPhone = iterator.next();
>heartbeat.begin();
>}
>
>@BeforeRenderBody
>void beforeRenderBody(MarkupWriter writer){
>
>Element cur = writer.element("div",
>
 "class","userbackground").addClassName("adifferentbackground");
>cur.text("CHRIS! This is your amazing test div -
beforeRenderBody");
>writer.end();
>
>
>resources.renderInformalParameters(writer);
>}
>/**
> * @return
> */
>@AfterRender
>boolean afterRender(){
>heartbeat.end();
>return (!iterator.hasNext());
>}
>
>/**
> * @param writer
> */
>@CleanupRender
>void cleanupRender(MarkupWriter writer){
>Element cur = writer.element("div",
>
 "class","userbackground").addClassName("adifferentbackground");
>cur.text("CHRIS! This is your amazing test div -
cleanupRender");
>writer.end();
>}
>
>
> And the tml snippet from Index.tml
>
> 
> 
> Add Phone
> 
> Chris 1
> 
> 
> 
> Chris 2
>
>
>
> Thanks
> Chris
>
>
>
> [1] =
https://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents


Custom Component - @BeforeRenderBody not rendering stuff

2012-04-01 Thread Chris Mylonas
Hi Tapestry List,

After spending a few hours with render phases and all that comes with it 
(heartbeat/resources) I'm in a bit of a jam that I don't know where to go next.
I'm setting up a basic component called PhoneView that receives an ArrayList of 
Phone objects...similar to the Tree example on the wiki [1]

@CleanupRender & @BeforeRenderBody have the same code to make it easy for the 
beginner (me!) to see his progress...
There are 2 items in the array list I have created using a BeanEditForm, so I 
presume I should see three lots of the div saying "CHRIS! This is your amazing 
test div - " with the render phase name.  (2 x BeforeRenderBody) + (1 x 
CleanupRender).

I'm not :(

Running your eye over this code/template...can you help me?


/**
 * Defines the source of the phones
 */
@Parameter(required = true)
private ArrayList source ;

/**
 * Iterator to go over the source (Phone) elements
 */
private Iterator iterator;

/**
 * 
 */
@Inject
private ComponentResources resources ;

/**
 * 
 */
@Parameter
private Phone currentPhone ;

/**
 * 
 */
@Parameter(defaultPrefix = BindingConstants.LITERAL)
private Block empty;

/**
 * 
 */
@Environmental
private Heartbeat heartbeat ;

/**
 * @return
 */
@SetupRender
boolean SetupRender(){
 if( source == null ){
 return false ;
 }
 this.iterator = source.iterator();
 return (iterator.hasNext());
}

@BeginRender
void beginRender(){
currentPhone = iterator.next();
heartbeat.begin();  
}

@BeforeRenderBody
void beforeRenderBody(MarkupWriter writer){

Element cur = writer.element("div",

"class","userbackground").addClassName("adifferentbackground");
cur.text("CHRIS! This is your amazing test div - 
beforeRenderBody");
writer.end();


resources.renderInformalParameters(writer);
}
/**
 * @return
 */
@AfterRender
boolean afterRender(){
heartbeat.end();
return (!iterator.hasNext());
}

/**
 * @param writer
 */
@CleanupRender
void cleanupRender(MarkupWriter writer){
Element cur = writer.element("div",

"class","userbackground").addClassName("adifferentbackground");
cur.text("CHRIS! This is your amazing test div - 
cleanupRender");
writer.end();
}


And the tml snippet from Index.tml



Add Phone

Chris 1



Chris 2



Thanks
Chris



[1] = https://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents

Re: Create Custom Component + Tapestry 5 API Docs - best place to view?

2012-03-28 Thread Chris Mylonas
Hmmm... I changed search engines for a better result :)
http://tapestry.apache.org/5.3.2/apidocs/

That should get me looking at more modern api docs..

Thanks

On 29/03/2012, at 5:07 PM, Chris Mylonas wrote:

> Hi Tapestry List,
> 
> I've found a couple of days to create a custom component!
> My references are for the task are:
> 
> https://code.google.com/p/shams/wiki/Component
> https://tapestry.apache.org/component-rendering.html
> https://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents
> 
> Looking for the TAP5 API Docs it says 5.1.0.5
> https://tapestry.apache.org/tapestry5/apidocs/
> 
> Are there more current ones (5.3.x) available?
> Or
> How can I bulid my own?  I've checked out trunk and looking at the Grid 
> component and want to find out more about the first annotation 
> @SupportsInformalParameters
> 
> Thanks
> Chris



Create Custom Component + Tapestry 5 API Docs - best place to view?

2012-03-28 Thread Chris Mylonas
Hi Tapestry List,

I've found a couple of days to create a custom component!
My references are for the task are:

https://code.google.com/p/shams/wiki/Component
https://tapestry.apache.org/component-rendering.html
https://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents

Looking for the TAP5 API Docs it says 5.1.0.5
https://tapestry.apache.org/tapestry5/apidocs/

Are there more current ones (5.3.x) available?
Or
How can I bulid my own?  I've checked out trunk and looking at the Grid 
component and want to find out more about the first annotation 
@SupportsInformalParameters

Thanks
Chris

Re: Boolean Return Values in Custom Component Events

2012-03-21 Thread Steve Eynon
Food for future thought - the way the event return value is used for
multiple purposes and may, or may not be passed to your callback seems
a little messy. Currently we have -

in ComponentPageElementImpl:

  ComponentEventCallback wrapped = new ComponentEventCallback() {
public boolean handleResult(Object result) {
  // Boolean value is not passed to the handler; it will be true
(abort event)
  // or false (continue looking for event handlers).

  if (result instanceof Boolean)
  return (Boolean) result;

  return providedHandler.handleResult(result);
}
  };

I guess I would rather the callback not be wrapped and instead have an
abstract implmentation for the default Boolean behaviour.

Steve.

--
Steve Eynon
---
"If at first you don't succeed,
   so much for skydiving!"


On 21 March 2012 20:19, Thiago H. de Paula Figueiredo
 wrote:
> On Wed, 21 Mar 2012 00:28:25 -0300, Steve Eynon
>  wrote:
>
>> Hi,
>
>
> Hi!
>
>
>> So it seems Boolean is a 'reserved' event return value.
>
>
> 100% correct.
>
>
>> Is there
>> another way to determine if an event was aborted via a true return
>> value or do need to make my own Boolean enum?
>
>
> As you said, create your own class for the return value.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>

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



Boolean Return Values in Custom Component Events

2012-03-20 Thread Steve Eynon
Hi,

I wish to raise an event from a component and abort further processing
if true is returned from any event handlers - only I don't know how!

ComponentResources.triggerEvent() returns true if *any* event handler
was invoked, regardless of what it returns.

Passing a ComponentEventCallback doesn't work either because (as
quoted from ComponentPageElementImpl source) "Boolean value is not
passed to the handler;"

So it seems Boolean is a 'reserved' event return value. Is there
another way to determine if an event was aborted via a true return
value or do need to make my own Boolean enum?

Cheers,

Steve.
--
Steve Eynon

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



Re: Rendering Custom Component via Zone

2011-10-21 Thread Times2

Thiago H de Paula Figueiredo wrote:
> 
> 
> You're triggering your own event here, so what happens after your handler  
> method is exactly what you put inside your implementation of the  
> ComponentEventcallback's handleResult() method. Try @Inject'ing into your  
> component class ComponentEventResultProcessor and using its  
> processResultValue() method passing the Block instance you've received.
> 
> 
> 


Thanks a lot, that worked. I have injected
ComponentEventResultProcessor("AjaxComponentEventResultProcessor"
implementation)

@InjectService("AjaxComponentEventResultProcessor")
private ComponentEventResultProcessor 
componentEventResultProcessor;

 and wrapped it via ComponentResultProcessorWrapper

private ComponentResultProcessorWrapper callback = new
ComponentResultProcessorWrapper(componentEventResultProcessor);

boolean onSuccessFromSignInForm() {
componentResources.triggerEvent("DesiredMethodName", null, callback);
}



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Rendering-Custom-Component-via-Zone-tp4918130p4925552.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Rendering Custom Component via Zone

2011-10-19 Thread Thiago H. de Paula Figueiredo
On Wed, 19 Oct 2011 13:03:03 -0200, Times2   
wrote:



Hi,


Hi!


I have problem with replacing one custom component with another one


Remember Tapestry doesn't make any difference between components provided  
by it and components provided by you. ;)


via AJAX, using zone component. Replacing first component with second  
should

happen on action inside first component.
On parent page i have one block(with second component inside him) , zone
component and first component inside her(zone).
private ComponentEventCallback callback = new ComponentEventCallback() {

public boolean handleResult(Object result) {
if(!(result instanceof Block)){

return true;
}
return false;
}
};


You're triggering your own event here, so what happens after your handler  
method is exactly what you put inside your implementation of the  
ComponentEventcallback's handleResult() method. Try @Inject'ing into your  
component class ComponentEventResultProcessor and using its  
processResultValue() method passing the Block instance you've received.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Rendering Custom Component via Zone

2011-10-19 Thread Times2
Hi,

I have problem with replacing one custom component with another one via
AJAX, using zone component. Replacing first component with second should
happen on action inside first component. 
On parent page i have one block(with second component inside him) , zone
component and first component inside her(zone).

Event bubbling is working (method in the first component is invoking the
method in the parent page) but not as i was hopping to(it doesn't change the
first component with the second one).
 
Any help i can get is very much appreciated.  

Sorry for the wall of code.



//parent page

public class Index {

@Property
@InjectComponent
private Zone loginzone;

@Component
private SignUp signUp;

@Component
private SignIn singin;

@Inject
private Block loginblock;

public Block onProba() {


return loginblock;
}

}


Index.tml 

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
xmlns:p="tapestry:parameter">













SignIn.tml

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>








//first component

SignIn.java

public class SignIn {

@Inject
private ComponentResources componentResources;

@Component
private Form signinform;

@Parameter(defaultPrefix = BindingConstants.LITERAL)
@Property
@SuppressWarnings("unused")
private String zone;

   boolean onSuccessFromSignInForm() { 

 componentResources.triggerEvent("proba", null, callback);

 return false;
 
  }
 
  
private ComponentEventCallback callback = new ComponentEventCallback() {

public boolean handleResult(Object result) {
if(!(result instanceof Block)){

return true;
}
return false;
}
};

Best regards


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Rendering-Custom-Component-via-Zone-tp4918130p4918130.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Custom component

2011-10-06 Thread Giulio Micali
yes, the second is better If your component is a "container" for a group of
fields.
In that case, you should do it in the afterRender phase, so your method is
called after all single fields has already the new submitted values and you
can "validate" (and rollback if you want) the whole result.


2011/10/3 Rendy Tapestry 

> Thanks Taha,
>
> I'll give your second suggestion a try.
>
> Thanks,
> Rendy.
>
> On Sun, Oct 2, 2011 at 11:03 PM, Taha Hafeez Siddiqi <
> tawus.tapes...@gmail.com> wrote:
>
> > Hi Rendy
> >
> > Your component, if fits the definition of a form field, can extend
> > AbstractField and then override processSubmission() method.
> >
> > Otherwise you can @Inject FormSupport and then use
> > FormSupport#storeAndExecute() to execute a ComponentAction
> >
> > regards
> > Taha
> >
> > On Oct 2, 2011, at 9:18 PM, Rendy Tapestry wrote:
> >
> > > Hi All,
> > >
> > > Is it possible to have a custom component with a method that will
> getting
> > > called when the enclosing form is being submitted ? In that method, I
> > want
> > > to change some parameter of that custom component.
> > >
> > > Thanks,
> > > Rendy.
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>


Re: Custom component

2011-10-02 Thread Rendy Tapestry
Thanks Taha,

I'll give your second suggestion a try.

Thanks,
Rendy.

On Sun, Oct 2, 2011 at 11:03 PM, Taha Hafeez Siddiqi <
tawus.tapes...@gmail.com> wrote:

> Hi Rendy
>
> Your component, if fits the definition of a form field, can extend
> AbstractField and then override processSubmission() method.
>
> Otherwise you can @Inject FormSupport and then use
> FormSupport#storeAndExecute() to execute a ComponentAction
>
> regards
> Taha
>
> On Oct 2, 2011, at 9:18 PM, Rendy Tapestry wrote:
>
> > Hi All,
> >
> > Is it possible to have a custom component with a method that will getting
> > called when the enclosing form is being submitted ? In that method, I
> want
> > to change some parameter of that custom component.
> >
> > Thanks,
> > Rendy.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Custom component

2011-10-02 Thread Taha Hafeez Siddiqi
Hi Rendy

Your component, if fits the definition of a form field, can extend 
AbstractField and then override processSubmission() method.

Otherwise you can @Inject FormSupport and then use 
FormSupport#storeAndExecute() to execute a ComponentAction

regards
Taha
 
On Oct 2, 2011, at 9:18 PM, Rendy Tapestry wrote:

> Hi All,
> 
> Is it possible to have a custom component with a method that will getting
> called when the enclosing form is being submitted ? In that method, I want
> to change some parameter of that custom component.
> 
> Thanks,
> Rendy.


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



Custom component

2011-10-02 Thread Rendy Tapestry
Hi All,

Is it possible to have a custom component with a method that will getting
called when the enclosing form is being submitted ? In that method, I want
to change some parameter of that custom component.

Thanks,
Rendy.


Re: ProgressiveDisplay in a custom component?

2011-06-24 Thread Massimo Lusetti
On Thu, Jun 23, 2011 at 2:20 PM, Thiago H. de Paula Figueiredo
 wrote:

> ProgressiveDisplays should handle the events and trigger them again. I guess
> you can find some examples in the mailing list or in JumpStart.

Nice memory Thiago... ;-)

Cheers
-- 
Massimo
http://meridio.blogspot.com

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



Re: ProgressiveDisplay in a custom component?

2011-06-23 Thread antalk
Thanks !

Hadn't thought of that, works beautiful !

antal

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/ProgressiveDisplay-in-a-custom-component-tp4517111p4517313.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: ProgressiveDisplay in a custom component?

2011-06-23 Thread Thiago H. de Paula Figueiredo

On Thu, 23 Jun 2011 08:17:17 -0300, antalk  wrote:


Hi all,


Hi!


I have a component which in itself contains a 'ProgressiveDisplay'
component, however it does not catch the 'PROGRESSIVE_DISPLAY' event in
there but i want to handle this in the page that contains my custom
component.
Is this possible ? If so how and what should the annotation @OnEvent look
like ?


Events bubble up (from inner to outer component) and pages are components.  
All component event handler methods are the same in Tapestry, so  
@OnEvent(EventConstants.PROGRESSIVE_DISPLAY) void xxx() { . . . } should  
be enough as long as you have just one ProgressiveDisplay instance in your  
page. If you have more than one, your component that declares the  
ProgressiveDisplays should handle the events and trigger them again. I  
guess you can find some examples in the mailing list or in JumpStart.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



ProgressiveDisplay in a custom component?

2011-06-23 Thread antalk
Hi all,

I have a component which in itself contains a 'ProgressiveDisplay'
component, however it does not catch the 'PROGRESSIVE_DISPLAY' event in
there but i want to handle this in the page that contains my custom
component.

Is this possible ? If so how and what should the annotation @OnEvent look
like ?

Thx,
 Antal

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/ProgressiveDisplay-in-a-custom-component-tp4517111p4517111.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Grids embedded in custom component interfer with each other

2010-12-15 Thread sprabhu


-- 
View this message in context: 
http://tapestry-users.832.n2.nabble.com/Grids-embedded-in-custom-component-interfer-with-each-other-tp5376183p5838045.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



Re: How to create a custom component

2010-12-15 Thread hese

That one letter made a big difference...it worked! 
Thanks.
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-create-a-custom-component-tp3306682p3307001.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: How to create a custom component

2010-12-15 Thread Robert Zeigler
Apologies... that tapestry_5_2_0.xsd should be tapestry_5_1_0.xsd.

Robert

On Dec 15, 2010, at 12/153:01 PM , hese wrote:

> 
> I tried creating a custom component as you have mentioned...The problem is
> the select box is not appearing on the page.  Only the label 'Test:' I
> created for it appears.  Where am I going wrong?
> 
> 
> This my tml
> 
> 
> http://tapestry.apache.org/schema/tapestry_5_2_0.xsd";> 
>   Test: 
>onchange="javascript:this.form.submit();"/>
>  
> 
> 
> JAVA
> 
> public class TeamSelect {
> 
>   @Parameter(required=true) 
>   @Property 
>   private Object value; 
> 
>   @Inject
>   private ServiceFacade serviceFacade;
>   
>   @SessionState
>private UserSession userSession;
>   
>   @Property
>   private long testValue;
>   
>   public SelectModel getTestModel() { 
>   //do your lookup and return the model... 
>   System.out.println("serviceFacade: " + serviceFacade);
>   System.out.println("userSession: " + userSession);
>   
>   return new IdSelectModel(new ArrayList(), "Default", 
> true); 
>   } 
> }
> 
> Im using it in a page like this - 
> 
> 
> 
> @Property
> private Long selectedTeam;
> 
> -- 
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/How-to-create-a-custom-component-tp3306682p3306950.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org


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



Re: How to create a custom component

2010-12-15 Thread hese

I tried creating a custom component as you have mentioned...The problem is
the select box is not appearing on the page.  Only the label 'Test:' I
created for it appears.  Where am I going wrong?


This my tml


http://tapestry.apache.org/schema/tapestry_5_2_0.xsd";> 
Test: 

 


JAVA

public class TeamSelect {

@Parameter(required=true) 
@Property 
private Object value; 

@Inject
private ServiceFacade serviceFacade;

@SessionState
private UserSession userSession;

@Property
private long testValue;

public SelectModel getTestModel() { 
//do your lookup and return the model... 
System.out.println("serviceFacade: " + serviceFacade);
System.out.println("userSession: " + userSession);

return new IdSelectModel(new ArrayList(), "Default", 
true); 
} 
}

Im using it in a page like this - 



@Property
private Long selectedTeam;

-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-create-a-custom-component-tp3306682p3306950.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: How to create a custom component

2010-12-15 Thread hese

Thanks for the quick response Robert!  

Looks pretty simple (probably because you've explained it well).  Wil try
one of those!
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-create-a-custom-component-tp3306682p3306714.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: How to create a custom component

2010-12-15 Thread Robert Zeigler
Hi,

If you know how to build pages, then you (largely) know how to build 
components.  A page is just a specialized component.
Here are the main differences:
  * Components go in the .components package (instead of .pages)
  * Component templates are optional because a component may choose to do all 
of its rendering via code. However, if your component will make use of other 
components, then your component will need a template.
** Note that component templates must be in the same package as the 
component class file.
  * Components can have parameters (via the @Parameter) annotation.

So in your case, it might look something like:

CountrySelect.tml:
  http://tapestry.apache.org/schema/tapestry_5_2_0.xsd";>

  

CountrySelect.java
import ...;
public class CountrySelect {
  @Parameter(required=true)
  @Property
  private Object value;

  public SelectModel getCountryModel() {
//do your lookup and return the model...
  }
}

That's the core...

As an alternative, you could simply write a "CountrySelectModel" and just use 
 with your custom model anywhere you need it.

Robert

On Dec 15, 2010, at 12/1511:47 AM , hese wrote:

> 
> Hi,
> 
> Can any one tell me where I can find a T5 example of how to build a custom
> component and what the different files I should create are?
> 
> My need is - I have a select box that populates from a database (Something
> like a country list...).  And I want to be able to include this select box
> in any tml that I want and have the box populated with the lookup values.
> 
> Thanks!
> 
> 
> 
> -- 
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/How-to-create-a-custom-component-tp3306682p3306682.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org


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



How to create a custom component

2010-12-15 Thread hese

Hi,

Can any one tell me where I can find a T5 example of how to build a custom
component and what the different files I should create are?

My need is - I have a select box that populates from a database (Something
like a country list...).  And I want to be able to include this select box
in any tml that I want and have the box populated with the lookup values.

Thanks!



-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-create-a-custom-component-tp3306682p3306682.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Tapestry custom component + hibernate

2010-11-08 Thread Elin

Problem solved. There was some kind of conflict with a previous version of my
entity... its working now ;)
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-custom-component-hibernate-tp3254963p3255809.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Tapestry custom component + hibernate

2010-11-08 Thread Elin

Having problems again. My packaged component is working fine except the
hibernate part.

I have my main app and a custom componet packaged into a jar. This component
has:

com.udc.mylib.entities
com.udc.mylib.pages
com.udc.mylib.services
...


When i load the packaged component, its displayed correctly into my main
application but when it comes into action and hibernate part should work, it
fails giving me an exception:

Unknown entity: com.udc.mylib.entities.Hello

(Obviously my entity is called "Hello" and its into com.udc.mylib.entities
package)



When i try to add the package with 

public static void
contributeHibernateEntityPackageManager(Configuration configuration)
{
configuration.add("com.udc.mylib.entities");
}

i get an error saying:

Use of the same entity name twice: Hello

so i suppose it was correctly loaded but somehow, it cant be found.

Any advice?

Thx in advance

-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-custom-component-hibernate-tp3254963p3255669.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Tapestry custom component + hibernate

2010-11-08 Thread Elin

Thx a lot. I will keep investigating now until it works correctly now that i
know its possible.
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-custom-component-hibernate-tp3254963p3254992.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Tapestry custom component + hibernate

2010-11-08 Thread Thiago H. de Paula Figueiredo

On Mon, 08 Nov 2010 10:06:20 -0200, Elin  wrote:


Is it possible to create a component that uses some hibernate entities,
package it into a separated .jar and then import this component into my  
main project being able to autocreate this new entities?


Yes.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Tapestry custom component + hibernate

2010-11-08 Thread Elin

Is it possible to create a component that uses some hibernate entities,
package it into a separated .jar and then import this component into my main
project being able to autocreate this new entities? 

Something like creating my custom component package following this tutorial
http://tapestry.apache.org/tapestry5.1/cookbook/lib.html

Inside that component, create the "entities" package like at any other
tapestry+hibernate project with my custom entities.

Will tapestry load those entities after adding this packaged component into
my project? so if i have the autocreate entities activated on the
hibernate.cfg.xml, those new entities will be added.


What im trying to do is an extensible application, where anyone can create
their own custom components, with the needed entities if this components
need to store their own data into the database, and being able to do this
without having to modify my main application. I just download the component
made by "someone", add it to my main project and i dont have to add the
mapping myself to my app because its included into that component. Hope you
understand what im trying to do. Would it be possible?

I would test myself but im still having troubles with components
packaging... 
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-custom-component-hibernate-tp3254963p3254963.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Creating custom component

2010-11-08 Thread Christophe Cordenier
Hi !

2010/11/6 Josh Kamau 

> Thanks Sven,
>
> This is exactly what i am talking about. How am i supposed to know that
> something like  exists? what what else is out there? and what
> else am i using the wrong way? you get my point.? I think the Hotel-booking
> application should be made complicated enough to use as many tapestry
> features as possible.


alright, simply tell us ! We are eager of feedback, followers and
contributors !



> I have gone through it and it doesnt have what i am
> looking for.
>
> Thanks for your response. I will keep  trying.
>
> Regards.
>
> On Sat, Nov 6, 2010 at 10:37 AM, Sven Homburg  >wrote:
>
> > you can also use this template code:
> >
> >
> > http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
> > 
> > 
> >I am a menubar
> > 
> > 
> > 
> >
> > the  let tapestry know, that all code between 
> > and 
> > is relevant for your component and strips all away outside this tag.
> >
> > it is the better way, if you use design tools like dreamweaver or others
> >
> > with regards
> > Sven Homburg
> > Founder of the Chenille Kit Project
> > http://chenillekit.codehaus.org
> >
> >
> >
> >
> >
> > 2010/11/6 Josh Kamau :
> > > thanks Thiago,
> > >
> > > I have fixed the component as follows :
> > >
> > > http://tapestry.apache.org/schema/tapestry_5_1_0.xsd
> > ">
> > >I am a menubar
> > > 
> > >
> > > now how do i add it to my page? i have added it by putting 
> > or
> > >  and its not appearing.
> > >
> > > this is my index page.
> > >
> > > http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
> > >
> > >
> > >
> > >
> > >
> > >
> > >Hello world . Its now ${today}
> > >
> > >
> > > 
> > >
> > > On Sat, Nov 6, 2010 at 6:41 AM, Thiago H. de Paula Figueiredo <
> > > thiag...@gmail.com> wrote:
> > >
> > >> On Sat, 06 Nov 2010 08:36:40 -0200, Josh Kamau  >
> > >> wrote:
> > >>
> > >>  Hi guys;
> > >>>
> > >>
> > >> Hi!
> > >>
> > >> Don't use the  tag in components' templates (unless you're
> > creating a
> > >> Layout-style one).
> > >> And don't forget that the name of the template is case-sensitive, so
> > >> MenuBar.java -> MenuBar.tml.
> > >>
> > >> --
> > >> Thiago H. de Paula Figueiredo
> > >> Independent Java, Apache Tapestry 5 and Hibernate consultant,
> developer,
> > >> and instructor
> > >> Owner, Ars Machina Tecnologia da Informação Ltda.
> > >> http://www.arsmachina.com.br
> > >>
> > >> -
> > >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > >> For additional commands, e-mail: users-h...@tapestry.apache.org
> > >>
> > >>
> > >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>



-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com


Re: Creating custom component

2010-11-07 Thread Guerin Laurent
In addition to the Tapestry documentation and if you use Eclipse, you should 
have a look at :
http://wiki.apache.org/tapestry/Tapestry5JSPEditorEclipse

This will provide you code completion on components in your tml files, with 
documentation on component itself and also on the component parameters.



Le 6 nov. 2010 à 15:49, "Josh Kamau"  a écrit :

> Thanks Sven,
> 
> This is exactly what i am talking about. How am i supposed to know that
> something like  exists? what what else is out there? and what
> else am i using the wrong way? you get my point.? I think the Hotel-booking
> application should be made complicated enough to use as many tapestry
> features as possible. I have gone through it and it doesnt have what i am
> looking for.
> 
> Thanks for your response. I will keep  trying.
> 
> Regards.
> 
> On Sat, Nov 6, 2010 at 10:37 AM, Sven Homburg wrote:
> 
>> you can also use this template code:
>> 
>> 
>> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
>> 
>> 
>>   I am a menubar
>> 
>> 
>> 
>> 
>> the  let tapestry know, that all code between 
>> and 
>> is relevant for your component and strips all away outside this tag.
>> 
>> it is the better way, if you use design tools like dreamweaver or others
>> 
>> with regards
>> Sven Homburg
>> Founder of the Chenille Kit Project
>> http://chenillekit.codehaus.org
>> 
>> 
>> 
>> 
>> 
>> 2010/11/6 Josh Kamau :
>>> thanks Thiago,
>>> 
>>> I have fixed the component as follows :
>>> 
>>> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd
>> ">
>>>   I am a menubar
>>> 
>>> 
>>> now how do i add it to my page? i have added it by putting 
>> or
>>>  and its not appearing.
>>> 
>>> this is my index page.
>>> 
>>> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
>>> 
>>>   
>>> 
>>>   
>>> 
>>>   
>>>   Hello world . Its now ${today}
>>>   
>>>   
>>> 
>>> 
>>> On Sat, Nov 6, 2010 at 6:41 AM, Thiago H. de Paula Figueiredo <
>>> thiag...@gmail.com> wrote:
>>> 
 On Sat, 06 Nov 2010 08:36:40 -0200, Josh Kamau 
 wrote:
 
 Hi guys;
> 
 
 Hi!
 
 Don't use the  tag in components' templates (unless you're
>> creating a
 Layout-style one).
 And don't forget that the name of the template is case-sensitive, so
 MenuBar.java -> MenuBar.tml.
 
 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, Ars Machina Tecnologia da Informação Ltda.
 http://www.arsmachina.com.br
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
>>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
>> 


Re: Creating custom component

2010-11-06 Thread Thiago H. de Paula Figueiredo
On Sat, 06 Nov 2010 12:48:38 -0200, Josh Kamau   
wrote:



This is exactly what i am talking about. How am i supposed to know that
something like  exists?


The documentation needs improvement, no doubt, but this information is no  
hard to find: it's under 'component templates' in the current  
documentation.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Creating custom component

2010-11-06 Thread Josh Kamau
Thanks Sven,

This is exactly what i am talking about. How am i supposed to know that
something like  exists? what what else is out there? and what
else am i using the wrong way? you get my point.? I think the Hotel-booking
application should be made complicated enough to use as many tapestry
features as possible. I have gone through it and it doesnt have what i am
looking for.

Thanks for your response. I will keep  trying.

Regards.

On Sat, Nov 6, 2010 at 10:37 AM, Sven Homburg wrote:

> you can also use this template code:
>
>
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
> 
> 
>I am a menubar
> 
> 
> 
>
> the  let tapestry know, that all code between 
> and 
> is relevant for your component and strips all away outside this tag.
>
> it is the better way, if you use design tools like dreamweaver or others
>
> with regards
> Sven Homburg
> Founder of the Chenille Kit Project
> http://chenillekit.codehaus.org
>
>
>
>
>
> 2010/11/6 Josh Kamau :
> > thanks Thiago,
> >
> > I have fixed the component as follows :
> >
> > http://tapestry.apache.org/schema/tapestry_5_1_0.xsd
> ">
> >I am a menubar
> > 
> >
> > now how do i add it to my page? i have added it by putting 
> or
> >  and its not appearing.
> >
> > this is my index page.
> >
> > http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
> >
> >
> >
> >
> >
> >
> >Hello world . Its now ${today}
> >
> >
> > 
> >
> > On Sat, Nov 6, 2010 at 6:41 AM, Thiago H. de Paula Figueiredo <
> > thiag...@gmail.com> wrote:
> >
> >> On Sat, 06 Nov 2010 08:36:40 -0200, Josh Kamau 
> >> wrote:
> >>
> >>  Hi guys;
> >>>
> >>
> >> Hi!
> >>
> >> Don't use the  tag in components' templates (unless you're
> creating a
> >> Layout-style one).
> >> And don't forget that the name of the template is case-sensitive, so
> >> MenuBar.java -> MenuBar.tml.
> >>
> >> --
> >> Thiago H. de Paula Figueiredo
> >> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> >> and instructor
> >> Owner, Ars Machina Tecnologia da Informação Ltda.
> >> http://www.arsmachina.com.br
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Creating custom component

2010-11-06 Thread Sven Homburg
you can also use this template code:


http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>


   I am a menubar




the  let tapestry know, that all code between 
and 
is relevant for your component and strips all away outside this tag.

it is the better way, if you use design tools like dreamweaver or others

with regards
Sven Homburg
Founder of the Chenille Kit Project
http://chenillekit.codehaus.org





2010/11/6 Josh Kamau :
> thanks Thiago,
>
> I have fixed the component as follows :
>
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
>    I am a menubar
> 
>
> now how do i add it to my page? i have added it by putting  or
>  and its not appearing.
>
> this is my index page.
>
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
>
>    
>
>    
>
>    
>        Hello world . Its now ${today}
>        
>    
> 
>
> On Sat, Nov 6, 2010 at 6:41 AM, Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
>> On Sat, 06 Nov 2010 08:36:40 -0200, Josh Kamau 
>> wrote:
>>
>>  Hi guys;
>>>
>>
>> Hi!
>>
>> Don't use the  tag in components' templates (unless you're creating a
>> Layout-style one).
>> And don't forget that the name of the template is case-sensitive, so
>> MenuBar.java -> MenuBar.tml.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>> and instructor
>> Owner, Ars Machina Tecnologia da Informação Ltda.
>> http://www.arsmachina.com.br
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>

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



Re: Creating custom component

2010-11-06 Thread Thiago H. de Paula Figueiredo
On Sat, 06 Nov 2010 08:47:03 -0200, Josh Kamau   
wrote:


xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>

I am a menubar



You're trying to use the component in it itself. The root element should  
be .


now how do i add it to my page? i have added it by putting   
or  and its not appearing.



this is my index page.
http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>






Hello world . Its now ${today}





Please post your Layout class and template.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Creating custom component

2010-11-06 Thread Josh Kamau
thanks Thiago,

I have fixed the component as follows :

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
I am a menubar


now how do i add it to my page? i have added it by putting  or
 and its not appearing.

this is my index page.

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>






Hello world . Its now ${today}




On Sat, Nov 6, 2010 at 6:41 AM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Sat, 06 Nov 2010 08:36:40 -0200, Josh Kamau 
> wrote:
>
>  Hi guys;
>>
>
> Hi!
>
> Don't use the  tag in components' templates (unless you're creating a
> Layout-style one).
> And don't forget that the name of the template is case-sensitive, so
> MenuBar.java -> MenuBar.tml.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Creating custom component

2010-11-06 Thread Thiago H. de Paula Figueiredo
On Sat, 06 Nov 2010 08:36:40 -0200, Josh Kamau   
wrote:



Hi guys;


Hi!

Don't use the  tag in components' templates (unless you're creating  
a Layout-style one).
And don't forget that the name of the template is case-sensitive, so  
MenuBar.java -> MenuBar.tml.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Creating custom component

2010-11-06 Thread Josh Kamau
Hi guys;

I  am trying to compose a page but assembling various sections e.g the menu
bar, the header and the footer as separate components.

I have my Index page which "inherits" from the main layout. Now i have made
the menu bar as follows

menubar.tml

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>

I am a menubar



Menubar.java

package com.josh.tcontacts.components;

public class MenuBar {

}


index page tml

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>






Hello world . Its now ${today}




index page java
package com.josh.tcontacts.pages;

import java.util.Date;

import org.apache.tapestry5.annotations.Property;

public class Index {

private Date today ;

public Date getToday() {
return new Date();
}

public void setToday(Date today) {
this.today = today;
}

}

How do i add the menubar to the index page? i have done the above but its
not working.

regards


Re: Grids embedded in custom component interfer with each other

2010-08-06 Thread olip

thanks for confirming.

This seems like a serious bug and you do not need to put the grids in
components to see this not working.

If you have several grids without components on the same page the
pagerenderers do interfer each other as well!
-- 
View this message in context: 
http://tapestry-users.832.n2.nabble.com/Grids-embedded-in-custom-component-interfer-with-each-other-tp5376183p537.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



  1   2   3   >