You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Régis Piccand <gm...@piccand.com> on 2003/10/23 11:10:32 UTC

From newbie : how to set custom values in @Foreach @Option (in @form @select)

Hi all,

I'm new to Tapestry and am trying to understand how :

- forms can be dynamically filled and
- parameters are passed from one page to another

I'm now writing an html page containing a form, which itself contains a 
selection box. I can set easily the labels, but their values are numbered 
0-x ... I would prefer to be able to set these value myself (value seems 
to be reserved keyword). Is this possible ?

Assuming I then submit this form, I will want to get the parameters 
(values) in the new page. Where/how can I do that ?? I don't understand 
how I can pick up these parameters in the new page before it is rendered 
... sorry :-0

Thanks in advance for your help

Régis



Select_group.html

[...]
<body>
<p>Ajouter des articles</p>
<p>S&eacute;lectionnez des articles ci-dessous</p>
<p>&nbsp;</p>
<table width="75%" border="0">
      <tr>
        <td><form jwcid="@Form" listener="ognl:listeners.formSubmit">
	    	<select jwcid="@Select" multiple="ognl:true">
      				<span jwcid="@Foreach" source="ognl:group" 
value="ognl:currentGroup">
       					<option jwcid="@Option" selected="ognl:currentGroup.selected" 
label="ognl:currentGroup.name"/>
       				</span>
     			</select>
	        <input type="submit" name="Submit" value="Submit">
		</form>
          <p></p></td>
      </tr>
</table>
<p>&nbsp; </p>
</body>
</html>



Select_group.java

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;

import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.html.BasePage;

public class Select_group extends BasePage
{
	private Collection 	_group 				= null ;
	private Group		_currentGroup		= null ;
	
	public void formSubmit(IRequestCycle cycle)
	{
// How to read the passed values from the new page ?????
		cycle.activate("Select_item") ;
	}
	
	public Collection getGroup()
	{
		if (_group == null)
		{
			_group = new ArrayList() ;
			_group.add(new Group("Développement")) ;
			_group.add(new Group("Intégration")) ;
			_group.add(new Group("Dépannage")) ;
		}
		
		return _group ;
	}
	
	public Group getCurrentGroup()
	{
		return _currentGroup ;
	}
	
	public void setCurrentGroup(Group aGroup)
	{
		_currentGroup = aGroup ;
	}
	
	private class Group implements Serializable
	{
		private String 	name 		= null ;
		private boolean selected	= false ;
		
		Group(String aName)
		{
			name = aName ;
			setSelected(aName.length() < 10) ; // just for fun !
		}
		
		public String getName()
		{
			return name ;
		}
		

		/**
		 * @return
		 */
		public boolean isSelected()
		{
			return selected;
		}

		/**
		 * @param b
		 */
		public void setSelected(boolean b)
		{
			selected = b;
		}

	}

}


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


Re: From newbie : how to set custom values in @Foreach @Option (in @form @select)

Posted by Régis Piccand <gm...@piccand.com>.
Ok I see now ...

Thanks a lot Howard and Harish ...

Régis

On Fri, 24 Oct 2003 08:54:07 -0400, Harish Krishnaswamy 
<hk...@comcast.net> wrote:

