Re: Panel re-rendered twice, when the data is pulled in.

2010-06-28 Thread jammyjohn

Ed,

Thank you so much for the reply. Could you please send me the link to the
working example. I would like to compare with the one I have.

Btw, thanks for pointing out the improper usage of table fragment as
panel. I have modified to div

Appreciate your help in this regard.

J.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Panel-re-rendered-twice-when-the-data-is-fetched-tp2268924p2271215.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Panel re-rendered twice, when the data is pulled in.

2010-06-25 Thread jammyjohn
/td   
/tr/table

/form
/body
/html

Thanks
J
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Panel-re-rendered-twice-when-the-data-is-pulled-in-tp2268924p2268924.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: Panel re-rendered twice, when the data is pulled in.

2010-06-25 Thread Edward Zarecor
I believe the cause -- and I've reproduced locally -- is this HTML:

 tr
wicket:id=shipperAddressPanel/tr

Don't dump content into the tr

Try changing this to

tr
td
div wicket:id=shipperAddressPanel/
/td
/tr

And see if it fixes the issue.

Ed.



On Fri, Jun 25, 2010 at 4:37 PM, jammyjohn jchinnas...@yahoo.com wrote:

 Hi,

 The page loads address panel with couple of text fields . When the search is
 made for a particular address id, the address panel is rendered twice (one
 panel with the data, the second panel without the data). Not sure  how to
 avoid re-rendering of panel twice,

 setResponsePage(getPage()) can be a solution, but I dont want the whole page
 to be refreshed as I am using 4 panels in my page.

 The code is as below. Not sure if there is a problem in the way the markup
 is structured.  Appreciate your help in this regard.

 /AddressPanel.html***/

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

 html xmlns=http://www.w3.org/1999/xhtml;
 xmlns:wicket=http://wicket.sourceforge.net/; xml:lang=en     lang=en
        body
                wicket:panel
                                        tr
                                                thAdr1:/th
                                                td align=leftinput 
 type='text' wicket:id=address size='30'
 maxlength='45'//td
                                        /tr
                                        tr
                                                th  align='right'Adr2:/th
                                                td  align=leftinput 
 type='text' wicket:id=address2 size='30'
 maxlength='45'//td
                                        /tr
                 /wicket:panel
        /body
 /html

 /AddressPanel.java***/

 public class AddressPanel extends Panel {

        public AddressPanel(String id, IModel model) {
            super(id);

           setDefaultModel(new CompoundPropertyModel(model));
            add(new RequiredTextField(address));
            add(new
 TextField(address2).setConvertEmptyInputStringToNull(false));
    }

 }

 /* java file that instantiates the panel */

 final  Panel shipAddressPanel = new AddressPanel(shipperAddressPanel, new
 Model(address.getShipAddress()));
                shipAddressPanel.setOutputMarkupId(true);
                mawbForm.add(shipAddressPanel);

                add(mawbForm);

 final TextField shipIdTf =  new TextField(shipperId, new
 PropertyModel(dtomodel, shipperId));
                shipIdTf.setOutputMarkupId(true);
                mawbForm.add(shipIdTf);


                shipIdTf.add(new AjaxFormComponentUpdatingBehavior(onBlur){
                        private static final long serialVersionUID = 1L;
                       �...@override
                        protected void onUpdate(AjaxRequestTarget target) {
                                Shipper shipper=
 shipDao.loadShipAddress(Long.parseLong(shipIdTf.getDefaultModelObjectAsString()))
                                Address address = new Address();
                                address.setShipAddress(shipper);
                                
 shipAddressPanel.setDefaultModelObject(address.getShipAddress());
                                target.addComponent(shipAddressPanel);
                        }

        });






 /* the template that calls the panel ***/

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;

 html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
 head/head
 body

 form wicket:id=form
 tabletr
 td valign='top' style=width:8em;height:15em;
                                                        table width='100%' 
 border='1' cellpadding='1' cellspacing=''
                                                tbody
                                                tr
                                                                td 
 class='instrLabelColor' colspan=2
 align='center'SHIP From:
                                                                        input 
 type='text' wicket:id=shipperId /
                                                                 /td

                                                         /tr
                                                        tr 
 wicket:id=shipperAddressPanel/tr
                                                /tbody
                                                /table
                                        /td
                                        /tr/table

 /form
 /body
 /html

 Thanks
 J
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Panel-re-rendered-twice-when-the-data-is-pulled-in-tp2268924p2268924.html
 Sent from the Wicket - User mailing list archive at Nabble.com

Re: Panel re-rendered twice, when the data is pulled in.

2010-06-25 Thread jammyjohn

Ed,

Thanks for your reply. I already tried this. But still the problem exists.
:(

setResponsePage(getPage(this)) seems to be the work around for this issue.
But the problem is, the other inputfields that have values on this page are
lost when the panel is re-rendered.

I am not sure how to solve this issue. 

Thanks
J.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Panel-re-rendered-twice-when-the-data-is-fetched-tp2268924p2268991.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: Panel re-rendered twice, when the data is pulled in.

2010-06-25 Thread Edward Zarecor
Hmm, I took a working example that replaces a panel using an AJAX link
and altered the HTML to match what you have and, hey presto, after
clicking the link I have two versions of the panel content.  Reload
and I have one again.

I don't have the code in front of me, but I'll take a look again
tomorrow at what precisely is happening.

You should look at the HTML after the AJAX link has been clicked to
try to determine what is happening to the DOM.

In any event, I think table fragment as panel is a bad idea.

Ed.

On Fri, Jun 25, 2010 at 5:36 PM, jammyjohn jchinnas...@yahoo.com wrote:

 Ed,

 Thanks for your reply. I already tried this. But still the problem exists.
 :(

 setResponsePage(getPage(this)) seems to be the work around for this issue.
 But the problem is, the other inputfields that have values on this page are
 lost when the panel is re-rendered.

 I am not sure how to solve this issue.

 Thanks
 J.
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Panel-re-rendered-twice-when-the-data-is-fetched-tp2268924p2268991.html
 Sent from the Wicket - User mailing list archive at Nabble.com.

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



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