You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Harish Krishnaswamy <hk...@comcast.net> on 2004/01/11 08:59:18 UTC

Component properties

Hi,

I was trying to associate some values with the components I declare in the page to be used later 
during validation. I saw that *property* can be specified even during the component declaration and 
tried to use it, but to no avail.

<!ELEMENT component (_property_*, (...)*)>

1. How would I retrieve the property specified in the declaration?
<component...>
	...
	<property name="xyz" value="xyzVal" />
	...
</component>

2. Wouldn't it be nice to set some arbitrary properties in the component that can be retrieved and 
used by an external entity? For example, I can set the entity property name in the TextField 
component and such that I have a mapping of the component with the actual entity property. Something 
like...
<component...>
	...
	<set-property name="..." expression="..." />
	...
</component>

Like what we now have for beans. This can be worked around when informal parameters are allowed but 
wouldn't be elegant IMO.

Thanks,
Harish


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Re: Component properties

Posted by Harish Krishnaswamy <hk...@comcast.net>.
:) been there several times!

Geoff Longman wrote:

> Ignore my last. I'm still not awake. When I do wake up I'll bend a few brain
> cells your way.
> 
> Geoff
> ----- Original Message -----
> From: "Geoff Longman" <gl...@intelligentworks.com>
> To: "Tapestry development" <ta...@jakarta.apache.org>
> Sent: Sunday, January 11, 2004 6:59 AM
> Subject: Re: Component properties
> 
> 
> 
>>maybe
>>
>>"components.TheComponent.properties.MyProperty"
>>
>>?
>>
>>Geoff
>>----- Original Message -----
>>From: "Harish Krishnaswamy" <hk...@comcast.net>
>>To: "Tapestry development" <ta...@jakarta.apache.org>
>>Sent: Sunday, January 11, 2004 2:59 AM
>>Subject: Component properties
>>
>>
>>
>>>Hi,
>>>
>>>I was trying to associate some values with the components I declare in
> 
> the
> 
>>page to be used later
>>
>>>during validation. I saw that *property* can be specified even during
> 
> the
> 
>>component declaration and
>>
>>>tried to use it, but to no avail.
>>>
>>><!ELEMENT component (_property_*, (...)*)>
>>>
>>>1. How would I retrieve the property specified in the declaration?
>>><component...>
>>>...
>>><property name="xyz" value="xyzVal" />
>>>...
>>></component>
>>>
>>>2. Wouldn't it be nice to set some arbitrary properties in the component
>>
>>that can be retrieved and
>>
>>>used by an external entity? For example, I can set the entity property
>>
>>name in the TextField
>>
>>>component and such that I have a mapping of the component with the
> 
> actual
> 
>>entity property. Something
>>
>>>like...
>>><component...>
>>>...
>>><set-property name="..." expression="..." />
>>>...
>>></component>
>>>
>>>Like what we now have for beans. This can be worked around when informal
>>
>>parameters are allowed but
>>
>>>wouldn't be elegant IMO.
>>>
>>>Thanks,
>>>Harish
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Re: Component properties

Posted by Geoff Longman <gl...@intelligentworks.com>.
Ignore my last. I'm still not awake. When I do wake up I'll bend a few brain
cells your way.

Geoff
----- Original Message -----
From: "Geoff Longman" <gl...@intelligentworks.com>
To: "Tapestry development" <ta...@jakarta.apache.org>
Sent: Sunday, January 11, 2004 6:59 AM
Subject: Re: Component properties


> maybe
>
> "components.TheComponent.properties.MyProperty"
>
> ?
>
> Geoff
> ----- Original Message -----
> From: "Harish Krishnaswamy" <hk...@comcast.net>
> To: "Tapestry development" <ta...@jakarta.apache.org>
> Sent: Sunday, January 11, 2004 2:59 AM
> Subject: Component properties
>
>
> > Hi,
> >
> > I was trying to associate some values with the components I declare in
the
> page to be used later
> > during validation. I saw that *property* can be specified even during
the
> component declaration and
> > tried to use it, but to no avail.
> >
> > <!ELEMENT component (_property_*, (...)*)>
> >
> > 1. How would I retrieve the property specified in the declaration?
> > <component...>
> > ...
> > <property name="xyz" value="xyzVal" />
> > ...
> > </component>
> >
> > 2. Wouldn't it be nice to set some arbitrary properties in the component
> that can be retrieved and
> > used by an external entity? For example, I can set the entity property
> name in the TextField
> > component and such that I have a mapping of the component with the
actual
> entity property. Something
> > like...
> > <component...>
> > ...
> > <set-property name="..." expression="..." />
> > ...
> > </component>
> >
> > Like what we now have for beans. This can be worked around when informal
> parameters are allowed but
> > wouldn't be elegant IMO.
> >
> > Thanks,
> > Harish
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Re: Component properties

