You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Anteneh Bayouh <ab...@gmail.com> on 2008/01/29 17:00:23 UTC

Tapestry[5] - Select Drop Down in a Grid Component

Hi Everyone,

I tried to override the jobClass row in a grid to display as a select drop
down.The following fragment code were used. 

<t:Grid  t:source="employeeList" t:row="employee"  t:model="employeeModel" >
       <t:parameter name="jobClassCell">
		 <select t:model="jobClasses" t:value="employee.jobClass"
t:context="employee.id"/>	
	</t:parameter>
</t:Grid>

It is not working! My guess is there might be a conflict between the two
models (employeeModel, which is a BeanModel, and jobClasses model, which is 
a SelectModel).

Any help?

Thank you.
-- 
View this message in context: http://www.nabble.com/Tapestry-5----Select-Drop-Down-in-a-Grid-Component-tp15162558p15162558.html
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: Tapestry[5] - Select Drop Down in a Grid Component

Posted by Anteneh Bayouh <ab...@gmail.com>.
It is working usign the following fragment code. It is to much code for
tapestry. If you have any way of doing this, Using the SelectModel object. 

Now the jobClasses is a list of a string,

public List<String> getJobClasses() {
	return employeeDao.getJobClasses();
}

public boolean getSelectedJobClass() {
         return jobClass.equals(employee.getJobClass());
}

<t:parameter name="jobClassCell">
	<select t:value="employee.jobClass" t:context="employee.id">	
		<t:loop t:source="jobClasses" t:value="jobClass">
			<t:if t:test="selectedJobClass">
				<option value="${jobClass}" selected="selected">${jobClass}</option>
				<t:parameter name="else">
					<option value="${jobClass}">${jobClass}</option>
				</t:parameter>
			</t:if>
		</t:loop>
	</select>
</t:parameter>

Thank you,

Anteneh




Anteneh Bayouh wrote:
> 
> Hi Everyone,
> 
> I tried to override the jobClass row in a grid to display as a select drop
> down.The following fragment code were used. 
> 
> <t:Grid  t:source="employeeList" t:row="employee"  t:model="employeeModel"
> >
>        <t:parameter name="jobClassCell">
> 		 <select t:model="jobClasses" t:value="employee.jobClass"
> t:context="employee.id"/>	
> 	</t:parameter>
> </t:Grid>
> 
> It is not working! My guess is there might be a conflict between the two
> models (employeeModel, which is a BeanModel, and jobClasses model, which
> is  a SelectModel).
> 
> Any help?
> 
> Thank you.
> 

-- 
View this message in context: http://www.nabble.com/Tapestry-5----Select-Drop-Down-in-a-Grid-Component-tp15162558p15165401.html
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: Tapestry[5] - Select Drop Down in a Grid Component

Posted by Anteneh Bayouh <ab...@gmail.com>.
Thanks Thiago,

jobClass is a string object which I declare and generate the getter and
setter methods on my page to iterate through the jobClasses list and provide
the options for drop down.

private String jobClass;

For the first case Exception was not happened, A blank value and blank list
on the select drop down was displayed. 

Thanks again!

Anteneh



Thiago HP wrote:
> 
> On 1/29/08, Anteneh Bayouh <ab...@gmail.com> wrote:
> 
>> It is not working! My guess is there might be a conflict between the two
>> models (employeeModel, which is a BeanModel, and jobClasses model, which
>> is
>> a SelectModel).
> 
> How exactly is it not working? Some exception? The dropdown is not
> being rendered with the appropriate value? In this last case, does
> your JobClass overrides the equals() method? If not, implement it and
> now your first code will work.
> 
> Thiago
> 
> ---------------------------------------------------------------------
> 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/Tapestry-5----Select-Drop-Down-in-a-Grid-Component-tp15162558p15166719.html
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: Tapestry[5] - Select Drop Down in a Grid Component

Posted by Thiago HP <th...@gmail.com>.
On 1/29/08, Anteneh Bayouh <ab...@gmail.com> wrote:

> It is not working! My guess is there might be a conflict between the two
> models (employeeModel, which is a BeanModel, and jobClasses model, which is
> a SelectModel).

How exactly is it not working? Some exception? The dropdown is not
being rendered with the appropriate value? In this last case, does
your JobClass overrides the equals() method? If not, implement it and
now your first code will work.

Thiago

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