You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ashish Mishra <am...@webifyservices.com> on 2003/08/22 10:26:24 UTC

Adding Component at Runtime

Hi all,

Is it possible to add component(say CheckBox) at runtime.

Regards

Ashish

Re: Adding Component at Runtime

Posted by Harish Krishnaswamy <hk...@comcast.net>.
I think you can accomplish what you want using Block and RenderBlock 
components. Check out 
http://article.gmane.org/gmane.comp.java.tapestry.user/2648.

-Harish

Ashish Mishra wrote:

>Hi all,
>
>Is it possible to add component(say CheckBox) at runtime.
>
>Regards
>
>Ashish
>  
>


Re: Adding Component at Runtime

Posted by Harish Krishnaswamy <hk...@comcast.net>.
It sounds like you can do this with a simple Foreach, something like the 
following.

<tr jwcid="@Foreach" source="ognl:listModel" element="tr">
    <td><input type="checkbox" jwcid="@CheckBox" 
selected="ognl:someProperty"></td>
</tr>

-Harish

Ashish Mishra wrote:

>Hi all,
>
>Let me describe in detail as to what I want.
>
>I have html form, the elemnts of it(to be specific number of ChekBoxes )are
>not known iitially.
>
>I want the Checkbox to be populated as the runtime depending upon List that
>is populated from the database.
>
>i.e. If List.size()=2 i want 2 checkboxes to be populated
>
> If List.size()=3 i want 3 checkboxes to be populated
>
>and i would like to have values of respecive checkbox to be trapped in the
>next page.
>
>I hope this clears the scenario.
>
>Regards
>
>Ashish
>
>
>----- Original Message -----
>From: "Jamie Orchard-Hays" <ja...@dang.com>
>To: "Tapestry users" <ta...@jakarta.apache.org>; "Ashish Mishra"
><am...@webifyservices.com>
>Sent: Friday, August 22, 2003 7:10 PM
>Subject: Re: Adding Component at Runtime
>
>
>  
>
>>Seems like you could use the Conditional component for this:
>>
>><span jwcid="@Conditional" condition="ognl:isSomeCondition">
>>    <!-- insert your checkbox here -->
>></span>
>>
>>
>>
>>----- Original Message -----
>>From: "Ashish Mishra" <am...@webifyservices.com>
>>To: "Tapestry users" <ta...@jakarta.apache.org>
>>Sent: Friday, August 22, 2003 4:26 AM
>>Subject: Adding Component at Runtime
>>
>>
>>Hi all,
>>
>>Is it possible to add component(say CheckBox) at runtime.
>>
>>Regards
>>
>>Ashish
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>

Re: Adding Component at Runtime

Posted by Jamie Orchard-Hays <ja...@dang.com>.
Ashish, wouldn't this work?

<span jwcid="@Conditional" condition="ognl:List.size()==2">
    <!-- insert your 2 checkbox here -->
</span>

But, are you trying to really do a loop? Are you trying to take a list and then display a check box for each item in the list? In
other words, if the list has 3 items, you want 3 checkboxes, if the list has 7 items, then 7 checkboxes, and so on. In that case you
should be using Foreach.