Posted by Geoff Longman <gl...@intelligentworks.com>.
maybe

"components.TheComponent.properties.MyProperty"

?

Geoff
----- Original Message -----
From: "Harish Krishnaswamy" <hk...@comcast.net>
To: "Tapestry development" <ta...@jakarta.apache.org>
Sent: Sunday, January 11, 2004 2:59 AM
Subject: Component properties


> Hi,
>
> I was trying to associate some values with the components I declare in the
page to be used later
> during validation. I saw that *property* can be specified even during the
component declaration and
> tried to use it, but to no avail.
>
> <!ELEMENT component (_property_*, (...)*)>
>
> 1. How would I retrieve the property specified in the declaration?
> <component...>
> ...
> <property name="xyz" value="xyzVal" />
> ...
> </component>
>
> 2. Wouldn't it be nice to set some arbitrary properties in the component
that can be retrieved and
> used by an external entity? For example, I can set the entity property
name in the TextField
> component and such that I have a mapping of the component with the actual
entity property. Something
> like...
> <component...>
> ...
> <set-property name="..." expression="..." />
> ...
> </component>
>
> Like what we now have for beans. This can be worked around when informal
parameters are allowed but
> wouldn't be elegant IMO.
>
> Thanks,
> Harish
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Re: Component properties

Posted by Harish Krishnaswamy <hk...@comcast.net>.
ofcourse, duh... Thanks!

-Harish

Howard M. Lewis Ship wrote:

> specification.getComponent("myComponent").getProperty("...")
> 
> The getComponent() returns an IContainedComponent instance; this is where bindings for a component
> instance are stored, as well as properties. In other words, how the component is used ... seperate
> from the components own specification, which is how it is implemeneted.  In Java object terms,
> IContainedComponent describes the instance, IComponentSpecifiction describes the class.
> 
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Tapestry: Java Web Components 
> http://jakarta.apache.org/tapestry/
> http://javatapestry.blogspot.com
> 
> 
>>-----Original Message-----
>>From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net] 
>>Sent: Sunday, January 11, 2004 2:59 AM
>>To: Tapestry development
>>Subject: Component properties
>>
>>
>>Hi,
>>
>>I was trying to associate some values with the components I 
>>declare in the page to be used later 
>>during validation. I saw that *property* can be specified 
>>even during the component declaration and 
>>tried to use it, but to no avail.
>>
>><!ELEMENT component (_property_*, (...)*)>
>>
>>1. How would I retrieve the property specified in the declaration?
>><component...>
>>	...
>>	<property name="xyz" value="xyzVal" />
>>	...
>></component>
>>
>>2. Wouldn't it be nice to set some arbitrary properties in 
>>the component that can be retrieved and 
>>used by an external entity? For example, I can set the entity 
>>property name in the TextField 
>>component and such that I have a mapping of the component 
>>with the actual entity property. Something 
>>like...
>><component...>
>>	...
>>	<set-property name="..." expression="..." />
>>	...
>></component>
>>
>>Like what we now have for beans. This can be worked around 
>>when informal parameters are allowed but 
>>wouldn't be elegant IMO.
>>
>>Thanks,
>>Harish
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Re: Component properties

Posted by Geoff Longman <gl...@intelligentworks.com>.
I found a use for this!

I have built a component called  TrackingForm that emits javascript to do
three things:

1. record the values of all the <inputs> text, textArea, select, radio,
checkbox
as they are when onLoadHappens()

