You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Sathish Senathi <sa...@optusnet.com.au> on 2003/04/30 04:05:27 UTC

Question on how to bind attribute for an HTML element

Hi,

I have the following template

<span jwcid="dbRows">

<tr >

<span jwcid="dbCols">

<td>

<span jwcid="dbItem">Item</span>

</td>

</span>

</tr>

</span>



I want the <tr>  to have the bgcolor attribute and value should be binded to
an expession

like the following:

<td  jwcid="myColor">

and myColor retunrs "bgcolor=#xxxxx". Is this right way to do it ?. I dont
see examples on this. I do see an example for <BODY> element where you can
change the color dynamically.

Any help wil be appreciated.

Thanks

sathish





Re: Question on cleaning up resources...

Posted by Jukka Rahkonen <ju...@itmoon.fi>.
Hi statish,

I strongly suggest no to combine two different pooling mechanisms
togeather. That would be dangerous design. jdbc connection pool and
component pool should stay separated.

detach() is an essential method for component pool handling. Make
sure that you call super.detach() allways and try not to prevent
Tapestry from calling detach().

The use of jdbc connection should be located on your business logic
layer or at least in visit or engine object. All necessary data should
be collected inside one method in visit or engine by using proper
try - catch - finally structure. Then pass the necessary values or
array of valueobjects to your component.

BR,
  Jukka Rahkonen   jukka.rahkonen@itmoon.fi



Sathish Senathi wrote:

>Hi  i have a page and a custom control , the custom control takes the
>parameter named "connection" which is of type java.sql.Connection.
>
>The custom control has a DirecLink component which uses the connection
>object.
>
>My problem is as follows
>
>I have overridden the Page:Detach function the page to close the connection
>and set it to null.  my problem is once the page is rendered the Detach is
>called , but when i click the DirectLink the component has a invalid
>connection object. How do make tapestry not to call Detach after page
>rendering.
>
>Also i noticed that after the directLink executed the Detach is called
>again.
>
>I am still using 2.3 rc1
>Thanks
>sathish
>
>----- Original Message -----
>From: "Jukka Rahkonen" <ju...@itmoon.fi>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Sent: Wednesday, April 30, 2003 4:14 PM
>Subject: Re: Question on how to bind attribute for an HTML element
>
>
>  
>
>>Hi,
>>
>>You should use following component binding on your
>>.page or .jwc:
>>
>><component id="myColor" type="Any">
>>  <static-binding name="element">td</static-binding>
>>  <binding name="bgcolor" expression="myColor"/>
>></component>
>>
>>There is an example in Tutorial and in Developers Guide.
>>See Component Reference for type "Any" also.
>>
>>BR,
>>   Jukka Rahkonen
>>   jukka.rahkonen@itmoon.fi
>>
>>
>>Sathish Senathi wrote:
>>
>>    
>>
>>>Hi,
>>>
>>>I have the following template
>>>
>>><span jwcid="dbRows">
>>>
>>><tr >
>>>
>>><span jwcid="dbCols">
>>>
>>><td>
>>>
>>><span jwcid="dbItem">Item</span>
>>>
>>></td>
>>>
>>></span>
>>>
>>></tr>
>>>
>>></span>
>>>
>>>
>>>
>>>I want the <tr>  to have the bgcolor attribute and value should be binded
>>>      
>>>
>to
>  
>
>>>an expession
>>>
>>>like the following:
>>>
>>><td  jwcid="myColor">
>>>
>>>and myColor retunrs "bgcolor=#xxxxx". Is this right way to do it ?. I
>>>      
>>>
>dont
>  
>
>>>see examples on this. I do see an example for <BODY> element where you
>>>      
>>>
>can
>  
>
>>>change the color dynamically.
>>>
>>>Any help wil be appreciated.
>>>
>>>Thanks
>>>
>>>sathish
>>>
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>      
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>



Re: Question on cleaning up resources...

Posted by Sathish Senathi <sa...@optusnet.com.au>.
Howard,

I figured it out . Now i use ActionLink, i understood that Directlink is
executed behore any binding takes place so my Connection parameter is null.
Once i replaced the Directlink with ActionLink the problem went away.

The scenario is simple :

A custom component who input parameter is a Connection object which is
embedded in my Page and Page has a method getConnection which is binded to
the Connection Parameter of the component.

After the page is rendered all the parameters are clears or set to NULL,
When i was using directLink the method gets connection as NULL, once i
replaced it with Action Link, the Binding takes place , now the component
has the connection object and everything went thro fine.