> You could do the following.
>
> public void formSubmit(IRequestCycle cycle)
> {
>     NextPage nextPage = (NextPage) cycle.getPage("Next_page") ;
>     nextPage.setSelectedObjects(selectedObjects) ;
>     cycle.activate(nextPage) ;
> }
>
> -Harish
>
> Régis Piccand wrote:
>
>> Thanks a lot for your reply.
>>
>> It sounded a bit confusing in the beginning, but I think I got it now.
>>
>> I have created my own classes for the multiple select component and its 
>> renderer ... It rocks !!
>>
>> Just a quick question for passing selected values to the next page. 
>> This is how I do it in the listener:
>>
>>     public void formSubmit(IRequestCycle cycle)
>>     {
>>         IPage nextPage = cycle.getPage("Next_page") ;
>>         nextPage.setProperty("selectedObjects", selectedObjects) ;
>>         cycle.activate(nextPage) ;
>>     }
>>
>> Is that correct in the Tapestry approach ?
>>
>> Thanks a lot for your advices
>>
>> Régis
>>
>>
>> On Thu, 23 Oct 2003 11:05:47 -0400, Howard M. Lewis Ship 
>> <hl...@comcast.net> wrote:
>>
>>> For handling multiple selection, I would recommend using the 
>>> contrib:Palette component.
>>>
>>> Using Select and Option, each Option will simple set or clear a 
>>> boolean property; you can use this
>>> (via synthetic properties) to add or remove items from a java.util.Set 
>>> ... but it's a bit of code.
>>> Using Palette, you get a List and a better UI (assuming Javascript is 
>>> kosher for you).
>>>
>>> There's also a non-JavaScript contrib:MultipleSelection component that 
>>> also streamlines the process
>>> of selecting items.
>>>
>>> -- 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: news [mailto:news@sea.gmane.org] On Behalf Of Régis Piccand
>>>> Sent: Thursday, October 23, 2003 5:11 AM
>>>> To: tapestry-user@jakarta.apache.org
>>>> Subject: From newbie : how to set custom values in @Foreach
>>>> @Option (in @form @select)
>>>>
>>>>
>>>> Hi all,
>>>>
>>>> I'm new to Tapestry and am trying to understand how :
>>>>
>>>> - forms can be dynamically filled and
>>>> - parameters are passed from one page to another
>>>>
>>>> I'm now writing an html page containing a form, which itself
>>>> contains a
>>>> selection box. I can set easily the labels, but their values
>>>> are numbered
>>>> 0-x ... I would prefer to be able to set these value myself
>>>> (value seems
>>>> to be reserved keyword). Is this possible ?
>>>>
>>>> Assuming I then submit this form, I will want to get the parameters
>>>> (values) in the new page. Where/how can I do that ?? I don't
>>>> understand
>>>> how I can pick up these parameters in the new page before it
>>>> is rendered
>>>> ... sorry :-0
>>>>
>>>> Thanks in advance for your help
>>>>
>>>> Régis
>>>>
>>>>
>>>>
>>>> Select_group.html
>>>>
>>>> [...]
>>>> <body>
>>>> <p>Ajouter des articles</p>
>>>> <p>S&eacute;lectionnez des articles ci-dessous</p>
>>>> <p>&nbsp;</p> <table width="75%" border="0">
>>>>       <tr>
>>>>         <td><form jwcid="@Form" listener="ognl:listeners.formSubmit">
>>>>             <select jwcid="@Select" multiple="ognl:true">
>>>>                       <span jwcid="@Foreach"
>>>> source="ognl:group"
>>>> value="ognl:currentGroup">
>>>>                            <option
>>>> jwcid="@Option" selected="ognl:currentGroup.selected"
>>>> label="ognl:currentGroup.name"/>
>>>>                        </span>
>>>>                  </select>
>>>>             <input type="submit" name="Submit" value="Submit">
>>>>         </form>
>>>>           <p></p></td>
>>>>       </tr>
>>>> </table>
>>>> <p>&nbsp; </p>
>>>> </body>
>>>> </html>
>>>>
>>>>
>>>>
>>>> Select_group.java
>>>>
>>>> import java.io.Serializable;
>>>> import java.util.ArrayList;
>>>> import java.util.Collection;
>>>>
>>>> import org.apache.tapestry.IRequestCycle;
>>>> import org.apache.tapestry.html.BasePage;
>>>>
>>>> public class Select_group extends BasePage
>>>> {
>>>>     private Collection     _group                 = null ;
>>>>     private Group        _currentGroup        = null ;
>>>>         public void formSubmit(IRequestCycle cycle)
>>>>     {
>>>> // How to read the passed values from the new page ?????
>>>>         cycle.activate("Select_item") ;
>>>>     }
>>>>         public Collection getGroup()
>>>>     {
>>>>         if (_group == null)
>>>>         {
>>>>             _group = new ArrayList() ;
>>>>             _group.add(new Group("Développement")) ;
>>>>             _group.add(new Group("Intégration")) ;
>>>>             _group.add(new Group("Dépannage")) ;
>>>>         }
>>>>                return _group ;
>>>>     }
>>>>         public Group getCurrentGroup()
>>>>     {
>>>>         return _currentGroup ;
>>>>     }
>>>>         public void setCurrentGroup(Group aGroup)
>>>>     {
>>>>         _currentGroup = aGroup ;
>>>>     }
>>>>         private class Group implements Serializable
>>>>     {
>>>>         private String     name         = null ;
>>>>         private boolean selected    = false ;
>>>>                Group(String aName)
>>>>         {
>>>>             name = aName ;
>>>>             setSelected(aName.length() < 10) ; //
>>>> just for fun !
>>>>         }
>>>>                public String getName()
>>>>         {
>>>>             return name ;
>>>>         }
>>>>                /**
>>>>          * @return
>>>>          */
>>>>         public boolean isSelected()
>>>>         {
>>>>             return selected;
>>>>         }
>>>>
>>>>         /**
>>>>          * @param b
>>>>          */
>>>>         public void setSelected(boolean b)
>>>>         {
>>>>             selected = b;
>>>>         }
>>>>
>>>>     }
>>>>
>>>> }
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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: From newbie : how to set custom values in @Foreach @Option (in @form @select)