2. provide functionanlity to go back over the list at any time and see if
any field has changed and also a checkDirty() function that will show a
confirm dialog if any field has changed. the return value of checkDirty()
returns true/false depending on what the user wants: ignore and continue
submit, or stop the submit.

3. hookup any Submits in the form with an onclick handler if they are
declared with a property like this:

<component id="submitCancel" type="Submit">
    <!--
        meta data that tells any wrapping TrackingForm that javascript
should be generated
        so that a dirty check will occur before the form submit actually
occurs
    -->
    <property name="orca.libraries.OrcaUtils-trackForms"
value="anyNonNullValue"/>
    <binding name="listener" expression="listeners.cancelPressed"/>
</component>

BTW Harish, you gave me a good start with the javascript - thanks!

works pretty nice. The real nice part is that by using the meta property I
didn't have to create a custom Submit component.

However, now I want to hook handlers to any link in the page that has a
similar Meta property. My first though would be to have a non-rendering
component that would mine the page for links, but that wouldn't take into
account looping etc.

Any suggestions?

Geoff


----- Original Message -----
From: "Harish Krishnaswamy" <hk...@comcast.net>
To: "Tapestry development" <ta...@jakarta.apache.org>
Sent: Sunday, January 11, 2004 2:13 PM
Subject: Re: Component properties


> Wow guess that's forward-looking! Slick!
>
> I guess I need a break, of course its a simple task to interpret the value
myself.
>
> Thanks,
> Harish
>
> Howard M. Lewis Ship wrote:
>
> > The original, forward-looking intent was to have a place that a RAD type
tool builder could stuff
> > orthogonal data (i.e., things like color and position) You see this with
Rational Rose, that writes
> > out all the UID javadoc comments so that it can do round trip
engineering. I wanted a clean way to
> > support that, as well as app-specific meta data (such as security tags
for pages).
> >
> > In any case, if you want to interpret the string value there as an OGNL
expression, that's a simple
> > enough layer to add; OGNL has the public static field referencing syntax
> > ("@package.MyClass@MY_FIELD").
> >
> > My intent was largely to support RAD tools that may not be written in
Java or, at least, not have
> > access to the specific Java code of the application.
> >
> > --
> > Howard M. Lewis Ship
> > Independent J2EE / Open-Source Java Consultant
> > Creator, Tapestry: Java Web Components
> > http://jakarta.apache.org/tapestry/
> > http://javatapestry.blogspot.com
> >
> >
> >>-----Original Message-----
> >>From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
> >>Sent: Sunday, January 11, 2004 11:41 AM
> >>To: Tapestry development
> >>Subject: Re: Component properties
> >>
> >>
> >>The meta <property> is really a very useful element. It would
> >>be even better if the property can be
> >>obtained from a java constant, wouldn't you say? I now have
> >>literal strings scattered all over and
> >>it is kind of a maintenance issue. Any suggestions otherwise?
> >>
> >>Thanks,
> >>Harish
> >>
> >>Howard M. Lewis Ship wrote:
> >>
> >>
> >>>specification.getComponent("myComponent").getProperty("...")
> >>>
> >>>The getComponent() returns an IContainedComponent instance;
> >>
> >>this is where bindings for a component
> >>
> >>>instance are stored, as well as properties. In other words,
> >>
> >>how the component is used ... seperate
> >>
> >>>from the components own specification, which is how it is
> >>
> >>implemeneted.  In Java object terms,
> >>
> >>>IContainedComponent describes the instance,
> >>
> >>IComponentSpecifiction describes the class.
> >>
> >>>--
> >>>Howard M. Lewis Ship
> >>>Independent J2EE / Open-Source Java Consultant
> >>>Creator, Tapestry: Java Web Components
> >>>http://jakarta.apache.org/tapestry/
> >>>http://javatapestry.blogspot.com
> >>>
> >>>
> >>>
> >>>>-----Original Message-----
> >>>>From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
> >>>>Sent: Sunday, January 11, 2004 2:59 AM
> >>>>To: Tapestry development
> >>>>Subject: Component properties
> >>>>
> >>>>
> >>>>Hi,
> >>>>
> >>>>I was trying to associate some values with the components I
> >>>>declare in the page to be used later
> >>>>during validation. I saw that *property* can be specified
> >>>>even during the component declaration and
> >>>>tried to use it, but to no avail.
> >>>>
> >>>><!ELEMENT component (_property_*, (...)*)>
> >>>>
> >>>>1. How would I retrieve the property specified in the declaration?
> >>>><component...>
> >>>> ...
> >>>> <property name="xyz" value="xyzVal" />
> >>>> ...
> >>>></component>
> >>>>
> >>>>2. Wouldn't it be nice to set some arbitrary properties in
> >>>>the component that can be retrieved and
> >>>>used by an external entity? For example, I can set the entity
> >>>>property name in the TextField
> >>>>component and such that I have a mapping of the component
> >>>>with the actual entity property. Something
> >>>>like...
> >>>><component...>
> >>>> ...
> >>>> <set-property name="..." expression="..." />
> >>>> ...
> >>>></component>
> >>>>
> >>>>Like what we now have for beans. This can be worked around
> >>>>when informal parameters are allowed but
> >>>>wouldn't be elegant IMO.
> >>>>
> >>>>Thanks,
> >>>>Harish
> >>>>
> >>>>
> >>>>------------------------------------------------------------
> >>
> >>---------
> >>
> >>>>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail:
> >>
> >>tapestry-dev-help@jakarta.apache.org
> >>
> >>>
> >>>
> >>>
> >>---------------------------------------------------------------------
> >>
> >>>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail:
> >>
> >>tapestry-dev-help@jakarta.apache.org
> >>
> >>>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Re: Component properties