Good way to learn the difference between DirectLink and ActionLink :-)))
-sathish

----- Original Message -----
From: "Howard M. Lewis Ship" <hl...@attbi.com>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Wednesday, April 30, 2003 9:36 PM
Subject: RE: Question on cleaning up resources...


> I'm having trouble following your issue.  Please try to break it down.
When
> talking about DirectLink, you are talking about two different requests:
the
> first request where the link is rendered and the second request where the
> link is clicked.
>
> Start by breaking down what you need to occur in each request.  Does
request
> #1 need the DB connection?  Does request #2?  Is there some data fetched
> from the DB that must propogate between the two requests?
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
>
>
>
> > -----Original Message-----
> > From: Sathish Senathi [mailto:sathishs@optusnet.com.au]
> > Sent: Wednesday, April 30, 2003 2:56 AM
> > To: Tapestry users
> > Subject: Question on cleaning up resources...
> >
> >
> > Hi  i have a page and a custom control , the custom control
> > takes the parameter named "connection" which is of type
> > java.sql.Connection.
> >
> > The custom control has a DirecLink component which uses the
> > connection object.
> >
> > My problem is as follows
> >
> > I have overridden the Page:Detach function the page to close
> > the connection and set it to null.  my problem is once the
> > page is rendered the Detach is called , but when i click the
> > DirectLink the component has a invalid connection object. How
> > do make tapestry not to call Detach after page rendering.
> >
> > Also i noticed that after the directLink executed the Detach
> > is called again.
> >
> > I am still using 2.3 rc1
> > Thanks
> > sathish
> >
> > ----- Original Message -----
> > From: "Jukka Rahkonen" <ju...@itmoon.fi>
> > To: "Tapestry users" <ta...@jakarta.apache.org>
> > Sent: Wednesday, April 30, 2003 4:14 PM
> > Subject: Re: Question on how to bind attribute for an HTML element
> >
> >
> > > Hi,
> > >
> > > You should use following component binding on your
> > > .page or .jwc:
> > >
> > > <component id="myColor" type="Any">
> > >   <static-binding name="element">td</static-binding>
> > >   <binding name="bgcolor" expression="myColor"/>
> > > </component>
> > >
> > > There is an example in Tutorial and in Developers Guide.
> > > See Component Reference for type "Any" also.
> > >
> > > BR,
> > >    Jukka Rahkonen
> > >    jukka.rahkonen@itmoon.fi
> > >
> > >
> > > Sathish Senathi wrote:
> > >
> > > >Hi,
> > > >
> > > >I have the following template
> > > >
> > > ><span jwcid="dbRows">
> > > >
> > > ><tr >
> > > >
> > > ><span jwcid="dbCols">
> > > >
> > > ><td>
> > > >
> > > ><span jwcid="dbItem">Item</span>
> > > >
> > > ></td>
> > > >
> > > ></span>
> > > >
> > > ></tr>
> > > >
> > > ></span>
> > > >
> > > >
> > > >
> > > >I want the <tr>  to have the bgcolor attribute and value should be
> > > >binded
> > to
> > > >an expession
> > > >
> > > >like the following:
> > > >
> > > ><td  jwcid="myColor">
> > > >
> > > >and myColor retunrs "bgcolor=#xxxxx". Is this right way to
> > do it ?. I
> > dont
> > > >see examples on this. I do see an example for <BODY> element where
> > > >you
> > can
> > > >change the color dynamically.
> > > >
> > > >Any help wil be appreciated.
> > > >
> > > >Thanks
> > > >
> > > >sathish
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> > > >For additional commands, e-mail:
> > > >tapestry-user-help@jakarta.apache.org
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


RE: Question on cleaning up resources...

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
I'm having trouble following your issue.  Please try to break it down.  When
talking about DirectLink, you are talking about two different requests: the
first request where the link is rendered and the second request where the
link is clicked.

