notify embedded components

2013-03-21 Thread Paul Stanton

Hi all,

Is there a way to trigger an event in a container (Page) which notifies 
embedded components?


I'm hoping to do something like this (pseudo code) :

Page
{
void onSomeEvent()
{
notifyListeners("SomethingHappened");
}
}

EmbeddedComponent
{
void setupRender()
{
page.listenTo("SomethingHappened");
}

void onSomethingHappened()
{
// called when triggered by page
}
}

Help appreciated, thanks, paul.

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



Re: For Nabble users

2013-03-21 Thread Bob Harner
Yeah, I 'm with you, Lance. And I didn't think the annoyances of the nabble
posts were significant.
On Mar 21, 2013 7:06 PM, "Lance Java"  wrote:

> That's actually really annoying for me.
>
> Most workplaces don't allow personal email but they do allow Nabble. Sure I
> can always use my phone but writing code and copy / paste etc is really
> annoying on a phone.
>
> On 21 March 2013 16:31, Thiago H de Paula Figueiredo  >wrote:
>
> > Hi!
> >
> > Due to many headaches we're having with posts from Nabble (including
> > swallowing of code), we decided to not allow them anymore. People, please
> > remember: this isn't a forum, it never was a forum, this is a mailing
> list,
> > and Apache Foundation projects must use mailing lists as the official way
> > of discussing stuff.
> >
> > If you want to post to the mailing lists, please subscribe to them as
> > described in http://tapestry.apache.org/**community.html<
> http://tapestry.apache.org/community.html>.
> > If you don't want to have mailing list messages mixed with other stuff in
> > your inbox, you can create folders and filters for it or even create a
> > separate e-mail account just for that. We will be ignoring requests for
> > permission to post in the Tapestry mailing list mirrors (emphasis on
> > 'mirror') though Nabble. And you don't need permission from anyone to
> > subscribe to the Tapestry mailing lists, so do it if you didn't yet. :)
> >
> > Cheers!
> >
> > --
> > 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: For Nabble users

2013-03-21 Thread Lance Java
That's actually really annoying for me.

Most workplaces don't allow personal email but they do allow Nabble. Sure I
can always use my phone but writing code and copy / paste etc is really
annoying on a phone.

On 21 March 2013 16:31, Thiago H de Paula Figueiredo wrote:

> Hi!
>
> Due to many headaches we're having with posts from Nabble (including
> swallowing of code), we decided to not allow them anymore. People, please
> remember: this isn't a forum, it never was a forum, this is a mailing list,
> and Apache Foundation projects must use mailing lists as the official way
> of discussing stuff.
>
> If you want to post to the mailing lists, please subscribe to them as
> described in 
> http://tapestry.apache.org/**community.html.
> If you don't want to have mailing list messages mixed with other stuff in
> your inbox, you can create folders and filters for it or even create a
> separate e-mail account just for that. We will be ignoring requests for
> permission to post in the Tapestry mailing list mirrors (emphasis on
> 'mirror') though Nabble. And you don't need permission from anyone to
> subscribe to the Tapestry mailing lists, so do it if you didn't yet. :)
>
> Cheers!
>
> --
> 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: InjectComponent Field in component and validate field in page class

2013-03-21 Thread Ivan Khalopik
You can add getter for injected field inside vendor component:

Vendor.class

@InjectComponent
private Field vendorNameField;

public Field getVendorNameField() {
   return vendorNameField;
}

Then inject vendor component inside the page

Page.class

@InjectComponent
private Vendor vendor;

void onValidateFromForm()  {
if(condition == true) {
form.recordError(vendor.getVendorNameField(), "some error message");
}
}

Don't forget to use t:id attributes on injected components.


On Thu, Mar 21, 2013 at 6:43 PM, Shing Hing Man  wrote:
> The following example might be useful.
>
>
>
> http://lombok.demon.co.uk/tapestry5Demo/test/crossvalidation2
>
>
>
> Shing
>
>
> - Original Message -
> From: George Christman 
> To: users@tapestry.apache.org
> Cc:
> Sent: Thursday, March 21, 2013 3:33 PM
> Subject: InjectComponent Field in component and validate field in page class
>
> I have a component that contains a field like so,
>
> Vendor.class
>
> @InjectComponent
> @Parameter
> private Field vendorName;
>
> I have a page class like so,
>
> Page.class
>
> @Property
> private Field vendorName;
>
> onValidateFromForm() {
>
> //I would like to do some serverside validation and return the error back
> to the field, but I'm not sure how to connect the field in the component
> with the page class.
>
> if(condition == true) {
> form.recordError(vendorName, "some error message");
> }
>
> }
>
> Page.tml
>
> 
>
> Anybody know if it's possible to connect the fields like this. Thanks
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>



-- 
BR
Ivan

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



For Nabble users

2013-03-21 Thread Thiago H de Paula Figueiredo

Hi!

Due to many headaches we're having with posts from Nabble (including  
swallowing of code), we decided to not allow them anymore. People, please  
remember: this isn't a forum, it never was a forum, this is a mailing  
list, and Apache Foundation projects must use mailing lists as the  
official way of discussing stuff.