Posted by Harish Krishnaswamy <hk...@comcast.net>.
Wow guess that's forward-looking! Slick!

I guess I need a break, of course its a simple task to interpret the value myself.

Thanks,
Harish

Howard M. Lewis Ship wrote:

> The original, forward-looking intent was to have a place that a RAD type tool builder could stuff
> orthogonal data (i.e., things like color and position) You see this with Rational Rose, that writes
> out all the UID javadoc comments so that it can do round trip engineering. I wanted a clean way to
> support that, as well as app-specific meta data (such as security tags for pages).
> 
> In any case, if you want to interpret the string value there as an OGNL expression, that's a simple
> enough layer to add; OGNL has the public static field referencing syntax
> ("@package.MyClass@MY_FIELD").
> 
> My intent was largely to support RAD tools that may not be written in Java or, at least, not have
> access to the specific Java code of the application.
> 
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Tapestry: Java Web Components 
> http://jakarta.apache.org/tapestry/
> http://javatapestry.blogspot.com
> 
> 
>>-----Original Message-----
>>From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net] 
>>Sent: Sunday, January 11, 2004 11:41 AM
>>To: Tapestry development
>>Subject: Re: Component properties
>>
>>
>>The meta <property> is really a very useful element. It would 
>>be even better if the property can be 
>>obtained from a java constant, wouldn't you say? I now have 
>>literal strings scattered all over and 
>>it is kind of a maintenance issue. Any suggestions otherwise?
>>
>>Thanks,
>>Harish
>>
>>Howard M. Lewis Ship wrote:
>>
>>
>>>specification.getComponent("myComponent").getProperty("...")
>>>
>>>The getComponent() returns an IContainedComponent instance; 
>>
>>this is where bindings for a component
>>
>>>instance are stored, as well as properties. In other words, 
>>
>>how the component is used ... seperate
>>
>>>from the components own specification, which is how it is 
>>
>>implemeneted.  In Java object terms,
>>
>>>IContainedComponent describes the instance, 
>>
>>IComponentSpecifiction describes the class.
>>
>>>--
>>>Howard M. Lewis Ship
>>>Independent J2EE / Open-Source Java Consultant
>>>Creator, Tapestry: Java Web Components 
>>>http://jakarta.apache.org/tapestry/
>>>http://javatapestry.blogspot.com
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net] 
>>>>Sent: Sunday, January 11, 2004 2:59 AM
>>>>To: Tapestry development
>>>>Subject: Component properties
>>>>
>>>>
>>>>Hi,
>>>>
>>>>I was trying to associate some values with the components I 
>>>>declare in the page to be used later 
>>>>during validation. I saw that *property* can be specified 
>>>>even during the component declaration and 
>>>>tried to use it, but to no avail.
>>>>
>>>><!ELEMENT component (_property_*, (...)*)>
>>>>
>>>>1. How would I retrieve the property specified in the declaration?
>>>><component...>
>>>>	...
>>>>	<property name="xyz" value="xyzVal" />
>>>>	...
>>>></component>
>>>>
>>>>2. Wouldn't it be nice to set some arbitrary properties in 
>>>>the component that can be retrieved and 
>>>>used by an external entity? For example, I can set the entity 
>>>>property name in the TextField 
>>>>component and such that I have a mapping of the component 
>>>>with the actual entity property. Something 
>>>>like...
>>>><component...>
>>>>	...
>>>>	<set-property name="..." expression="..." />
>>>>	...
>>>></component>
>>>>
>>>>Like what we now have for beans. This can be worked around 
>>>>when informal parameters are allowed but 
>>>>wouldn't be elegant IMO.
>>>>
>>>>Thanks,
>>>>Harish
>>>>
>>>>
>>>>------------------------------------------------------------
>>
>>---------
>>
>>>>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: 
>>
>>tapestry-dev-help@jakarta.apache.org
>>
>>>
>>>
>>>
>>---------------------------------------------------------------------
>>
>>>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: 
>>
>>tapestry-dev-help@jakarta.apache.org
>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