Start by breaking down what you need to occur in each request.  Does request
#1 need the DB connection?  Does request #2?  Is there some data fetched
from the DB that must propogate between the two requests?

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Sathish Senathi [mailto:sathishs@optusnet.com.au] 
> Sent: Wednesday, April 30, 2003 2:56 AM
> To: Tapestry users
> Subject: Question on cleaning up resources...
> 
> 
> Hi  i have a page and a custom control , the custom control 
> takes the parameter named "connection" which is of type 
> java.sql.Connection.
> 
> The custom control has a DirecLink component which uses the 
> connection object.
> 
> My problem is as follows
> 
> I have overridden the Page:Detach function the page to close 
> the connection and set it to null.  my problem is once the 
> page is rendered the Detach is called , but when i click the 
> DirectLink the component has a invalid connection object. How 
> do make tapestry not to call Detach after page rendering.
> 
> Also i noticed that after the directLink executed the Detach 
> is called again.
> 
> I am still using 2.3 rc1
> Thanks
> sathish
> 
> ----- Original Message -----
> From: "Jukka Rahkonen" <ju...@itmoon.fi>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Wednesday, April 30, 2003 4:14 PM
> Subject: Re: Question on how to bind attribute for an HTML element
> 
> 
> > Hi,
> >
> > You should use following component binding on your
> > .page or .jwc:
> >
> > <component id="myColor" type="Any">
> >   <static-binding name="element">td</static-binding>
> >   <binding name="bgcolor" expression="myColor"/>
> > </component>
> >
> > There is an example in Tutorial and in Developers Guide.
> > See Component Reference for type "Any" also.
> >
> > BR,
> >    Jukka Rahkonen
> >    jukka.rahkonen@itmoon.fi
> >
> >
> > Sathish Senathi wrote:
> >
> > >Hi,
> > >
> > >I have the following template
> > >
> > ><span jwcid="dbRows">
> > >
> > ><tr >
> > >
> > ><span jwcid="dbCols">
> > >
> > ><td>
> > >
> > ><span jwcid="dbItem">Item</span>
> > >
> > ></td>
> > >
> > ></span>
> > >
> > ></tr>
> > >
> > ></span>
> > >
> > >
> > >
> > >I want the <tr>  to have the bgcolor attribute and value should be 
> > >binded
> to
> > >an expession
> > >
> > >like the following:
> > >
> > ><td  jwcid="myColor">
> > >
> > >and myColor retunrs "bgcolor=#xxxxx". Is this right way to 
> do it ?. I
> dont
> > >see examples on this. I do see an example for <BODY> element where 
> > >you
> can
> > >change the color dynamically.
> > >
> > >Any help wil be appreciated.
> > >
> > >Thanks
> > >
> > >sathish
> > >
> > >
> > >
> > >
> > >
> > 
> >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: 
> tapestry-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: 
> > >tapestry-user-help@jakarta.apache.org
> > >
> > >
> > >
> >
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


Question on cleaning up resources...

Posted by Sathish Senathi <sa...@optusnet.com.au>.
Hi  i have a page and a custom control , the custom control takes the
parameter named "connection" which is of type java.sql.Connection.

The custom control has a DirecLink component which uses the connection
object.

My problem is as follows

I have overridden the Page:Detach function the page to close the connection
and set it to null.  my problem is once the page is rendered the Detach is
called , but when i click the DirectLink the component has a invalid
connection object. How do make tapestry not to call Detach after page
rendering.

Also i noticed that after the directLink executed the Detach is called
again.

I am still using 2.3 rc1
Thanks
sathish

----- Original Message -----
From: "Jukka Rahkonen" <ju...@itmoon.fi>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, April 30, 2003 4:14 PM
Subject: Re: Question on how to bind attribute for an HTML element


> Hi,
>
> You should use following component binding on your
> .page or .jwc:
>
> <component id="myColor" type="Any">
>   <static-binding name="element">td</static-binding>
>   <binding name="bgcolor" expression="myColor"/>
> </component>
>
> There is an example in Tutorial and in Developers Guide.
> See Component Reference for type "Any" also.
>
> BR,
>    Jukka Rahkonen
>    jukka.rahkonen@itmoon.fi
>
>
> Sathish Senathi wrote:
>
> >Hi,
> >
> >I have the following template
> >
> ><span jwcid="dbRows">
> >
> ><tr >
> >
> ><span jwcid="dbCols">
> >
> ><td>
> >
> ><span jwcid="dbItem">Item</span>
> >
> ></td>
> >
> ></span>
> >
> ></tr>
> >
> ></span>
> >
> >
> >
> >I want the <tr>  to have the bgcolor attribute and value should be binded
to
> >an expession
> >
> >like the following:
> >
> ><td  jwcid="myColor">
> >
> >and myColor retunrs "bgcolor=#xxxxx". Is this right way to do it ?. I
dont
> >see examples on this. I do see an example for <BODY> element where you
can
> >change the color dynamically.
> >
> >Any help wil be appreciated.
> >
> >Thanks
> >
> >sathish
> >
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


Re: Question on how to bind attribute for an HTML element

Posted by Sathish Senathi <sa...@optusnet.com.au>.
Thanks that works..
-sathish