If you want to post to the mailing lists, please subscribe to them as  
described in http://tapestry.apache.org/community.html. If you don't want  
to have mailing list messages mixed with other stuff in your inbox, you  
can create folders and filters for it or even create a separate e-mail  
account just for that. We will be ignoring requests for permission to post  
in the Tapestry mailing list mirrors (emphasis on 'mirror') though Nabble.  
And you don't need permission from anyone to subscribe to the Tapestry  
mailing lists, so do it if you didn't yet. :)


Cheers!

--
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: InjectComponent Field in component and validate field in page class

2013-03-21 Thread Shing Hing Man
The following example might be useful.



http://lombok.demon.co.uk/tapestry5Demo/test/crossvalidation2

 

Shing 


- Original Message -
From: George Christman 
To: users@tapestry.apache.org
Cc: 
Sent: Thursday, March 21, 2013 3:33 PM
Subject: InjectComponent Field in component and validate field in page class

I have a component that contains a field like so,

Vendor.class

@InjectComponent
@Parameter
private Field vendorName;

I have a page class like so,

Page.class

@Property
private Field vendorName;

onValidateFromForm() {

//I would like to do some serverside validation and return the error back
to the field, but I'm not sure how to connect the field in the component
with the page class.

    if(condition == true) {
        form.recordError(vendorName, "some error message");
    }

}

Page.tml



Anybody know if it's possible to connect the fields like this. Thanks


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



AUTO: Dieter Schrottshammer is out of office

2013-03-21 Thread Dieter Schrottshammer

Ich bin von Mi, 20.03.2013 bis Di, 26.03.2013 abwesend.




Hinweis: Dies ist eine automatische Antwort auf Ihre Nachricht
"InjectComponent Field in component and validate field in page class"
gesendet am 21.3.2013 16:33:46.

Diese ist die einzige Benachrichtigung, die Sie empfangen werden, während
diese Person abwesend ist.


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



InjectComponent Field in component and validate field in page class

2013-03-21 Thread George Christman
I have a component that contains a field like so,

Vendor.class

@InjectComponent
@Parameter
private Field vendorName;

I have a page class like so,

Page.class

@Property
private Field vendorName;

onValidateFromForm() {

//I would like to do some serverside validation and return the error back
to the field, but I'm not sure how to connect the field in the component
with the page class.

if(condition == true) {
form.recordError(vendorName, "some error message");
}

}

Page.tml



Anybody know if it's possible to connect the fields like this. Thanks


Re: No picture preview with absolute path

2013-03-21 Thread Volodymyr Khomik
Hi, 

thank you for the very fast answer!

My app have to access different pic from different folders and URLs... It have 
to work dynamically.

If I copy to browser file///... adress, it works.

Thank you!

Vlady



 Von: Thiago H de Paula Figueiredo 
An: Tapestry users  
Gesendet: 14:58 Donnerstag, 21.März 2013
Betreff: Re: No picture preview with absolute path
 
On Thu, 21 Mar 2013 10:31:30 -0300, Volodymyr Khomik  
wrote:

> Hello,

Hi!

> could somebody help me to resolve this problem:
> My pic previes is working just with relative pathes, but I have to use 
> absolute pathes.

Why?

> Here is my code:
> 
> 
>  index="exerciseIndex" formState="iteration">
> 
> 
> 
>  alt="image" /> ...
> 
> exercise.getPicture() returns H:/git/.../tapestry/data/reps/Picture.jpg
> 
> It returns no message like wrong path.
> 
> It's working with data/reps/Picture.jpg
> 
> I tried also with file:///H:/git/.../tapestry/data/reps/Picture.jpg but still 
> not working...

Actually, this isn't related to Tapestry at all. This is just about how to 
reference files in HTML. The easiest solution is to put the images inside the 
webapp root (src/main/webapp if you use the Maven conventions) and use 
/path/to/image.jpg (supposing your file is inside 
src/main/webapp/path/to/webapp).

--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: No picture preview with absolute path

2013-03-21 Thread Thiago H de Paula Figueiredo
On Thu, 21 Mar 2013 10:31:30 -0300, Volodymyr Khomik   
wrote:



Hello,


Hi!


could somebody help me to resolve this problem:
My pic previes is working just with relative pathes, but I have to use  
absolute pathes.


Why?


Here is my code:






 ...

exercise.getPicture() returns H:/git/.../tapestry/data/reps/Picture.jpg

It returns no message like wrong path.

It's working with data/reps/Picture.jpg

I tried also with file:///H:/git/.../tapestry/data/reps/Picture.jpg but  
still not working...


Actually, this isn't related to Tapestry at all. This is just about how to  
reference files in HTML. The easiest solution is to put the images inside  
the webapp root (src/main/webapp if you use the Maven conventions) and use  
/path/to/image.jpg (supposing your file is inside  
src/main/webapp/path/to/webapp).


--
Thiago H. de Paula Figueiredo

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