RE: Component properties

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
The original, forward-looking intent was to have a place that a RAD type tool builder could stuff
orthogonal data (i.e., things like color and position) You see this with Rational Rose, that writes
out all the UID javadoc comments so that it can do round trip engineering. I wanted a clean way to
support that, as well as app-specific meta data (such as security tags for pages).

In any case, if you want to interpret the string value there as an OGNL expression, that's a simple
enough layer to add; OGNL has the public static field referencing syntax
("@package.MyClass@MY_FIELD").

My intent was largely to support RAD tools that may not be written in Java or, at least, not have
access to the specific Java code of the application.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
http://jakarta.apache.org/tapestry/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net] 
> Sent: Sunday, January 11, 2004 11:41 AM
> To: Tapestry development
> Subject: Re: Component properties
> 
> 
> The meta <property> is really a very useful element. It would 
> be even better if the property can be 
> obtained from a java constant, wouldn't you say? I now have 
> literal strings scattered all over and 
> it is kind of a maintenance issue. Any suggestions otherwise?
> 
> Thanks,
> Harish
> 
> Howard M. Lewis Ship wrote:
> 
> > specification.getComponent("myComponent").getProperty("...")
> > 
> > The getComponent() returns an IContainedComponent instance; 
> this is where bindings for a component
> > instance are stored, as well as properties. In other words, 
> how the component is used ... seperate
> > from the components own specification, which is how it is 
> implemeneted.  In Java object terms,
> > IContainedComponent describes the instance, 
> IComponentSpecifiction describes the class.
> > 
> > --
> > Howard M. Lewis Ship
> > Independent J2EE / Open-Source Java Consultant
> > Creator, Tapestry: Java Web Components 
> > http://jakarta.apache.org/tapestry/
> > http://javatapestry.blogspot.com
> > 
> > 
> >>-----Original Message-----
> >>From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net] 
> >>Sent: Sunday, January 11, 2004 2:59 AM
> >>To: Tapestry development
> >>Subject: Component properties
> >>
> >>
> >>Hi,
> >>
> >>I was trying to associate some values with the components I 
> >>declare in the page to be used later 
> >>during validation. I saw that *property* can be specified 
> >>even during the component declaration and 
> >>tried to use it, but to no avail.
> >>
> >><!ELEMENT component (_property_*, (...)*)>
> >>
> >>1. How would I retrieve the property specified in the declaration?
> >><component...>
> >>	...
> >>	<property name="xyz" value="xyzVal" />
> >>	...
> >></component>
> >>
> >>2. Wouldn't it be nice to set some arbitrary properties in 
> >>the component that can be retrieved and 
> >>used by an external entity? For example, I can set the entity 
> >>property name in the TextField 
> >>component and such that I have a mapping of the component 
> >>with the actual entity property. Something 
> >>like...
> >><component...>
> >>	...
> >>	<set-property name="..." expression="..." />
> >>	...
> >></component>
> >>
> >>Like what we now have for beans. This can be worked around 
> >>when informal parameters are allowed but 
> >>wouldn't be elegant IMO.
> >>
> >>Thanks,
> >>Harish
> >>
> >>
> >>------------------------------------------------------------
> ---------
> >>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: 
> tapestry-dev-help@jakarta.apache.org
> >>
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: 
> tapestry-dev-help@jakarta.apache.org
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Re: Component properties

