Re: Using WicketTester to verify table content refreshed by AJAX event
Hello, I decided to take another look at this problem and noticed that AJAX-based refreshing of a page with a DataView changes the path of the DataView's first element. For example, when the page is first rendered, the path of the first row in the DataView is "referrals:1". After the DataView is refreshed using AJAX the path of the first row changes to "referrals:2". The path continues to change as DataView is refreshed over and over again. This is the reason why in my original post verification in step 2 (before ajax refresh) passes and the same verification in step 4 (after ajax refresh) fails. I can fix step 4 by verifying the step of "referrals:2" element. The fragility of wicket path seems to be a known problem and some people recommended using a visitor to verify the state of component's children instead of relying on the wicket path. Any other options I should consider for this? Thanks On Wed, Sep 22, 2010 at 10:43 AM, Alec Swan wrote: > Well, the table gets correctly refreshed through an AJAX event, it's just > that WicketTester can't find any rows in the table after that. > > Is this a known WicketTester bug? > > > On Wed, Sep 22, 2010 at 12:41 AM, Wilhelmsen Tor Iver > wrote: > >> > I remember reading somewhere that using AJAX to refresh a component >> > generated using "repeater" may cause some problems. Is this what I am >> > against here with WicketTester? (Keep in mind that the table does get >> > refreshed correctly in production.) >> >> Repeaters are special in the sense that they take their markup and >> repeatedly use it, thus there is not one "repeater" element in the DOM. To >> use a repeater with Ajax you need to wrap it in e.g. a WebMarkupContainer >> and then repaint that with Ajax. >> >> - Tor Iver >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >
Re: Using WicketTester to verify table content refreshed by AJAX event
Well, the table gets correctly refreshed through an AJAX event, it's just that WicketTester can't find any rows in the table after that. Is this a known WicketTester bug? On Wed, Sep 22, 2010 at 12:41 AM, Wilhelmsen Tor Iver wrote: > > I remember reading somewhere that using AJAX to refresh a component > > generated using "repeater" may cause some problems. Is this what I am > > against here with WicketTester? (Keep in mind that the table does get > > refreshed correctly in production.) > > Repeaters are special in the sense that they take their markup and > repeatedly use it, thus there is not one "repeater" element in the DOM. To > use a repeater with Ajax you need to wrap it in e.g. a WebMarkupContainer > and then repaint that with Ajax. > > - Tor Iver > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
SV: Using WicketTester to verify table content refreshed by AJAX event
> I remember reading somewhere that using AJAX to refresh a component > generated using "repeater" may cause some problems. Is this what I am > against here with WicketTester? (Keep in mind that the table does get > refreshed correctly in production.) Repeaters are special in the sense that they take their markup and repeatedly use it, thus there is not one "repeater" element in the DOM. To use a repeater with Ajax you need to wrap it in e.g. a WebMarkupContainer and then repaint that with Ajax. - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Using WicketTester to verify table content refreshed by AJAX event
2010/9/21 Alec Swan > Any thoughts on this? > > I remember reading somewhere that using AJAX to refresh a component > generated using "repeater" may cause some problems. Is this what I am > against here with WicketTester? (Keep in mind that the table does get > refreshed correctly in production.) > > Thanks > > On Mon, Sep 20, 2010 at 6:24 PM, Alec Swan wrote: > > > Hello, > > > > I have a page which contains a DropDownChoice menu and a table. The > > menu has AjaxFormComponentUpdatingBehavior which causes the table to > > refresh. The page is actually working correctly, but I am having > > problems with a test. > > > > The test does the following: > > 1. Renders the page > > 2. Verifies that the first table row has the right data using > > tester.getComponentFromLastRenderedPage("referralsForm:referrals:1") > > 3, Selects an item in the menu and calls executeAjaxEvent(menuId, > > "onchange") > > 4. Verifies that the first row of the table contains the right data > > the same way step 2 does > > > > The last step fails indicating that "referralsForm:referrals:1" does > > not exist. However, "referralsForm:referrals" exists and its model > > data contains the rows I expect it to contain. > > > > What am I doing wrong? > > > > Thanks > > >
Re: Using WicketTester to verify table content refreshed by AJAX event
Any thoughts on this? I remember reading somewhere that using AJAX to refresh a component generated using "repeater" may cause some problems. Is this what I am against here with WicketTester? (Keep in mind that the table does get refreshed correctly in production.) Thanks On Mon, Sep 20, 2010 at 6:24 PM, Alec Swan wrote: > Hello, > > I have a page which contains a DropDownChoice menu and a table. The > menu has AjaxFormComponentUpdatingBehavior which causes the table to > refresh. The page is actually working correctly, but I am having > problems with a test. > > The test does the following: > 1. Renders the page > 2. Verifies that the first table row has the right data using > tester.getComponentFromLastRenderedPage("referralsForm:referrals:1") > 3, Selects an item in the menu and calls executeAjaxEvent(menuId, > "onchange") > 4. Verifies that the first row of the table contains the right data > the same way step 2 does > > The last step fails indicating that "referralsForm:referrals:1" does > not exist. However, "referralsForm:referrals" exists and its model > data contains the rows I expect it to contain. > > What am I doing wrong? > > Thanks >
Using WicketTester to verify table content refreshed by AJAX event
Hello, I have a page which contains a DropDownChoice menu and a table. The menu has AjaxFormComponentUpdatingBehavior which causes the table to refresh. The page is actually working correctly, but I am having problems with a test. The test does the following: 1. Renders the page 2. Verifies that the first table row has the right data using tester.getComponentFromLastRenderedPage("referralsForm:referrals:1") 3, Selects an item in the menu and calls executeAjaxEvent(menuId, "onchange") 4. Verifies that the first row of the table contains the right data the same way step 2 does The last step fails indicating that "referralsForm:referrals:1" does not exist. However, "referralsForm:referrals" exists and its model data contains the rows I expect it to contain. What am I doing wrong? Thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org