----- Original Message -----
From: "Jukka Rahkonen" <ju...@itmoon.fi>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, April 30, 2003 5:05 PM
Subject: Re: Question on how to bind attribute for an HTML element


> Hi sathish,
>
> More complete example would be:
>
> html-template:
> ------------------------------------
> <table>
>   <tr>
>     <td jwcid="myColor">Some fixed text and <span jwcid="more"/></td>
>   </tr>
> </table>
>
> ------------------------------------
>
> .page specification:
> -------------------------------------
>
> <component id="more" type="Insert">
>   <static-binding name="value">some binded content.</static-binding>
> </component>
>
> <component id="myColor" type="Any">
>   <static-binding name="element">td</static-binding>
>   <binding name="bgcolor" expression="myColor"/>
> </component>
>
> --------------------------------------
>
> BR,
>    Jukka Rahkonen   jukka.rahkonen@itmoon.fi
>
>
>
>
>
>
>
> Sathish Senathi wrote:
>
> >Hi Jukka,
> >Your suggesion will create the tag as <td bgcolor=.../>
> >But i want
> ><td bgcolor =....>sometext </td>
> >In this case how would i do it ?
> >Thanks
> >sathish
> >
> >
> >----- Original Message -----
> >From: "Jukka Rahkonen" <ju...@itmoon.fi>
> >To: "Tapestry users" <ta...@jakarta.apache.org>
> >Sent: Wednesday, April 30, 2003 4:14 PM
> >Subject: Re: Question on how to bind attribute for an HTML element
> >
> >
> >
> >
> >>Hi,
> >>
> >>You should use following component binding on your
> >>.page or .jwc:
> >>
> >><component id="myColor" type="Any">
> >>  <static-binding name="element">td</static-binding>
> >>  <binding name="bgcolor" expression="myColor"/>
> >></component>
> >>
> >>There is an example in Tutorial and in Developers Guide.
> >>See Component Reference for type "Any" also.
> >>
> >>BR,
> >>   Jukka Rahkonen
> >>   jukka.rahkonen@itmoon.fi
> >>
> >>
> >>Sathish Senathi wrote:
> >>
> >>
> >>
> >>>Hi,
> >>>
> >>>I have the following template
> >>>
> >>><span jwcid="dbRows">
> >>>
> >>><tr >
> >>>
> >>><span jwcid="dbCols">
> >>>
> >>><td>
> >>>
> >>><span jwcid="dbItem">Item</span>
> >>>
> >>></td>
> >>>
> >>></span>
> >>>
> >>></tr>
> >>>
> >>></span>
> >>>
> >>>
> >>>
> >>>I want the <tr>  to have the bgcolor attribute and value should be
binded
> >>>
> >>>
> >to
> >
> >
> >>>an expession
> >>>
> >>>like the following:
> >>>
> >>><td  jwcid="myColor">
> >>>
> >>>and myColor retunrs "bgcolor=#xxxxx". Is this right way to do it ?. I
> >>>
> >>>
> >dont
> >
> >
> >>>see examples on this. I do see an example for <BODY> element where you
> >>>
> >>>
> >can
> >
> >
> >>>change the color dynamically.
> >>>
> >>>Any help wil be appreciated.
> >>>
> >>>Thanks
> >>>
> >>>sathish
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


Re: Question on how to bind attribute for an HTML element

Posted by Jukka Rahkonen <ju...@itmoon.fi>.
Hi sathish,

More complete example would be:

html-template:
------------------------------------
<table>
  <tr>
    <td jwcid="myColor">Some fixed text and <span jwcid="more"/></td>
  </tr>
</table>

------------------------------------

.page specification:
-------------------------------------

<component id="more" type="Insert">
  <static-binding name="value">some binded content.</static-binding>
</component>

<component id="myColor" type="Any">
  <static-binding name="element">td</static-binding>
  <binding name="bgcolor" expression="myColor"/>
</component>

--------------------------------------

BR, 
   Jukka Rahkonen   jukka.rahkonen@itmoon.fi







Sathish Senathi wrote:

