You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by wch2001 <wc...@hotmail.com> on 2008/12/29 10:46:02 UTC

how Checkbox can be showed with "checked" when it value is matched?

Dear all,

CheckBox checkBoxPersonReceiveEmailOnDeals = new
CheckBox("personItem.personReceiveEmailOnDeals", new PropertyModel(this,
"personItem.personReceiveEmailOnDeals")) ;

Now personItem.personReceiveEmailOnDeals is true. but it also show it is not
"checked", how can i do ?

Thank you for your help


-- 
View this message in context: http://www.nabble.com/how-Checkbox-can-be-showed-with-%22checked%22-when-it-value-is-matched--tp21200883p21200883.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: how Checkbox can be showed with "checked" when it value is matched?

Posted by Dipu <di...@googlemail.com>.
it works for me, if its not working for you show the list your code or
attach a quickstart.

Regards
Dipu



On Tue, Dec 30, 2008 at 1:08 AM, wch2001 <wc...@hotmail.com> wrote:
>
> Thank you a lot
>
> CheckBox("personItem.personReceiveEmailOnDeals", new
> PropertyModel<Boolean>(this,"personItem.personReceiveEmailOnDeals"));
>
> it can not work, can we use PropertyModel<Boolean> ?
>
> thanks
>
>
>
> Dipu-3 wrote:
>>
>> why is it not working ? I tried and its working
>>
>> public class TestPage extends WebPage
>> {
>>
>>       private PersonItem personItem = new PersonItem();
>>
>>
>>       public TestPage()
>>       {
>>
>>               Form<Void> form = new Form<Void>("inform");
>>               add(form);
>>
>>               CheckBox checkBoxPersonReceiveEmailOnDeals = new
>>               CheckBox("personItem.personReceiveEmailOnDeals", new
>> PropertyModel<Boolean>(this,"personItem.personReceiveEmailOnDeals"));
>>               form.add(checkBoxPersonReceiveEmailOnDeals);
>>
>>       }
>>
>>       private class PersonItem
>>       {
>>               private boolean personReceiveEmailOnDeals = true;
>>
>>               public boolean isPersonReceiveEmailOnDeals() {
>>                       return personReceiveEmailOnDeals;
>>               }
>>
>>               public void setPersonReceiveEmailOnDeals(boolean
>> personReceiveEmailOnDeals) {
>>                       this.personReceiveEmailOnDeals = personReceiveEmailOnDeals;
>>               }
>>       }
>> }
>>
>>
>> Regards
>> Dipu
>>
>> On Mon, Dec 29, 2008 at 9:46 AM, wch2001 <wc...@hotmail.com> wrote:
>>>
>>> Dear all,
>>>
>>> CheckBox checkBoxPersonReceiveEmailOnDeals = new
>>> CheckBox("personItem.personReceiveEmailOnDeals", new PropertyModel(this,
>>> "personItem.personReceiveEmailOnDeals")) ;
>>>
>>> Now personItem.personReceiveEmailOnDeals is true. but it also show it is
>>> not
>>> "checked", how can i do ?
>>>
>>> Thank you for your help
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/how-Checkbox-can-be-showed-with-%22checked%22-when-it-value-is-matched--tp21200883p21200883.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/how-Checkbox-can-be-showed-with-%22checked%22-when-it-value-is-matched--tp21200883p21211764.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: how Checkbox can be showed with "checked" when it value is matched?

Posted by wch2001 <wc...@hotmail.com>.
Thank you a lot

CheckBox("personItem.personReceiveEmailOnDeals", new
PropertyModel<Boolean>(this,"personItem.personReceiveEmailOnDeals")); 

it can not work, can we use PropertyModel<Boolean> ?

thanks



Dipu-3 wrote:
> 
> why is it not working ? I tried and its working
> 
> public class TestPage extends WebPage
> {
> 	
> 	private PersonItem personItem = new PersonItem();
> 	
> 	
> 	public TestPage()
> 	{
> 				
> 		Form<Void> form = new Form<Void>("inform");
> 		add(form);
> 		
> 		CheckBox checkBoxPersonReceiveEmailOnDeals = new
> 		CheckBox("personItem.personReceiveEmailOnDeals", new
> PropertyModel<Boolean>(this,"personItem.personReceiveEmailOnDeals"));
> 		form.add(checkBoxPersonReceiveEmailOnDeals);
> 
> 	}
> 	
> 	private class PersonItem
> 	{
> 		private boolean personReceiveEmailOnDeals = true;
> 
> 		public boolean isPersonReceiveEmailOnDeals() {
> 			return personReceiveEmailOnDeals;
> 		}
> 
> 		public void setPersonReceiveEmailOnDeals(boolean
> personReceiveEmailOnDeals) {
> 			this.personReceiveEmailOnDeals = personReceiveEmailOnDeals;
> 		}		
> 	}
> }
> 
> 
> Regards
> Dipu
> 
> On Mon, Dec 29, 2008 at 9:46 AM, wch2001 <wc...@hotmail.com> wrote:
>>
>> Dear all,
>>
>> CheckBox checkBoxPersonReceiveEmailOnDeals = new
>> CheckBox("personItem.personReceiveEmailOnDeals", new PropertyModel(this,
>> "personItem.personReceiveEmailOnDeals")) ;
>>
>> Now personItem.personReceiveEmailOnDeals is true. but it also show it is
>> not
>> "checked", how can i do ?
>>
>> Thank you for your help
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/how-Checkbox-can-be-showed-with-%22checked%22-when-it-value-is-matched--tp21200883p21200883.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/how-Checkbox-can-be-showed-with-%22checked%22-when-it-value-is-matched--tp21200883p21211764.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: how Checkbox can be showed with "checked" when it value is matched?

Posted by Dipu <di...@googlemail.com>.
why is it not working ? I tried and its working

public class TestPage extends WebPage
{
	
	private PersonItem personItem = new PersonItem();
	
	
	public TestPage()
	{
				
		Form<Void> form = new Form<Void>("inform");
		add(form);
		
		CheckBox checkBoxPersonReceiveEmailOnDeals = new
		CheckBox("personItem.personReceiveEmailOnDeals", new
PropertyModel<Boolean>(this,"personItem.personReceiveEmailOnDeals"));
		form.add(checkBoxPersonReceiveEmailOnDeals);

	}
	
	private class PersonItem
	{
		private boolean personReceiveEmailOnDeals = true;

		public boolean isPersonReceiveEmailOnDeals() {
			return personReceiveEmailOnDeals;
		}

		public void setPersonReceiveEmailOnDeals(boolean personReceiveEmailOnDeals) {
			this.personReceiveEmailOnDeals = personReceiveEmailOnDeals;
		}		
	}
}


Regards
Dipu

On Mon, Dec 29, 2008 at 9:46 AM, wch2001 <wc...@hotmail.com> wrote:
>
> Dear all,
>
> CheckBox checkBoxPersonReceiveEmailOnDeals = new
> CheckBox("personItem.personReceiveEmailOnDeals", new PropertyModel(this,
> "personItem.personReceiveEmailOnDeals")) ;
>
> Now personItem.personReceiveEmailOnDeals is true. but it also show it is not
> "checked", how can i do ?
>
> Thank you for your help
>
>
> --
> View this message in context: http://www.nabble.com/how-Checkbox-can-be-showed-with-%22checked%22-when-it-value-is-matched--tp21200883p21200883.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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