InMethod grid, Hidden Field in column does not get updated

2011-11-16 Thread Warren Bell
I have an Inmethod grid with a HiddenField in a panel in a column. This 
HiddenField does not get updated after a SubmitCancelColumn is clicked. All the 
other fields get updated correctly except for the HiddenField. There is also a 
TextField in the same panel as the HiddenField, the TextField gets updated 
correctly. Here is the column code, newPriceTextField gets updated correctly 
and oldNewPriceHiddenField does not get updated:

WicketColumnAdapter newPriceColumn = new 
WicketColumnAdapter("newPriceColumnAdapter", new 
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn(new
 Model("New Price"), "newPrice"))
{


 @Override
 public Component newCell(WebMarkupContainer parent, String componentId, IModel 
rowModel)
 {
  final PriceChange priceChange = (PriceChange)rowModel.getObject();

  final TextField newPriceTextField = new TextField("newPrice", 
new PropertyModel(priceChange, "newPrice"), Double.class)
  final HiddenField oldNewPriceHiddenField = new 
HiddenField("oldNewPrice", new PropertyModel(priceChange, 
"oldNewPrice"), Double.class);

  CostNewPricePanel panel = new CostNewPricePanel(newPriceTextField, 
oldNewPriceHiddenField);
  return panel;
 }

};



Also, the "oldNewPrice" property of the oldNewPriceHiddenField does change 
after SubmitCancelColumn gets clicked.

What do I need to do to get the HiddenField to update correctly?

Thanks,

Warren Bell


-- 
This email was Virus checked by Clark's Nutrition's Astaro Security Gateway. 

The information contained in this e-mail is intended only for use of
the individual or entity named above. This e-mail, and any documents,
files, previous e-mails or other information attached to it, may contain
confidential information that is legally privileged. If you are not the
intended recipient of this e-mail, or the employee or agent responsible
for delivering it to the intended recipient, you are hereby notified
that any disclosure, dissemination, distribution, copying or other use
of this e-mail or any of the information contained in or attached to it
is strictly prohibited. If you have received this e-mail in error,
please immediately notify us by return e-mail or by telephone at
(951)321-1960, and destroy the original e-mail and its attachments
without reading or saving it in any manner. Thank you.



RE: InMethod grid, Hidden Field in column does not get updated

2011-11-18 Thread Warren Bell
Any takers, this one has me stumped. Is there anything special with how a 
HiddenField gets updated after an Ajax call. The HiddenField is in the same 
panel as a TextField. The TextField gets updated but the HiddenField does not. 
I have checked and the values have changed on the model object for both fields. 
I thought that when you add a component to the target that the component and 
all its children would get updated. I see the HiddenField coming back in the 
Ajax response, it just has the old value.

Thanks,

Warren

-Original Message-
From: Warren Bell 
Sent: Wednesday, November 16, 2011 11:04 AM
To: 'users@wicket.apache.org'
Subject: InMethod grid, Hidden Field in column does not get updated

I have an Inmethod grid with a HiddenField in a panel in a column. This 
HiddenField does not get updated after a SubmitCancelColumn is clicked. All the 
other fields get updated correctly except for the HiddenField. There is also a 
TextField in the same panel as the HiddenField, the TextField gets updated 
correctly. Here is the column code, newPriceTextField gets updated correctly 
and oldNewPriceHiddenField does not get updated:

WicketColumnAdapter newPriceColumn = new 
WicketColumnAdapter("newPriceColumnAdapter", new 
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn(new
 Model("New Price"), "newPrice")) {


 @Override
 public Component newCell(WebMarkupContainer parent, String componentId, IModel 
rowModel)  {
  final PriceChange priceChange = (PriceChange)rowModel.getObject();

  final TextField newPriceTextField = new TextField("newPrice", 
new PropertyModel(priceChange, "newPrice"), Double.class)
  final HiddenField oldNewPriceHiddenField = new 
HiddenField("oldNewPrice", new PropertyModel(priceChange, 
"oldNewPrice"), Double.class);

  CostNewPricePanel panel = new CostNewPricePanel(newPriceTextField, 
oldNewPriceHiddenField);
  return panel;
 }

};



Also, the "oldNewPrice" property of the oldNewPriceHiddenField does change 
after SubmitCancelColumn gets clicked.

What do I need to do to get the HiddenField to update correctly?

Thanks,

Warren Bell



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