You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by jake123 <ja...@gmail.com> on 2006/11/27 19:39:34 UTC

How to get the values from a checkBoxes in a abstract component

Hi,
I am building a page where I have a abstract component that is working on a
list of articles in a form. The user should be able to check/uncheck each
and everyone of the list content with checkboxes. The question is how do I
work with checkboxes in a abstract component? How do I get the value from
the form? 
Have anybody done this before?

Thanks,
Jacob
-- 
View this message in context: http://www.nabble.com/How-to-get-the-values-from-a-checkBoxes-in-a-abstract-component-tf2713574.html#a7565309
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: How to get the values from a checkBoxes in a abstract component

Posted by jake123 <ja...@gmail.com>.
I dont know how to do that...this is how part of my abstract component look
like now:

if (menuItemIdList != null && menuItemIdList.size() > 0) {
			writer.begin("ul");
			writer.attribute("class", "categories");
			for (Long menuItemId : menuItemIdList) {
				MenuItemDTO menuItemDTO =
articleLinkDTO.getMenuItemDTOMap().get(menuItemId);
				List<Long> articleIdList = menuItemDTO.getArticleIdList();

				/* More than one article, generat the links in lvl 2 */					
				String menuItemName = menuItemDTO.getMenuItem().getName();
				writer.begin("li");
				writer.attribute("class", "menuItems_lvl_1");
				
				menuNameStr = menuNameStr.replace(" ", "").toLowerCase();
				
				writer.begin("div");
				writer.attribute("id", "lvl_1_" + menuItemName);
				writer.attribute("class", "subCategory");
				writer.begin("a");
				writer.attribute("href", "");
				writer.begin("span");
				writer.print(menuItemName);
				writer.end(); // end span
				writer.end(); // end a
				writer.end(); // end div
				if (articleIdList != null && articleIdList.size() > 0) {
					writer.begin("ul");
					writer.attribute("class", "subMenuItems_lvl_2");
					int index = 0;
					for (Long articleId : articleIdList) {
						Article currentArticle =
articleLinkDTO.getArticleMap().get(articleId);
						writer.begin("li");
						writer.attribute("class", "lvl_2");
						writer.begin("div");
						writer.attribute("id", "lvl_2_" + currentArticle.getName());
						writer.attribute("class", "from_lvl_2");						
						/* add the checkbox */
						writer.begin("input");
						writer.attribute("type", "checkbox");
						writer.attribute("name", index);
						writer.attribute("value", articleId.toString());
						if (currentRepSiteArticleIdSet.contains(articleId)) {
							writer.attribute("checked", "true");
						}
						writer.end(); // end input
						/* the link open up the article in a pop up window */
						writer.begin("a");
						writer.attribute("target", "_blank");
						writer.attribute("href", currentArticle.getText());
						writer.begin("span");
						writer.print(currentArticle.getName());
						writer.end(); //end span
						writer.end(); // end a
						writer.end(); // end div
						writer.end(); // end li
						
						index++;
					}
					writer.end(); // end ul
					writer.end(); // end li					
				}				
			}
			writer.end(); // end ul
		} 

do you have any pointers on how to generate and retrieve the checkboxes that
would help a lot....

Thanks,
Jacob

-- 
View this message in context: http://www.nabble.com/How-to-get-the-values-from-a-checkBoxes-in-a-abstract-component-tf2713574.html#a7567652
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: How to get the values from a checkBoxes in a abstract component

Posted by Shing Hing Man <ma...@yahoo.com>.
During render, have you considered extract the list
from your DTO object and then pass the list to   
MultiplePropertySelection ?

During rewind, do the oppose.

Shing 



--- jake123 <ja...@gmail.com> wrote:

> 
> Hi Shing,
> I have looked in to the MultiplePropertySelection
> component. They all look
> fine, but the problem is that I am working in a
> Abstract Component because
> the DTO object I have  in the web layer is a complex
> structure and I need to
> iterate through one list to get the actual list that
> will contain the
> checkboxes...
> for () {
>     for () {
>         <!-- Here I have the list  where I want to
> use the checkbox
> component -->
>     }
> }
> 
> Do you have any suggestions on how to solve this in
> a Abstract Component
> way?
> 
> Thanks again for all the help,
> Jacob
> -- 
> View this message in context:
>
http://www.nabble.com/How-to-get-the-values-from-a-checkBoxes-in-a-abstract-component-tf2713574.html#a7566813
> Sent from the Tapestry - User mailing list archive
> at Nabble.com.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail:
> users-help@tapestry.apache.org
> 
> 


