ie a Page+markup that i can throw into any project and access.
-Igor
On 2/19/06,
Ali Zaid <[EMAIL PROTECTED]> wrote:
NO nested forms for sure, I'm attaching the form generated, I tried both way to inatiated the list using onBeginRequest and in constructor, but it shouldn't be a problem should it? my problem is that values don't submit at all! I do get FORM SUBMITTED!!! and I do get values which are all zeros.
<form action="" method="post" id="pnl_items:lst_items:0:row:pnl_priceRequestItems:frm_orderQuantity">
<input type="hidden" name="pnl_items:lst_items:0:row:pnl_priceRequestItems:frm_orderQuantity:hf:0" id="pnl_items:lst_items:0:row:pnl_priceRequestItems:frm_orderQuantity:hf:0"/>
<tr class="tableRow_forToolTip">
<td><span>PRI AEA3734</span></td>
<td><span>Gist Group</span></td>
<td><span>0</span></td>
<td><input value="0" type="text" size="6" name="lst_PriceRequestItems:0:requestedQuantity"/></td>
</tr>
<tr class="tableRow_forToolTip">
<td><span>PRI 3A82F4F</span></td>
<td><span>Raid Al-Nia'ami</span></td>
<td><span>0</span></td>
<td><input value="0" type="text" size="6" name="lst_PriceRequestItems:1:requestedQuantity"/></td>
</tr>
<tr class="tableRow_forToolTip">
<td><span>PRI C491231</span></td>
<td><span>Aous</span></td>
<td><span>0</span></td>
<td><input value="0" type="text" size="6" name="lst_PriceRequestItems:2:requestedQuantity"/></td>
</tr>
<tr class="tableRow_forToolTip">
<td><span>PRI 5EBCA9E</span></td>
<td><span>Time Technology</span></td>
<td><span>0</span></td>
<td><input value="0" type="text" size="6" name="lst_PriceRequestItems:3:requestedQuantity"/></td>
</tr>
<tr class="tableRow_forToolTip">
<td><span>PRI AAF9121</span></td>
<td><span>Haider Zaid</span></td>
<td><span>0</span></td>
<td><input value="0" type="text" size="6" name="lst_PriceRequestItems:4:requestedQuantity"/></td>
</tr>
<tr class="tableRow_forToolTip">
<td><span>PRI 13B6700</span></td>
<td><span>Ali Zaid</span></td>
<td><span>0</span></td>
<td><input value="0" type="text" size="6" name="lst_PriceRequestItems:5:requestedQuantity"/></td>
</tr>
<tr class="tableRow_forToolTip">
<td><span>PRI A5CD697</span></td>
<td><span>Mohammed Jassim</span></td>
<td><span>0</span></td>
<td><input value="0" type="text" size="6" name="lst_PriceRequestItems:6:requestedQuantity"/></td>
</tr>
<tr class="tableRow_forToolTip">
<td><span>PRI 7829AC0</span></td>
<td><span>Smart Systems</span></td>
<td><span>0</span></td>
<td><input value="0" type="text" size="6" name="lst_PriceRequestItems:7:requestedQuantity"/></td>
</tr>
<input name="" type="submit" value="Submit" />
</form>--
On 2/19/06, Matej Knopp <[EMAIL PROTECTED]> wrote:Do you mean that the values you enter to the form aren't preserved?
Well, you reload the list of items on every request
(onBeginRequest()). So they can't be preserved. Instead, try to lead
the list only once (in page constructor). That might help.
-Matej
On 2/19/06, Ali Zaid <[EMAIL PROTECTED]> wrote:
> Guys, PLEASE! PLEASE! PLEASE!!!! tell me why on earth this is not working,
> the values don't update, It's extreemly Urgent, and I would really
> appreciate your help here.
>
>
> package com.yakhdor.application;
>
> import java.util.ArrayList;
> import java.util.List;
>
> import wicket.markup.html.basic.Label ;
> import wicket.markup.html.form.Form;
> import wicket.markup.html.form.TextField;
> import wicket.markup.html.list.ListItem;
> import wicket.markup.html.list.ListView;
> import wicket.markup.html.panel.Panel ;
> import wicket.model.CompoundPropertyModel;
> import wicket.model.IModel;
> import wicket.model.PropertyModel;
>
> import com.yakhdor.businessLogic.OfferItem ;
> import com.yakhdor.businessLogic.PriceRequestItem ;
> import com.yakhdor.database.PriceRequestItemDAO;
>
> public class OfferItemView_PriceRequestItems_Panel extends
> Panel {
>
> private UserSession session = (UserSession) getSession();
>
> private List priceRequestItemsList = new ArrayList();
>
> private ListView lst_items;
>
> public OfferItemView_PriceRequestItems_Panel(String id,
> IModel model) {
> super(id, model);
> init();
> }
>
> @Override
> protected void onBeginRequest() {
> OfferItem OfferItem = (OfferItem) getModelObject();
> priceRequestItemsList =
> PriceRequestItemDAO.getListByRfqItem
> (OfferItem.getRfqItem());
> lst_items.modelChanged();
> }
>
> private void init()
> {
>
> Form frm_orderQuantity = new Form("frm_orderQuantity") {
> @Override
> protected void onSubmit() {
> // TODO Auto-generated method stub
> System.out.println("FORM SUBMITTED!!!!!!!!");
> super.onSubmit();
>
> for (PriceRequestItem item : getPriceRequestItemsList()) {
> System.out.println(item.getRequestedQuantity());
> }
> }
> };
> frm_orderQuantity.setModel(new
> PropertyModel(this,"priceRequestItemsList"));
>
> lst_items = new ListView("lst_PriceRequestItems",
> new PropertyModel(this,"priceRequestItemsList"))
> {
>
> protected IModel getListItemModel(final IModel listViewModel,
> final int index)
> {
> return new
> CompoundPropertyModel(super.getListItemModel(listViewModel, index));
> }
>
> @Override
> protected void populateItem(ListItem item) {
>
> item.add(new Label("priceRequestItemID"));
> item.add(new Label(" priceRequest.supplier.name "));
> item.add(new Label("price"));
> item.add(new
> TextField("requestedQuantity"));
>
> }
> };
> lst_items.setOptimizeItemRemoval(true);
> frm_orderQuantity.add(lst_items);
>
> add(frm_orderQuantity);
>
> }
>
> public List
> <PriceRequestItem>getPriceRequestItemsList() {
> return priceRequestItemsList;
> }
>
> }
>
>
> What am I doing wrong ( I used wicket 1.2 (12 Feb) but I also try several
> other builds)
>
> PLEASE help me get over this tonight or I'm dead :(
>
> --
> Regards, Ali
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Regards, Ali