For example (I'm just using an insert here, not a checkbox):

in your jwc:
<component id="jobOpportunities" type="Foreach">
      <binding name="source" expression="jobOpportunities"/>
      <binding name="value" expression="jobOpportunity"/>
</component>

<component id="jobTitle" type="Insert">
       <binding name="value" expression="jobOpportunity.jobTitle"/>
</component>

in your html:
<tr jwcid="jobOpportunities" element="tr">
  <td><span jwcid="jobTitle">Manager</span></td>
</tr>




----- Original Message ----- 
From: "Ashish Mishra" <am...@webifyservices.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, August 22, 2003 9:59 AM
Subject: Re: Adding Component at Runtime


> Hi all,
>
> Let me describe in detail as to what I want.
>
> I have html form, the elemnts of it(to be specific number of ChekBoxes )are
> not known iitially.
>
> I want the Checkbox to be populated as the runtime depending upon List that
> is populated from the database.
>
> i.e. If List.size()=2 i want 2 checkboxes to be populated
>
>  If List.size()=3 i want 3 checkboxes to be populated
>
> and i would like to have values of respecive checkbox to be trapped in the
> next page.
>
> I hope this clears the scenario.
>
> Regards
>
> Ashish
>
>
> ----- Original Message -----
> From: "Jamie Orchard-Hays" <ja...@dang.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>; "Ashish Mishra"
> <am...@webifyservices.com>
> Sent: Friday, August 22, 2003 7:10 PM
> Subject: Re: Adding Component at Runtime
>
>
> > Seems like you could use the Conditional component for this:
> >
> > <span jwcid="@Conditional" condition="ognl:isSomeCondition">
> >     <!-- insert your checkbox here -->
> > </span>
> >
> >
> >
> > ----- Original Message -----
> > From: "Ashish Mishra" <am...@webifyservices.com>
> > To: "Tapestry users" <ta...@jakarta.apache.org>
> > Sent: Friday, August 22, 2003 4:26 AM
> > Subject: Adding Component at Runtime
> >
> >
> > Hi all,
> >
> > Is it possible to add component(say CheckBox) at runtime.
> >
> > Regards
> >
> > Ashish
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>


Re: Adding Component at Runtime

Posted by Mark Rose <mr...@docent.com>.
Julio C. Rivera wrote:

> See the LocateList component at the Tapestry examples coming with the 
> Tapestry distribution.

I have done something a little different, as well (but perhaps I'm just 
reinventing the wheel).

  To avoid having to write the getter and setter for the checkbox, I've 
created a class that is something like a Map, but ensures that for any 
key an object is returned that supports isSelected() and setSelected(). 
This allows one to bind things this way (assuming that "currentLocale" 
is set to the current value in the Foreach or ListEdit):

<component id="checkbox" type="Checkbox">
   <binding name="selected"
       expression="selectedLocales.get(currentLocale).selected"/>
   </component>
...
<property-specification name="selectedLocales"
     type="SelectedSet" initial-value="new SelectedSet()"/>

and the SelectedSet class then allows getting the selected set via:
     getSelectedLocales().iterator()

I find this more convenient than using a special-purpose getter and 
setter to add to the list, as more of the code is in the .page (but it's 
less type-safe).

Another approach might be to create a new component kind of like 
Checkbox that wants two bindings: a key (IN), and a delegator that is a 
Set to hold the selected values (OUT).

Mark
-- 
Mark Rose
650.962.5665
mailto:mrose@docent.com


Re: Adding Component at Runtime

Posted by "Julio C. Rivera" <ju...@ya.com>.
See the LocateList component at the Tapestry examples coming with the 
Tapestry distribution. It is inside package org.apache.tapestry.workbech.table.
It has a example with checkboxes inside a table (but using inside a foreach 
is very similar).

Regards.
    Julio.

At 21:32 22/08/2003 +0530, you wrote:
>Hi all,
>
>I would add the check box in for loop.
>
>But how would i get the value of this checkbox in next page as we don't have
>the selected property for these checkboxes.
>
>
>Regards
>
>Ashish
>----- Original Message -----
>From: "Howard M. Lewis Ship" <hl...@comcast.net>
>To: "'Tapestry users'" <ta...@jakarta.apache.org>; "'Ashish Mishra'"
><am...@webifyservices.com>
>Sent: Friday, August 22, 2003 8:33 PM
>Subject: RE: Adding Component at Runtime
>
>
> > And that sounds to me like a Checkbox enclosed by a Foreach.
> >
> > --
> > Howard M. Lewis Ship
> > Creator, Tapestry: Java Web Components
> > http://jakarta.apache.org/tapestry
> > http://jakarta.apache.org/commons/sandbox/hivemind/
> > http://javatapestry.blogspot.com
> >
> > > -----Original Message-----
> > > From: Ashish Mishra [mailto:amishra@webifyservices.com]
> > > Sent: Friday, August 22, 2003 9:59 AM
> > > To: Tapestry users
> > > Subject: Re: Adding Component at Runtime
> > >
> > >
> > > Hi all,
> > >
> > > Let me describe in detail as to what I want.
> > >
> > > I have html form, the elemnts of it(to be specific number of
> > > ChekBoxes )are not known iitially.
> > >
> > > I want the Checkbox to be populated as the runtime depending
> > > upon List that is populated from the database.
> > >
> > > i.e. If List.size()=2 i want 2 checkboxes to be populated
> > >
> > >  If List.size()=3 i want 3 checkboxes to be populated
> > >
> > > and i would like to have values of respecive checkbox to be
> > > trapped in the next page.
> > >
> > > I hope this clears the scenario.
> > >
> > > Regards
> > >
> > > Ashish
> > >
> > >
> > > ----- Original Message -----
> > > From: "Jamie Orchard-Hays" <ja...@dang.com>
> > > To: "Tapestry users" <ta...@jakarta.apache.org>;
> > > "Ashish Mishra" <am...@webifyservices.com>
> > > Sent: Friday, August 22, 2003 7:10 PM
> > > Subject: Re: Adding Component at Runtime
> > >
> > >
> > > > Seems like you could use the Conditional component for this:
> > > >
> > > > <span jwcid="@Conditional" condition="ognl:isSomeCondition">
> > > >     <!-- insert your checkbox here -->
> > > > </span>
> > > >
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Ashish Mishra" <am...@webifyservices.com>
> > > > To: "Tapestry users" <ta...@jakarta.apache.org>
> > > > Sent: Friday, August 22, 2003 4:26 AM
> > > > Subject: Adding Component at Runtime
> > > >
> > > >
> > > > Hi all,
> > > >
> > > > Is it possible to add component(say CheckBox) at runtime.
> > > >
> > > > Regards
> > > >
> > > > Ashish
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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: Adding Component at Runtime

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Which is pretty much what the ListEdit component does; it records a key for each iteration of the
loop as a hidden field; when form is submitted, the key is restored from the hidden field and used
to re-acquire the real object.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: tsvetelin [mailto:tsvetelin.saykov@rushmore-digital.com] 
> Sent: Friday, August 22, 2003 12:21 PM
> To: Tapestry users; Ashish Mishra
> Subject: RE: Adding Component at Runtime
> 
> 
> Hi,
> 
> 
> I solve this problem by adding a hidden field next to 
> checkbox component, that store the unique identifier for 
> particular row. Durring the form rewind phase if the check 
> box is cheked you could obtain the value from the hidden 
> field and process/do your use case with the value.
> 
> Tsvetelin.
> 
> -----Original Message-----
> From: Ashish Mishra [mailto:amishra@webifyservices.com]
> Sent: Friday, August 22, 2003 7:02 PM
> To: Howard M. Lewis Ship; 'Tapestry users'
> Subject: Re: Adding Component at Runtime
> 
> 
> Hi all,
> 
> I would add the check box in for loop.
> 
> But how would i get the value of this checkbox in next page 
> as we don't have the selected property for these checkboxes.
> 
> 
> Regards
> 
> Ashish
> ----- Original Message -----
> From: "Howard M. Lewis Ship" <hl...@comcast.net>
> To: "'Tapestry users'" <ta...@jakarta.apache.org>; 
> "'Ashish Mishra'" <am...@webifyservices.com>
> Sent: Friday, August 22, 2003 8:33 PM
> Subject: RE: Adding Component at Runtime
> 
> 
> > And that sounds to me like a Checkbox enclosed by a Foreach.
> >
> > --
> > Howard M. Lewis Ship
> > Creator, Tapestry: Java Web Components 
> > http://jakarta.apache.org/tapestry
> > http://jakarta.apache.org/commons/sandbox/hivemind/
> > http://javatapestry.blogspot.com
> >
> > > -----Original Message-----
> > > From: Ashish Mishra [mailto:amishra@webifyservices.com]
> > > Sent: Friday, August 22, 2003 9:59 AM
> > > To: Tapestry users
> > > Subject: Re: Adding Component at Runtime
> > >
> > >
> > > Hi all,
> > >
> > > Let me describe in detail as to what I want.
> > >
> > > I have html form, the elemnts of it(to be specific number of 
> > > ChekBoxes )are not known iitially.
> > >
> > > I want the Checkbox to be populated as the runtime depending upon 
> > > List that is populated from the database.
> > >
> > > i.e. If List.size()=2 i want 2 checkboxes to be populated
> > >
> > >  If List.size()=3 i want 3 checkboxes to be populated
> > >
> > > and i would like to have values of respecive checkbox to 
> be trapped 
> > > in the next page.
> > >
> > > I hope this clears the scenario.
> > >
> > > Regards
> > >
> > > Ashish
> > >
> > >
> > > ----- Original Message -----
> > > From: "Jamie Orchard-Hays" <ja...@dang.com>
> > > To: "Tapestry users" <ta...@jakarta.apache.org>;
> > > "Ashish Mishra" <am...@webifyservices.com>
> > > Sent: Friday, August 22, 2003 7:10 PM
> > > Subject: Re: Adding Component at Runtime
> > >
> > >
> > > > Seems like you could use the Conditional component for this:
> > > >
> > > > <span jwcid="@Conditional" condition="ognl:isSomeCondition">
> > > >     <!-- insert your checkbox here -->
> > > > </span>
> > > >
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Ashish Mishra" <am...@webifyservices.com>
> > > > To: "Tapestry users" <ta...@jakarta.apache.org>
> > > > Sent: Friday, August 22, 2003 4:26 AM
> > > > Subject: Adding Component at Runtime
> > > >
> > > >
> > > > Hi all,
> > > >
> > > > Is it possible to add component(say CheckBox) at runtime.
> > > >
> > > > Regards
> > > >
> > > > Ashish
> > >
> > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > 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: Adding Component at Runtime

Posted by tsvetelin <ts...@rushmore-digital.com>.
Hi,


I solve this problem by adding a hidden field next to checkbox component,
that store the unique identifier for particular row. Durring the form rewind
phase if the check box is cheked you could obtain the value from the hidden
field and process/do your use case with the value.

Tsvetelin.

-----Original Message-----
From: Ashish Mishra [mailto:amishra@webifyservices.com]
Sent: Friday, August 22, 2003 7:02 PM
To: Howard M. Lewis Ship; 'Tapestry users'
Subject: Re: Adding Component at Runtime


Hi all,

I would add the check box in for loop.

But how would i get the value of this checkbox in next page as we don't have
the selected property for these checkboxes.


Regards

Ashish
----- Original Message -----
From: "Howard M. Lewis Ship" <hl...@comcast.net>
To: "'Tapestry users'" <ta...@jakarta.apache.org>; "'Ashish Mishra'"
<am...@webifyservices.com>
Sent: Friday, August 22, 2003 8:33 PM
Subject: RE: Adding Component at Runtime


> And that sounds to me like a Checkbox enclosed by a Foreach.
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> http://jakarta.apache.org/commons/sandbox/hivemind/
> http://javatapestry.blogspot.com
>
> > -----Original Message-----
> > From: Ashish Mishra [mailto:amishra@webifyservices.com]
> > Sent: Friday, August 22, 2003 9:59 AM
> > To: Tapestry users
> > Subject: Re: Adding Component at Runtime
> >
> >
> > Hi all,
> >
> > Let me describe in detail as to what I want.
> >
> > I have html form, the elemnts of it(to be specific number of
> > ChekBoxes )are not known iitially.
> >
> > I want the Checkbox to be populated as the runtime depending
> > upon List that is populated from the database.
> >
> > i.e. If List.size()=2 i want 2 checkboxes to be populated
> >
> >  If List.size()=3 i want 3 checkboxes to be populated
> >
> > and i would like to have values of respecive checkbox to be
> > trapped in the next page.
> >
> > I hope this clears the scenario.
> >
> > Regards
> >
> > Ashish
> >
> >
> > ----- Original Message -----
> > From: "Jamie Orchard-Hays" <ja...@dang.com>
> > To: "Tapestry users" <ta...@jakarta.apache.org>;
> > "Ashish Mishra" <am...@webifyservices.com>
> > Sent: Friday, August 22, 2003 7:10 PM
> > Subject: Re: Adding Component at Runtime
> >
> >
> > > Seems like you could use the Conditional component for this:
> > >
> > > <span jwcid="@Conditional" condition="ognl:isSomeCondition">
> > >     <!-- insert your checkbox here -->
> > > </span>
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Ashish Mishra" <am...@webifyservices.com>
> > > To: "Tapestry users" <ta...@jakarta.apache.org>
> > > Sent: Friday, August 22, 2003 4:26 AM
> > > Subject: Adding Component at Runtime
> > >
> > >
> > > Hi all,
> > >
> > > Is it possible to add component(say CheckBox) at runtime.
> > >
> > > Regards
> > >
> > > Ashish
> >
> >
> > ---------------------------------------------------------------------
> > 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: Adding Component at Runtime

Posted by Ashish Mishra <am...@webifyservices.com>.
Hi all,

I would add the check box in for loop.

But how would i get the value of this checkbox in next page as we don't have
the selected property for these checkboxes.


Regards

Ashish
----- Original Message -----
From: "Howard M. Lewis Ship" <hl...@comcast.net>
To: "'Tapestry users'" <ta...@jakarta.apache.org>; "'Ashish Mishra'"
<am...@webifyservices.com>
Sent: Friday, August 22, 2003 8:33 PM
Subject: RE: Adding Component at Runtime


> And that sounds to me like a Checkbox enclosed by a Foreach.
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> http://jakarta.apache.org/commons/sandbox/hivemind/
> http://javatapestry.blogspot.com
>
> > -----Original Message-----
> > From: Ashish Mishra [mailto:amishra@webifyservices.com]
> > Sent: Friday, August 22, 2003 9:59 AM
> > To: Tapestry users
> > Subject: Re: Adding Component at Runtime
> >
> >
> > Hi all,
> >
> > Let me describe in detail as to what I want.
> >
> > I have html form, the elemnts of it(to be specific number of
> > ChekBoxes )are not known iitially.
> >
> > I want the Checkbox to be populated as the runtime depending
> > upon List that is populated from the database.
> >
> > i.e. If List.size()=2 i want 2 checkboxes to be populated
> >
> >  If List.size()=3 i want 3 checkboxes to be populated
> >
> > and i would like to have values of respecive checkbox to be
> > trapped in the next page.
> >
> > I hope this clears the scenario.
> >
> > Regards
> >
> > Ashish
> >
> >
> > ----- Original Message -----
> > From: "Jamie Orchard-Hays" <ja...@dang.com>
> > To: "Tapestry users" <ta...@jakarta.apache.org>;
> > "Ashish Mishra" <am...@webifyservices.com>
> > Sent: Friday, August 22, 2003 7:10 PM
> > Subject: Re: Adding Component at Runtime
> >
> >
> > > Seems like you could use the Conditional component for this:
> > >
> > > <span jwcid="@Conditional" condition="ognl:isSomeCondition">
> > >     <!-- insert your checkbox here -->
> > > </span>
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Ashish Mishra" <am...@webifyservices.com>
> > > To: "Tapestry users" <ta...@jakarta.apache.org>
> > > Sent: Friday, August 22, 2003 4:26 AM
> > > Subject: Adding Component at Runtime
> > >
> > >
> > > Hi all,
> > >
> > > Is it possible to add component(say CheckBox) at runtime.
> > >
> > > Regards
> > >
> > > Ashish
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
>


RE: Adding Component at Runtime

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
And that sounds to me like a Checkbox enclosed by a Foreach.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Ashish Mishra [mailto:amishra@webifyservices.com] 
> Sent: Friday, August 22, 2003 9:59 AM
> To: Tapestry users
> Subject: Re: Adding Component at Runtime
> 
> 
> Hi all,
> 
> Let me describe in detail as to what I want.
> 
> I have html form, the elemnts of it(to be specific number of 
> ChekBoxes )are not known iitially.
> 
> I want the Checkbox to be populated as the runtime depending 
> upon List that is populated from the database.
> 
> i.e. If List.size()=2 i want 2 checkboxes to be populated
> 
>  If List.size()=3 i want 3 checkboxes to be populated
> 
> and i would like to have values of respecive checkbox to be 
> trapped in the next page.
> 
> I hope this clears the scenario.
> 
> Regards
> 
> Ashish
> 
> 
> ----- Original Message -----
> From: "Jamie Orchard-Hays" <ja...@dang.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>; 
> "Ashish Mishra" <am...@webifyservices.com>
> Sent: Friday, August 22, 2003 7:10 PM
> Subject: Re: Adding Component at Runtime
> 
> 
> > Seems like you could use the Conditional component for this:
> >
> > <span jwcid="@Conditional" condition="ognl:isSomeCondition">
> >     <!-- insert your checkbox here -->
> > </span>
> >
> >
> >
> > ----- Original Message -----
> > From: "Ashish Mishra" <am...@webifyservices.com>
> > To: "Tapestry users" <ta...@jakarta.apache.org>
> > Sent: Friday, August 22, 2003 4:26 AM
> > Subject: Adding Component at Runtime
> >
> >
> > Hi all,
> >
> > Is it possible to add component(say CheckBox) at runtime.
> >
> > Regards
> >
> > Ashish
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


Re: Adding Component at Runtime

Posted by Ashish Mishra <am...@webifyservices.com>.
Hi all,

Let me describe in detail as to what I want.

I have html form, the elemnts of it(to be specific number of ChekBoxes )are
not known iitially.

I want the Checkbox to be populated as the runtime depending upon List that
is populated from the database.

i.e. If List.size()=2 i want 2 checkboxes to be populated

 If List.size()=3 i want 3 checkboxes to be populated

and i would like to have values of respecive checkbox to be trapped in the
next page.

I hope this clears the scenario.

Regards

Ashish


----- Original Message -----
From: "Jamie Orchard-Hays" <ja...@dang.com>
To: "Tapestry users" <ta...@jakarta.apache.org>; "Ashish Mishra"
<am...@webifyservices.com>
Sent: Friday, August 22, 2003 7:10 PM
Subject: Re: Adding Component at Runtime


> Seems like you could use the Conditional component for this:
>
> <span jwcid="@Conditional" condition="ognl:isSomeCondition">
>     <!-- insert your checkbox here -->
> </span>
>
>
>
> ----- Original Message -----
> From: "Ashish Mishra" <am...@webifyservices.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Friday, August 22, 2003 4:26 AM
> Subject: Adding Component at Runtime
>
>
> Hi all,
>
> Is it possible to add component(say CheckBox) at runtime.
>
> Regards
>
> Ashish


Re: Adding Component at Runtime

Posted by Jamie Orchard-Hays <ja...@dang.com>.
Seems like you could use the Conditional component for this:

<span jwcid="@Conditional" condition="ognl:isSomeCondition"> 
    <!-- insert your checkbox here -->
</span>



----- Original Message ----- 
From: "Ashish Mishra" <am...@webifyservices.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, August 22, 2003 4:26 AM
Subject: Adding Component at Runtime


Hi all,

Is it possible to add component(say CheckBox) at runtime.

Regards

Ashish

RE: Adding Component at Runtime

Posted by Mindaugas Genutis <mi...@elinara.ktu.lt>.
I have a relevant question. I need to insert a Checkbox and a Form 
component into a Table row (ITableColumnModel). I'm setting up the 
ColumnModel in Java. Is it possible to do that? 

> No.  The page layout must be, basically static.  Remmeber that Tapestry applications use pools of
> pages and may be distributed across a cluster ... if we were to allow the ability to add a component
> to a particular instance of a page there's no effective way to coordinate that within the same JVM
> or across the cluster.
> 
> However, Tapestry does a really good job using conditionals and loops within forms.
> 
> --
> Howard M. Lewis Ship

-- 
Kaunas Regional Distance Education Center
Programmer
Phone: +370 674 05232
WWW: http://distance.ktu.lt


RE: Adding Component at Runtime

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
No.  The page layout must be, basically static.  Remmeber that Tapestry applications use pools of
pages and may be distributed across a cluster ... if we were to allow the ability to add a component
to a particular instance of a page there's no effective way to coordinate that within the same JVM
or across the cluster.

However, Tapestry does a really good job using conditionals and loops within forms.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Ashish Mishra [mailto:amishra@webifyservices.com] 
> Sent: Friday, August 22, 2003 4:26 AM
> To: Tapestry users
> Subject: Adding Component at Runtime
> 
> 
> Hi all,
> 
> Is it possible to add component(say CheckBox) at runtime.
> 
> Regards
> 
> Ashish
>