Posted by Harish Krishnaswamy <hk...@comcast.net>.
You could do the following.

public void formSubmit(IRequestCycle cycle)
{
    NextPage nextPage = (NextPage) cycle.getPage("Next_page") ;
    nextPage.setSelectedObjects(selectedObjects) ;
    cycle.activate(nextPage) ;
}

-Harish

Régis Piccand wrote:

> Thanks a lot for your reply.
>
> It sounded a bit confusing in the beginning, but I think I got it now.
>
> I have created my own classes for the multiple select component and 
> its renderer ... It rocks !!
>
> Just a quick question for passing selected values to the next page. 
> This is how I do it in the listener:
>
>     public void formSubmit(IRequestCycle cycle)
>     {
>         IPage nextPage = cycle.getPage("Next_page") ;
>         nextPage.setProperty("selectedObjects", selectedObjects) ;
>         cycle.activate(nextPage) ;
>     }
>
> Is that correct in the Tapestry approach ?
>
> Thanks a lot for your advices
>
> Régis
>
>
> On Thu, 23 Oct 2003 11:05:47 -0400, Howard M. Lewis Ship 
> <hl...@comcast.net> wrote:
>
>> For handling multiple selection, I would recommend using the 
>> contrib:Palette component.
>>
>> Using Select and Option, each Option will simple set or clear a 
>> boolean property; you can use this
>> (via synthetic properties) to add or remove items from a 
>> java.util.Set ... but it's a bit of code.
>> Using Palette, you get a List and a better UI (assuming Javascript is 
>> kosher for you).
>>
>> There's also a non-JavaScript contrib:MultipleSelection component 
>> that also streamlines the process
>> of selecting items.
>>
>> -- 
>> 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: news [mailto:news@sea.gmane.org] On Behalf Of Régis Piccand
>>> Sent: Thursday, October 23, 2003 5:11 AM
>>> To: tapestry-user@jakarta.apache.org
>>> Subject: From newbie : how to set custom values in @Foreach
>>> @Option (in @form @select)
>>>
>>>
>>> Hi all,
>>>
>>> I'm new to Tapestry and am trying to understand how :
>>>
>>> - forms can be dynamically filled and
>>> - parameters are passed from one page to another
>>>
>>> I'm now writing an html page containing a form, which itself
>>> contains a
>>> selection box. I can set easily the labels, but their values
>>> are numbered
>>> 0-x ... I would prefer to be able to set these value myself
>>> (value seems
>>> to be reserved keyword). Is this possible ?
>>>
>>> Assuming I then submit this form, I will want to get the parameters
>>> (values) in the new page. Where/how can I do that ?? I don't
>>> understand
>>> how I can pick up these parameters in the new page before it
>>> is rendered
>>> ... sorry :-0
>>>
>>> Thanks in advance for your help
>>>
>>> Régis
>>>
>>>
>>>
>>> Select_group.html
>>>
>>> [...]
>>> <body>
>>> <p>Ajouter des articles</p>
>>> <p>S&eacute;lectionnez des articles ci-dessous</p>
>>> <p>&nbsp;</p> <table width="75%" border="0">
>>>       <tr>
>>>         <td><form jwcid="@Form" listener="ognl:listeners.formSubmit">
>>>             <select jwcid="@Select" multiple="ognl:true">
>>>                       <span jwcid="@Foreach"
>>> source="ognl:group"
>>> value="ognl:currentGroup">
>>>                            <option
>>> jwcid="@Option" selected="ognl:currentGroup.selected"
>>> label="ognl:currentGroup.name"/>
>>>                        </span>
>>>                  </select>
>>>             <input type="submit" name="Submit" value="Submit">
>>>         </form>
>>>           <p></p></td>
>>>       </tr>
>>> </table>
>>> <p>&nbsp; </p>
>>> </body>
>>> </html>
>>>
>>>
>>>
>>> Select_group.java
>>>
>>> import java.io.Serializable;
>>> import java.util.ArrayList;
>>> import java.util.Collection;
>>>
>>> import org.apache.tapestry.IRequestCycle;
>>> import org.apache.tapestry.html.BasePage;
>>>
>>> public class Select_group extends BasePage
>>> {
>>>     private Collection     _group                 = null ;
>>>     private Group        _currentGroup        = null ;
>>>     
>>>     public void formSubmit(IRequestCycle cycle)
>>>     {
>>> // How to read the passed values from the new page ?????
>>>         cycle.activate("Select_item") ;
>>>     }
>>>     
>>>     public Collection getGroup()
>>>     {
>>>         if (_group == null)
>>>         {
>>>             _group = new ArrayList() ;
>>>             _group.add(new Group("Développement")) ;
>>>             _group.add(new Group("Intégration")) ;
>>>             _group.add(new Group("Dépannage")) ;
>>>         }
>>>        
>>>         return _group ;
>>>     }
>>>     
>>>     public Group getCurrentGroup()
>>>     {
>>>         return _currentGroup ;
>>>     }
>>>     
>>>     public void setCurrentGroup(Group aGroup)
>>>     {
>>>         _currentGroup = aGroup ;
>>>     }
>>>     
>>>     private class Group implements Serializable
>>>     {
>>>         private String     name         = null ;
>>>         private boolean selected    = false ;
>>>        
>>>         Group(String aName)
>>>         {
>>>             name = aName ;
>>>             setSelected(aName.length() < 10) ; //
>>> just for fun !
>>>         }
>>>        
>>>         public String getName()
>>>         {
>>>             return name ;
>>>         }
>>>        
>>>
>>>         /**
>>>          * @return
>>>          */
>>>         public boolean isSelected()
>>>         {
>>>             return selected;
>>>         }
>>>
>>>         /**
>>>          * @param b
>>>          */
>>>         public void setSelected(boolean b)
>>>         {
>>>             selected = b;
>>>         }
>>>
>>>     }
>>>
>>> }
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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: From newbie : how to set custom values in @Foreach @Option (in @form @select)