Home page :
  http://uk.geocities.com/matmsh/index.html


	
	
		
___________________________________________________________ 
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine 
http://uk.docs.yahoo.com/nowyoucan.html

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


Re: How to get the values from a checkBoxes in a abstract component

Posted by jake123 <ja...@gmail.com>.
Hi Shing,
I have looked in to the MultiplePropertySelection component. They all look
fine, but the problem is that I am working in a Abstract Component because
the DTO object I have  in the web layer is a complex structure and I need to
iterate through one list to get the actual list that will contain the
checkboxes...
for () {
    for () {
        <!-- Here I have the list  where I want to use the checkbox
component -->
    }
}

Do you have any suggestions on how to solve this in a Abstract Component
way?

Thanks again for all the help,
Jacob
-- 
View this message in context: http://www.nabble.com/How-to-get-the-values-from-a-checkBoxes-in-a-abstract-component-tf2713574.html#a7566813
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: How to get the values from a checkBoxes in a abstract component

Posted by jake123 <ja...@gmail.com>.
thanks, 
I will check this out.

Cheers,
Jacob




Shing Hing Man wrote:
> 
> There is an example on 
> MultiplePropertySelection at
> 
>  http://lombok.demon.co.uk/tapestry4Demo/app
> 
> 
> In case you did not know, in the contributed library,
> there are also simliar componets :
> CheckboxGroup, ControlCheckbox and ControlledCheckbo
> 
> Shing 
> 
> --- jake123 <ja...@gmail.com> wrote:
> 
>> 
>> No, but I am looking at it right now,
>> Have you worked with this component your self? Do
>> you have any example on
>> how to use it?
>> 
>> Thanks,
>> Jacob
>> 
>> 
>> Shing Hing Man wrote:
>> > 
>> > Have you looked at the source code of 
>> >
>>
> org.apache.tapestry.contrib.form.MultiplePropertySelection
>> > ?
>> > 
>> >  MultiplePropertySelection is an abstract form
>> > component that renders its checkbox ?
>> > 
>> > Shing 
>> > 
>> > 
>> > --- jake123 <ja...@gmail.com> wrote:
>> > 
>> >> 
>> >> Hi,
>> >> I am building a page where I have a abstract
>> >> component that is working on a
>> >> list of articles in a form. The user should be
>> able
>> >> to check/uncheck each
>> >> and everyone of the list content with checkboxes.
>> >> The question is how do I
>> >> work with checkboxes in a abstract component? How
>> do
>> >> I get the value from
>> >> the form? 
>> >> Have anybody done this before?
>> >> 
>> >> Thanks,
>> >> Jacob
>> >> -- 
>> >> View this message in context:
>> >>
>> >
>>
> http://www.nabble.com/How-to-get-the-values-from-a-checkBoxes-in-a-abstract-component-tf2713574.html#a7565309
>> >> Sent from the Tapestry - User mailing list
>> archive
>> >> at Nabble.com.
>> >> 
>> >> 
>> >>
>> >
>>
> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail:
>> >> users-unsubscribe@tapestry.apache.org
>> >> For additional commands, e-mail:
>> >> users-help@tapestry.apache.org
>> >> 
>> >> 
>> > 
>> > 
>> > Home page :
>> >   http://uk.geocities.com/matmsh/index.html
>> > 
>> > Send instant messages to your online friends
>> http://uk.messenger.yahoo.com 
>> > 
>> >
>>
> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail:
>> users-help@tapestry.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/How-to-get-the-values-from-a-checkBoxes-in-a-abstract-component-tf2713574.html#a7565871
>> Sent from the Tapestry - User mailing list archive
>> at Nabble.com.
>> 
>> 
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail:
>> users-help@tapestry.apache.org
>> 
>> 
> 
> 
> Home page :
>   http://uk.geocities.com/matmsh/index.html
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-get-the-values-from-a-checkBoxes-in-a-abstract-component-tf2713574.html#a7566210
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: How to get the values from a checkBoxes in a abstract component

Posted by Shing Hing Man <ma...@yahoo.com>.
There is an example on 
MultiplePropertySelection at

 http://lombok.demon.co.uk/tapestry4Demo/app


In case you did not know, in the contributed library,
there are also simliar componets :
CheckboxGroup, ControlCheckbox and ControlledCheckbo

Shing 

--- jake123 <ja...@gmail.com> wrote:

> 
> No, but I am looking at it right now,
> Have you worked with this component your self? Do
> you have any example on
> how to use it?
> 
> Thanks,
> Jacob
> 
> 
> Shing Hing Man wrote:
> > 
> > Have you looked at the source code of 
> >
>
org.apache.tapestry.contrib.form.MultiplePropertySelection
> > ?
> > 
> >  MultiplePropertySelection is an abstract form
> > component that renders its checkbox ?
> > 
> > Shing 
> > 
> > 
> > --- jake123 <ja...@gmail.com> wrote:
> > 
> >> 
> >> Hi,
> >> I am building a page where I have a abstract
> >> component that is working on a
> >> list of articles in a form. The user should be
> able
> >> to check/uncheck each
> >> and everyone of the list content with checkboxes.
> >> The question is how do I
> >> work with checkboxes in a abstract component? How
> do
> >> I get the value from
> >> the form? 
> >> Have anybody done this before?
> >> 
> >> Thanks,
> >> Jacob
> >> -- 
> >> View this message in context:
> >>
> >
>
http://www.nabble.com/How-to-get-the-values-from-a-checkBoxes-in-a-abstract-component-tf2713574.html#a7565309
> >> Sent from the Tapestry - User mailing list
> archive
> >> at Nabble.com.
> >> 
> >> 
> >>
> >
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> >> users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail:
> >> users-help@tapestry.apache.org
> >> 
> >> 
> > 
> > 
> > Home page :
> >   http://uk.geocities.com/matmsh/index.html
> > 
> > Send instant messages to your online friends
> http://uk.messenger.yahoo.com 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail:
> users-help@tapestry.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context:
>
http://www.nabble.com/How-to-get-the-values-from-a-checkBoxes-in-a-abstract-component-tf2713574.html#a7565871
> Sent from the Tapestry - User mailing list archive
> at Nabble.com.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail:
> users-help@tapestry.apache.org
> 
> 


Home page :
  http://uk.geocities.com/matmsh/index.html

Send instant messages to your online friends http://uk.messenger.yahoo.com 

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


Re: How to get the values from a checkBoxes in a abstract component

Posted by jake123 <ja...@gmail.com>.
No, but I am looking at it right now,
Have you worked with this component your self? Do you have any example on
how to use it?

Thanks,
Jacob


Shing Hing Man wrote:
> 
> Have you looked at the source code of 
> org.apache.tapestry.contrib.form.MultiplePropertySelection
> ?
> 
>  MultiplePropertySelection is an abstract form
> component that renders its checkbox ?
> 
> Shing 
> 
> 
> --- jake123 <ja...@gmail.com> wrote:
> 
>> 
>> Hi,
>> I am building a page where I have a abstract
>> component that is working on a
>> list of articles in a form. The user should be able
>> to check/uncheck each
>> and everyone of the list content with checkboxes.
>> The question is how do I
>> work with checkboxes in a abstract component? How do
>> I get the value from
>> the form? 
>> Have anybody done this before?
>> 
>> Thanks,
>> Jacob
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/How-to-get-the-values-from-a-checkBoxes-in-a-abstract-component-tf2713574.html#a7565309
>> Sent from the Tapestry - User mailing list archive
>> at Nabble.com.
>> 
>> 
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail:
>> users-help@tapestry.apache.org
>> 
>> 
> 
> 
> Home page :
>   http://uk.geocities.com/matmsh/index.html
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-get-the-values-from-a-checkBoxes-in-a-abstract-component-tf2713574.html#a7565871
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: How to get the values from a checkBoxes in a abstract component

Posted by Shing Hing Man <ma...@yahoo.com>.
Have you looked at the source code of 
org.apache.tapestry.contrib.form.MultiplePropertySelection
?

 MultiplePropertySelection is an abstract form
component that renders its checkbox ?

Shing 


--- jake123 <ja...@gmail.com> wrote:

> 
> Hi,
> I am building a page where I have a abstract
> component that is working on a
> list of articles in a form. The user should be able
> to check/uncheck each
> and everyone of the list content with checkboxes.
> The question is how do I
> work with checkboxes in a abstract component? How do
> I get the value from
> the form? 
> Have anybody done this before?
> 
> Thanks,
> Jacob
> -- 
> View this message in context:
>
http://www.nabble.com/How-to-get-the-values-from-a-checkBoxes-in-a-abstract-component-tf2713574.html#a7565309
> Sent from the Tapestry - User mailing list archive
> at Nabble.com.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail:
> users-help@tapestry.apache.org
> 
> 


Home page :
  http://uk.geocities.com/matmsh/index.html

Send instant messages to your online friends http://uk.messenger.yahoo.com 

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