Posted by Harish Krishnaswamy <hk...@comcast.net>.
The meta <property> is really a very useful element. It would be even better if the property can be 
obtained from a java constant, wouldn't you say? I now have literal strings scattered all over and 
it is kind of a maintenance issue. Any suggestions otherwise?

Thanks,
Harish

Howard M. Lewis Ship wrote:

> specification.getComponent("myComponent").getProperty("...")
> 
> The getComponent() returns an IContainedComponent instance; this is where bindings for a component
> instance are stored, as well as properties. In other words, how the component is used ... seperate
> from the components own specification, which is how it is implemeneted.  In Java object terms,
> IContainedComponent describes the instance, IComponentSpecifiction describes the class.
> 
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Tapestry: Java Web Components 
> http://jakarta.apache.org/tapestry/
> http://javatapestry.blogspot.com
> 
> 
>>-----Original Message-----
>>From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net] 
>>Sent: Sunday, January 11, 2004 2:59 AM
>>To: Tapestry development
>>Subject: Component properties
>>
>>
>>Hi,
>>
>>I was trying to associate some values with the components I 
>>declare in the page to be used later 
>>during validation. I saw that *property* can be specified 
>>even during the component declaration and 
>>tried to use it, but to no avail.
>>
>><!ELEMENT component (_property_*, (...)*)>
>>
>>1. How would I retrieve the property specified in the declaration?
>><component...>
>>	...
>>	<property name="xyz" value="xyzVal" />
>>	...
>></component>
>>
>>2. Wouldn't it be nice to set some arbitrary properties in 
>>the component that can be retrieved and 
>>used by an external entity? For example, I can set the entity 
>>property name in the TextField 
>>component and such that I have a mapping of the component 
>>with the actual entity property. Something 
>>like...
>><component...>
>>	...
>>	<set-property name="..." expression="..." />
>>	...
>></component>
>>
>>Like what we now have for beans. This can be worked around 
>>when informal parameters are allowed but 
>>wouldn't be elegant IMO.
>>
>>Thanks,
>>Harish
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


RE: Component properties

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
specification.getComponent("myComponent").getProperty("...")

The getComponent() returns an IContainedComponent instance; this is where bindings for a component
instance are stored, as well as properties. In other words, how the component is used ... seperate
from the components own specification, which is how it is implemeneted.  In Java object terms,
IContainedComponent describes the instance, IComponentSpecifiction describes the class.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
http://jakarta.apache.org/tapestry/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net] 
> Sent: Sunday, January 11, 2004 2:59 AM
> To: Tapestry development
> Subject: Component properties
> 
> 
> Hi,
> 
> I was trying to associate some values with the components I 
> declare in the page to be used later 
> during validation. I saw that *property* can be specified 
> even during the component declaration and 
> tried to use it, but to no avail.
> 
> <!ELEMENT component (_property_*, (...)*)>
> 
> 1. How would I retrieve the property specified in the declaration?
> <component...>
> 	...
> 	<property name="xyz" value="xyzVal" />
> 	...
> </component>
> 
> 2. Wouldn't it be nice to set some arbitrary properties in 
> the component that can be retrieved and 
> used by an external entity? For example, I can set the entity 
> property name in the TextField 
> component and such that I have a mapping of the component 
> with the actual entity property. Something 
> like...
> <component...>
> 	...
> 	<set-property name="..." expression="..." />
> 	...
> </component>
> 
> Like what we now have for beans. This can be worked around 
> when informal parameters are allowed but 
> wouldn't be elegant IMO.
> 
> Thanks,
> Harish
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org