Posted by Régis Piccand <gm...@piccand.com>.
Thanks a lot for your reply.

It sounded a bit confusing in the beginning, but I think I got it now.

I have created my own classes for the multiple select component and its 
renderer ... It rocks !!

Just a quick question for passing selected values to the next page. This 
is how I do it in the listener:

	public void formSubmit(IRequestCycle cycle)
	{
		IPage nextPage = cycle.getPage("Next_page") ;
		nextPage.setProperty("selectedObjects", selectedObjects) ;
		cycle.activate(nextPage) ;
	}

Is that correct in the Tapestry approach ?

Thanks a lot for your advices

Régis


On Thu, 23 Oct 2003 11:05:47 -0400, Howard M. Lewis Ship 
<hl...@comcast.net> wrote:

> For handling multiple selection, I would recommend using the 
> contrib:Palette component.
>
> Using Select and Option, each Option will simple set or clear a boolean 
> property; you can use this
> (via synthetic properties) to add or remove items from a java.util.Set 
> ... but it's a bit of code.
> Using Palette, you get a List and a better UI (assuming Javascript is 
> kosher for you).
>
> There's also a non-JavaScript contrib:MultipleSelection component that 
> also streamlines the process
> of selecting items.
>
> --
> 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: news [mailto:news@sea.gmane.org] On Behalf Of Régis Piccand
>> Sent: Thursday, October 23, 2003 5:11 AM
>> To: tapestry-user@jakarta.apache.org
>> Subject: From newbie : how to set custom values in @Foreach
>> @Option (in @form @select)
>>
>>
>> Hi all,
>>
>> I'm new to Tapestry and am trying to understand how :
>>
>> - forms can be dynamically filled and
>> - parameters are passed from one page to another
>>
>> I'm now writing an html page containing a form, which itself
>> contains a
>> selection box. I can set easily the labels, but their values
>> are numbered
>> 0-x ... I would prefer to be able to set these value myself
>> (value seems
>> to be reserved keyword). Is this possible ?
>>
>> Assuming I then submit this form, I will want to get the parameters
>> (values) in the new page. Where/how can I do that ?? I don't
>> understand
>> how I can pick up these parameters in the new page before it
>> is rendered
>> ... sorry :-0
>>
>> Thanks in advance for your help
>>
>> Régis
>>
>>
>>
>> Select_group.html
>>
>> [...]
>> <body>
>> <p>Ajouter des articles</p>
>> <p>S&eacute;lectionnez des articles ci-dessous</p>
>> <p>&nbsp;</p> <table width="75%" border="0">
>>       <tr>
>>         <td><form jwcid="@Form" listener="ognl:listeners.formSubmit">
>> 	    	<select jwcid="@Select" multiple="ognl:true">
>>       				<span jwcid="@Foreach"
>> source="ognl:group"
>> value="ognl:currentGroup">
>>        					<option
>> jwcid="@Option" selected="ognl:currentGroup.selected"
>> label="ognl:currentGroup.name"/>
>>        				</span>
>>      			</select>
>> 	        <input type="submit" name="Submit" value="Submit">
>> 		</form>
>>           <p></p></td>
>>       </tr>
>> </table>
>> <p>&nbsp; </p>
>> </body>
>> </html>
>>
>>
>>
>> Select_group.java
>>
>> import java.io.Serializable;
>> import java.util.ArrayList;
>> import java.util.Collection;
>>
>> import org.apache.tapestry.IRequestCycle;
>> import org.apache.tapestry.html.BasePage;
>>
>> public class Select_group extends BasePage
>> {
>> 	private Collection 	_group 				= null ;
>> 	private Group		_currentGroup		= null ;
>> 	
>> 	public void formSubmit(IRequestCycle cycle)
>> 	{
>> // How to read the passed values from the new page ?????
>> 		cycle.activate("Select_item") ;
>> 	}
>> 	
>> 	public Collection getGroup()
>> 	{
>> 		if (_group == null)
>> 		{
>> 			_group = new ArrayList() ;
>> 			_group.add(new Group("Développement")) ;
>> 			_group.add(new Group("Intégration")) ;
>> 			_group.add(new Group("Dépannage")) ;
>> 		}
>> 		
>> 		return _group ;
>> 	}
>> 	
>> 	public Group getCurrentGroup()
>> 	{
>> 		return _currentGroup ;
>> 	}
>> 	
>> 	public void setCurrentGroup(Group aGroup)
>> 	{
>> 		_currentGroup = aGroup ;
>> 	}
>> 	
>> 	private class Group implements Serializable
>> 	{
>> 		private String 	name 		= null ;
>> 		private boolean selected	= false ;
>> 		
>> 		Group(String aName)
>> 		{
>> 			name = aName ;
>> 			setSelected(aName.length() < 10) ; //
>> just for fun !
>> 		}
>> 		
>> 		public String getName()
>> 		{
>> 			return name ;
>> 		}
>> 		
>>
>> 		/**
>> 		 * @return
>> 		 */
>> 		public boolean isSelected()
>> 		{
>> 			return selected;
>> 		}
>>
>> 		/**
>> 		 * @param b
>> 		 */
>> 		public void setSelected(boolean b)
>> 		{
>> 			selected = b;
>> 		}
>>
>> 	}
>>
>> }
>>
>>
>> ---------------------------------------------------------------------
>> 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: From newbie : how to set custom values in @Foreach @Option (in @form @select)

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
For handling multiple selection, I would recommend using the contrib:Palette component.

