Heyvaert / wiquery

Automatically exported from code.google.com/p/wiquery
0 stars 0 forks source link

Component com.cerebrum.pages.ShowCalculator$ShowCalculatorForm$2 has been added to the target. This component is a repeater and cannot be repainted via ajax directly. Instead add its parent or another markup container higher in the hierarchy. #239

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.listViewCal=new ListView("listViewCal",listCal) 
            {
                protected void populateItem(ListItem item) 
                {
                    showCalculatorModel=(ShowCalculatorModel) item.getDefaultModelObject();

                    TextField txtPremiumCE = new TextField("txtPremiumCE",new PropertyModel(showCalculatorModel, "txtPremiumCE"));
                    item.add(txtPremiumCE);

                    TextField txtIntrinsicValueCE = new TextField("txtIntrinsicValueCE",new PropertyModel(showCalculatorModel, "txtIntrinsicValueCE"));
                    item.add(txtIntrinsicValueCE);

                    TextField txtTimeValueCE = new TextField("txtTimeValueCE",new PropertyModel(showCalculatorModel, "txtTimeValueCE"));
                    item.add(txtTimeValueCE);

                    TextField txtTimevalInPerCE = new TextField("txtTimevalInPerCE",new PropertyModel(showCalculatorModel, "txtTimevalInPerCE"));
                    item.add(txtTimevalInPerCE);

                    TextField txtLtpPriceCE = new TextField("txtLtpPriceCE",new PropertyModel(showCalculatorModel, "txtLtpPriceCE"));
                    item.add(txtLtpPriceCE);

                    TextField txtStrikePrice = new TextField("txtStrikePrice",new PropertyModel(showCalculatorModel, "txtStrikePrice"));
                    item.add(txtStrikePrice);

                    TextField txtLtpValuePE = new TextField("txtLtpValuePE",new PropertyModel(showCalculatorModel, "txtLtpValuePE"));
                    item.add(txtLtpValuePE);

                    TextField txtIntrinsicValuePE = new TextField("txtIntrinsicValuePE",new PropertyModel(showCalculatorModel, "txtIntrinsicValuePE"));
                    item.add(txtIntrinsicValuePE);

                    TextField txtTimeValuePE = new TextField("txtTimeValuePE",new PropertyModel(showCalculatorModel, "txtTimeValuePE"));
                    item.add(txtTimeValuePE);

                    TextField txtTimeValueInPerPE = new TextField("txtTimeValueInPerPE",new PropertyModel(showCalculatorModel, "txtTimeValueInPerPE"));
                    item.add(txtTimeValueInPerPE);

                    TextField txtPremiumPE = new TextField("txtPremiumPE",new PropertyModel(showCalculatorModel, "txtPremiumPE"));
                    item.add(txtPremiumPE);
                }
            };
            listViewCal.setOutputMarkupId(true);

            add(listViewCal);

            AjaxButton btnGetCalData=new AjaxButton("btnGetCalData")
            {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> arg1) {

                    //System.out.println("-------------------------------"+ showCalculatorModel.getDropDownExpiryDate());
                    String selectedSymbol=showCalculatorModel.getTxtsymbol();
                    List lstCalReadExecl=showCalculatorHome.getAll("2011-09-29 00:00:00","NIFTY");
                    for(Iterator iterator=lstCalReadExecl.iterator();iterator.hasNext();)
                    {
                        Object [] obj=(Object[])iterator.next();
                        listCal.add(new ShowCalculatorModel(new Double(obj[0].toString()),obj[1].toString(),obj[2].toString(),new Double(obj[3].toString()),obj[4].toString(),new Double(obj[5].toString())));
                    }
                    target.addComponent(listViewCal);
                }
            };
            add(btnGetCalData);

2.
3.

What is the expected output? What do you see instead?

getAll() returns all table values which i want to show on my page....
but it gives Error....
Component com.cerebrum.pages.ShowCalculator$ShowCalculatorForm$2 has been added 
to the target. This component is a repeater and cannot be repainted via ajax 
directly. Instead add its parent or another markup container higher in the 
hierarchy.

Original issue reported on code.google.com by ajit.khu...@gmail.com on 12 Mar 2012 at 8:23

GoogleCodeExporter commented 9 years ago
do as the error says and you will be fine.

wrap a WebMarkupcontainer around the listview, call setOutputMarkupId(true) on 
it and use that to add to the AjaxRequestTarget.

Original comment by hielke.hoeve on 29 Mar 2012 at 7:17

GoogleCodeExporter commented 9 years ago
thanxxxx a lot

Original comment by ajit.khu...@gmail.com on 30 Mar 2012 at 4:29

GoogleCodeExporter commented 9 years ago

Original comment by hielke.hoeve on 22 May 2012 at 7:43