You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by ramlael <gr...@gmail.com> on 2012/06/14 17:45:40 UTC

CompoundPropertyModel problem.. the values are not refreshing

Below are my files 

HTML 
<input type="text" id="firstName" name="firstName" wicket:id="firstName" 
value="" size="20" maxlength="10" />  
 <input type="text" id="lastName" name="lastName" wicket:id="lastName" 
value="" size="20" maxlength="20" />

Bean 
Customer.java  - getters/setters for firstName and lastname 

Component.java  - On URL getting the firstname and lastNames as page
parameters 
Customer customer = new Customer(); 
CompoundPropertyModel<Customer > compoundPropertyModel = new
CompoundPropertyModel<Customer >(customer ); 
                final Form<?> addCardForm= new
Form<CreditCard>("addCardForm",compoundPropertyModel); 

customer.setFirstName(parameters.get("firstName").toString()); 
customer.setLastName(parameters.get("lastName").toString()); 

final TextField firstName = new TextField("firstName"); 
                final TextField lastName = new TextField("lastName"); 
addCardForm.add(firstName ); 
addCardForm.add(lastName); 
add(addCardForm); 


Here the Problems: 

1) Once I load the file with URL :
localhost:8080/addcard?firstName=ram&lastName=babu, the first name and last
name displaying fine but if I change the firstName and lastName in same
browser URL like localhost:8080/addcard?firstName=ravi&lastName=suri, the
old values(ram,babu) only displaying in form fields(First Name and Last
Name) 

2) The form has AjaxSubmitLink- once I load the page with ram and babu,
changed the first name ram to raj, and clicked submit button. if the page
has any error the error message is writing to feed back panel but the First
name is changing to old value that is ram..... 

Is It problem with CompoundPropertyModel or cache probelm.. please suggest
me the solution.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CompoundPropertyModel-problem-the-values-are-not-refreshing-tp4649987.html
Sent from the Users forum 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: CompoundPropertyModel problem.. the values are not refreshing

Posted by ramlael <gr...@gmail.com>.
Wicket 1.5

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CompoundPropertyModel-problem-the-values-are-not-refreshing-tp4649987p4649999.html
Sent from the Users forum 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: CompoundPropertyModel problem.. the values are not refreshing

Posted by Sven Meier <sv...@meiers.net>.
What Wicket version?

BTW a quickstart would enable us to help you.

Sven

On 06/14/2012 05:45 PM, ramlael wrote:
> Below are my files
>
> HTML
> <input type="text" id="firstName" name="firstName" wicket:id="firstName"
> value="" size="20" maxlength="10" />
>   <input type="text" id="lastName" name="lastName" wicket:id="lastName"
> value="" size="20" maxlength="20" />
>
> Bean
> Customer.java  - getters/setters for firstName and lastname
>
> Component.java  - On URL getting the firstname and lastNames as page
> parameters
> Customer customer = new Customer();
> CompoundPropertyModel<Customer>  compoundPropertyModel = new
> CompoundPropertyModel<Customer>(customer );
>                  final Form<?>  addCardForm= new
> Form<CreditCard>("addCardForm",compoundPropertyModel);
>
> customer.setFirstName(parameters.get("firstName").toString());
> customer.setLastName(parameters.get("lastName").toString());
>
> final TextField firstName = new TextField("firstName");
>                  final TextField lastName = new TextField("lastName");
> addCardForm.add(firstName );
> addCardForm.add(lastName);
> add(addCardForm);
>
>
> Here the Problems:
>
> 1) Once I load the file with URL :
> localhost:8080/addcard?firstName=ram&lastName=babu, the first name and last
> name displaying fine but if I change the firstName and lastName in same
> browser URL like localhost:8080/addcard?firstName=ravi&lastName=suri, the
> old values(ram,babu) only displaying in form fields(First Name and Last
> Name)
>
> 2) The form has AjaxSubmitLink- once I load the page with ram and babu,
> changed the first name ram to raj, and clicked submit button. if the page
> has any error the error message is writing to feed back panel but the First
> name is changing to old value that is ram.....
>
> Is It problem with CompoundPropertyModel or cache probelm.. please suggest
> me the solution.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/CompoundPropertyModel-problem-the-values-are-not-refreshing-tp4649987.html
> Sent from the Users forum 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: CompoundPropertyModel problem.. the values are not refreshing

Posted by ramlael <gr...@gmail.com>.
1) In form have 2 text fields, 1) First Name and 2) Last Name. On page load
populating the values with request parameters like
https:localhost:8080/addcard?firstName=ram&lastName=babu.  after loading the
page with first name and last name field, modified the first name text field
with "raj" , clicked submit button. got the error on page ( have some
mandatory fields in the page) and displayed the error on feed back panel but
the first name text field changed to old value (ram). it should be raj... 


2) after loading the page with    url
https:localhost:8080/addcard?firstName=ram&lastName=babu . I have changed
the URL like https:localhost:8080/addcard?firstName=ravi&lastName=babu in
same browser and clicked enter but the first name text field value
populating with old value ram not with ravi.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CompoundPropertyModel-problem-the-values-are-not-refreshing-tp4649987p4649993.html
Sent from the Users forum 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: CompoundPropertyModel problem.. the values are not refreshing

Posted by Thomas Götz <to...@decoded.de>.
Could you please provide a Quickstart that describes your problem? This will make it much easier for us to help you.

   -Tom


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