Using Select and Option, each Option will simple set or clear a boolean property; you can use this
(via synthetic properties) to add or remove items from a java.util.Set ... but it's a bit of code.
Using Palette, you get a List and a better UI (assuming Javascript is kosher for you).

There's also a non-JavaScript contrib:MultipleSelection component that also streamlines the process
of selecting items.

--
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: news [mailto:news@sea.gmane.org] On Behalf Of Régis Piccand
> Sent: Thursday, October 23, 2003 5:11 AM
> To: tapestry-user@jakarta.apache.org
> Subject: From newbie : how to set custom values in @Foreach 
> @Option (in @form @select)
> 
> 
> Hi all,
> 
> I'm new to Tapestry and am trying to understand how :
> 
> - forms can be dynamically filled and
> - parameters are passed from one page to another
> 
> I'm now writing an html page containing a form, which itself 
> contains a 
> selection box. I can set easily the labels, but their values 
> are numbered 
> 0-x ... I would prefer to be able to set these value myself 
> (value seems 
> to be reserved keyword). Is this possible ?
> 
> Assuming I then submit this form, I will want to get the parameters 
> (values) in the new page. Where/how can I do that ?? I don't 
> understand 
> how I can pick up these parameters in the new page before it 
> is rendered 
> ... sorry :-0
> 
> Thanks in advance for your help
> 
> Régis
> 
> 
> 
> Select_group.html
> 
> [...]
> <body>
> <p>Ajouter des articles</p>
> <p>S&eacute;lectionnez des articles ci-dessous</p> 
> <p>&nbsp;</p> <table width="75%" border="0">
>       <tr>
>         <td><form jwcid="@Form" listener="ognl:listeners.formSubmit">
> 	    	<select jwcid="@Select" multiple="ognl:true">
>       				<span jwcid="@Foreach" 
> source="ognl:group" 
> value="ognl:currentGroup">
>        					<option 
> jwcid="@Option" selected="ognl:currentGroup.selected" 
> label="ognl:currentGroup.name"/>
>        				</span>
>      			</select>
> 	        <input type="submit" name="Submit" value="Submit">
> 		</form>
>           <p></p></td>
>       </tr>
> </table>
> <p>&nbsp; </p>
> </body>
> </html>
> 
> 
> 
> Select_group.java
> 
> import java.io.Serializable;
> import java.util.ArrayList;
> import java.util.Collection;
> 
> import org.apache.tapestry.IRequestCycle;
> import org.apache.tapestry.html.BasePage;
> 
> public class Select_group extends BasePage
> {
> 	private Collection 	_group 				= null ;
> 	private Group		_currentGroup		= null ;
> 	
> 	public void formSubmit(IRequestCycle cycle)
> 	{
> // How to read the passed values from the new page ?????
> 		cycle.activate("Select_item") ;
> 	}
> 	
> 	public Collection getGroup()
> 	{
> 		if (_group == null)
> 		{
> 			_group = new ArrayList() ;
> 			_group.add(new Group("Développement")) ;
> 			_group.add(new Group("Intégration")) ;
> 			_group.add(new Group("Dépannage")) ;
> 		}
> 		
> 		return _group ;
> 	}
> 	
> 	public Group getCurrentGroup()
> 	{
> 		return _currentGroup ;
> 	}
> 	
> 	public void setCurrentGroup(Group aGroup)
> 	{
> 		_currentGroup = aGroup ;
> 	}
> 	
> 	private class Group implements Serializable
> 	{
> 		private String 	name 		= null ;
> 		private boolean selected	= false ;
> 		
> 		Group(String aName)
> 		{
> 			name = aName ;
> 			setSelected(aName.length() < 10) ; // 
> just for fun !
> 		}
> 		
> 		public String getName()
> 		{
> 			return name ;
> 		}
> 		
> 
> 		/**
> 		 * @return
> 		 */
> 		public boolean isSelected()
> 		{
> 			return selected;
> 		}
> 
> 		/**
> 		 * @param b
> 		 */
> 		public void setSelected(boolean b)
> 		{
> 			selected = b;
> 		}
> 
> 	}
> 
> }
> 
> 
> ---------------------------------------------------------------------
> 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