You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by vinitty <vi...@gmail.com> on 2012/08/05 10:14:20 UTC

Values got lost from Property model or compound property model on ajax call

Please help me 
i have page and using compound property model i am showing the values 
on clicking ajax link values got lost from the model




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Values-got-lost-from-Property-model-or-compound-property-model-on-ajax-call-tp4651001.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: Values got lost from Property model or compound property model on ajax call

Posted by rajasri <ra...@gmail.com>.
Use AjaxSubmitLink instead of AjaxLink..



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Values-got-lost-from-Property-model-or-compound-property-model-on-ajax-call-tp4651001p4653265.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: Values got lost from Property model or compound property model on ajax call

Posted by Sven Meier <sv...@meiers.net>.
How does getShoppingCart() look like?

You're probably switching the shopping cart instance *after* you've 
created the CompoundPropertyModel.

Sven

On 08/05/2012 08:33 PM, vinitty wrote:
> I can not paste the exact code but i am putting replica of that code
>
> public class BillingAddressPanel extends Panel   {
>
> public BillingAddressPanel()
> {
>   final CompoundPropertyModel<hoppingCart> model =  new
> CompoundPropertyModel<ShoppingCart>(getShoppingCart());
>      // use CompoundPropertyModel.
>      setDefaultModel(model);
>
>      add(new Label(WKT_FIRST_NAME).setEscapeModelStrings(false));
>      add(new Label(WKT_LAST_NAME).setEscapeModelStrings(false));
>      add(new Label(KEY_BILLADDR_COMPANY).setEscapeModelStrings(false));
>      add(new Label(WKT_ADDRESS_ONE).setEscapeModelStrings(false));
>      add(new Label(WKT_ADDRESS_TWO).setEscapeModelStrings(false));
>      add(new Label(KEY_BILLADDR_APT_SUITE).setEscapeModelStrings(false));
>      add(new Label(WKT_CITY).setEscapeModelStrings(false));
>      add(new Label(KEY_BILLADDR_STATE).setEscapeModelStrings(false));
> 	
> 	add(new AjaxLink(){
> 	@Override
>      public void onClick(AjaxRequestTarget target) {
>          logger.debug("[CompleteOrderLink] [onClick] Starts ");
>
>          WebRequest  webRequest  = (WebRequest)
> RequestCycle.get().getRequest();
>          WebResponse webResponse = (WebResponse)
> RequestCycle.get().getResponse();
>           
> 		Here I am not able to get the value from ShoppingCart.getFirstName, last
> Name , all values got blank
>
> 	}
> 	})
>
> 	
> }
>
>
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Values-got-lost-from-Property-model-or-compound-property-model-on-ajax-call-tp4651001p4651004.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: Values got lost from Property model or compound property model on ajax call

Posted by vinitty <vi...@gmail.com>.
I can not paste the exact code but i am putting replica of that code 

public class BillingAddressPanel extends Panel   {

public BillingAddressPanel() 
{
 final CompoundPropertyModel<hoppingCart> model =  new
CompoundPropertyModel<ShoppingCart>(getShoppingCart());
    // use CompoundPropertyModel.
    setDefaultModel(model);

    add(new Label(WKT_FIRST_NAME).setEscapeModelStrings(false));
    add(new Label(WKT_LAST_NAME).setEscapeModelStrings(false));
    add(new Label(KEY_BILLADDR_COMPANY).setEscapeModelStrings(false));
    add(new Label(WKT_ADDRESS_ONE).setEscapeModelStrings(false));
    add(new Label(WKT_ADDRESS_TWO).setEscapeModelStrings(false));
    add(new Label(KEY_BILLADDR_APT_SUITE).setEscapeModelStrings(false));
    add(new Label(WKT_CITY).setEscapeModelStrings(false));
    add(new Label(KEY_BILLADDR_STATE).setEscapeModelStrings(false));
	
	add(new AjaxLink(){
	@Override
    public void onClick(AjaxRequestTarget target) {
        logger.debug("[CompleteOrderLink] [onClick] Starts ");

        WebRequest  webRequest  = (WebRequest)
RequestCycle.get().getRequest();
        WebResponse webResponse = (WebResponse)
RequestCycle.get().getResponse();
         
		Here I am not able to get the value from ShoppingCart.getFirstName, last
Name , all values got blank

	}
	})

	
}






--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Values-got-lost-from-Property-model-or-compound-property-model-on-ajax-call-tp4651001p4651004.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: Values got lost from Property model or compound property model on ajax call

Posted by Andrea Del Bene <an...@gmail.com>.
Hi,

can you provide some more details? Can you attach the code of ajax link?
> Please help me
> i have page and using compound property model i am showing the values
> on clicking ajax link values got lost from the model
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Values-got-lost-from-Property-model-or-compound-property-model-on-ajax-call-tp4651001.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