>Hi Jukka,
>Your suggesion will create the tag as <td bgcolor=.../>
>But i want
><td bgcolor =....>sometext </td>
>In this case how would i do it ?
>Thanks
>sathish
>
>
>----- Original Message -----
>From: "Jukka Rahkonen" <ju...@itmoon.fi>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Sent: Wednesday, April 30, 2003 4:14 PM
>Subject: Re: Question on how to bind attribute for an HTML element
>
>
>  
>
>>Hi,
>>
>>You should use following component binding on your
>>.page or .jwc:
>>
>><component id="myColor" type="Any">
>>  <static-binding name="element">td</static-binding>
>>  <binding name="bgcolor" expression="myColor"/>
>></component>
>>
>>There is an example in Tutorial and in Developers Guide.
>>See Component Reference for type "Any" also.
>>
>>BR,
>>   Jukka Rahkonen
>>   jukka.rahkonen@itmoon.fi
>>
>>
>>Sathish Senathi wrote:
>>
>>    
>>
>>>Hi,
>>>
>>>I have the following template
>>>
>>><span jwcid="dbRows">
>>>
>>><tr >
>>>
>>><span jwcid="dbCols">
>>>
>>><td>
>>>
>>><span jwcid="dbItem">Item</span>
>>>
>>></td>
>>>
>>></span>
>>>
>>></tr>
>>>
>>></span>
>>>
>>>
>>>
>>>I want the <tr>  to have the bgcolor attribute and value should be binded
>>>      
>>>
>to
>  
>
>>>an expession
>>>
>>>like the following:
>>>
>>><td  jwcid="myColor">
>>>
>>>and myColor retunrs "bgcolor=#xxxxx". Is this right way to do it ?. I
>>>      
>>>
>dont
>  
>
>>>see examples on this. I do see an example for <BODY> element where you
>>>      
>>>
>can
>  
>
>>>change the color dynamically.
>>>
>>>Any help wil be appreciated.
>>>
>>>Thanks
>>>
>>>sathish
>>>
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>      
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>



Re: Question on how to bind attribute for an HTML element

Posted by Sathish Senathi <sa...@optusnet.com.au>.
Hi Jukka,
Your suggesion will create the tag as <td bgcolor=.../>
But i want
<td bgcolor =....>sometext </td>
In this case how would i do it ?
Thanks
sathish


----- Original Message -----
From: "Jukka Rahkonen" <ju...@itmoon.fi>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, April 30, 2003 4:14 PM
Subject: Re: Question on how to bind attribute for an HTML element


> Hi,
>
> You should use following component binding on your
> .page or .jwc:
>
> <component id="myColor" type="Any">
>   <static-binding name="element">td</static-binding>
>   <binding name="bgcolor" expression="myColor"/>
> </component>
>
> There is an example in Tutorial and in Developers Guide.
> See Component Reference for type "Any" also.
>
> BR,
>    Jukka Rahkonen
>    jukka.rahkonen@itmoon.fi
>
>
> Sathish Senathi wrote:
>
> >Hi,
> >
> >I have the following template
> >
> ><span jwcid="dbRows">
> >
> ><tr >
> >
> ><span jwcid="dbCols">
> >
> ><td>
> >
> ><span jwcid="dbItem">Item</span>
> >
> ></td>
> >
> ></span>
> >
> ></tr>
> >
> ></span>
> >
> >
> >
> >I want the <tr>  to have the bgcolor attribute and value should be binded
to
> >an expession
> >
> >like the following:
> >
> ><td  jwcid="myColor">
> >
> >and myColor retunrs "bgcolor=#xxxxx". Is this right way to do it ?. I
dont
> >see examples on this. I do see an example for <BODY> element where you
can
> >change the color dynamically.
> >
> >Any help wil be appreciated.
> >
> >Thanks
> >
> >sathish
> >
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


Re: Question on how to bind attribute for an HTML element

Posted by Jukka Rahkonen <ju...@itmoon.fi>.
Hi,

You should use following component binding on your
.page or .jwc:

<component id="myColor" type="Any">
  <static-binding name="element">td</static-binding>
  <binding name="bgcolor" expression="myColor"/>
</component>

There is an example in Tutorial and in Developers Guide.
See Component Reference for type "Any" also.

BR,
   Jukka Rahkonen    
   jukka.rahkonen@itmoon.fi


Sathish Senathi wrote:

>Hi,
>
>I have the following template
>
><span jwcid="dbRows">
>
><tr >
>
><span jwcid="dbCols">
>
><td>
>
><span jwcid="dbItem">Item</span>
>
></td>
>
></span>
>
></tr>
>
></span>
>
>
>
>I want the <tr>  to have the bgcolor attribute and value should be binded to
>an expession
>
>like the following:
>
><td  jwcid="myColor">
>
>and myColor retunrs "bgcolor=#xxxxx". Is this right way to do it ?. I dont
>see examples on this. I do see an example for <BODY> element where you can
>change the color dynamically.
>
>Any help wil be appreciated.
>
>Thanks
>
>sathish
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>