You can use Wicket Events to accomplish that. See Component#send() and Component/Behavior #onEvent(). The timer behavior can broadcast an event and any component, behavior, session, request cycle and application can react on this event (e.g. a component can add itself to the AjaxRequestTarget).
Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Jul 22, 2014 at 9:56 AM, Rune Stilling <runestill...@rdfined.dk> wrote: > Hi Patrick > > Ok you are probably right and I have done this now. I was just “afraid" > that adding too many AbstractAjaxTimerBehavior to the solution would > somehow be a problem, but I guess not. > > Thanks, > Rune > > Den 21/07/2014 kl. 17.33 skrev Patrick Davids < > patrick.dav...@nubologic.com>: > > > Hi Rune, > > for me it looks like the feature of updating parts of your > > UploadFormPanel by using a timer should be a behavior of your > > UploadFormPanel itself. > > > > Put it inside, and you have access the particular container to refresh. > > No need to refresh the whole panel from outside, which side-affects your > > dropdown choice and clicks etc. > > > > kind regards > > Patrick > > > > Am 21.07.2014 15:29, schrieb Rune Stilling: > >> Hi list > >> > >> I’m using the TabbedPanel component to show a couple of tabs each of > them containing a form. The form among other things contains a > DropDownChoice. I have also set up a AbstractAjaxTimerBehavior instance to > do some updates along the way. On of the updates i the TabbedPanel, that I > add to my target in AbstractAjaxTimerBehavior::onTimer. > >> > >> Now what happens is that if I have selected/pulled down my drop down > choice in the browser the target.add(tabPanel); instruction makes the drop > down roll in again, so that I have to click it again. Is there a way I can > avoid this by setting some flag on the DropDownChoice so that it doesn’t > rerender on the AjaxRequestTarget.add(tabbePanel)? > >> > >> Here’s some code: > >> > >>> tabs.add(new AbstractTab(new Model<String>("Filupload")) { > >>> private static final long serialVersionUID = 1L; > >>> > >>> @Override > >>> public Panel getPanel(String panelId) { > >>> UploadFormPanel uploadPanel = new > UploadFormPanel(panelId, version, editionDirPath, mandatoryInputFiles); > >>> uploadPanel.setOutputMarkupId(true); > >>> return uploadPanel; > >>> } > >>> }); > >> > >>> final TabbedPanel tabPanel = new > TabbedPanel("versionTabPanel", tabs); > >>> tabPanel.setOutputMarkupId(true); > >>> add(tabPanel); > >> > >>> final AbstractAjaxTimerBehavior timer = new > AbstractAjaxTimerBehavior(Duration.milliseconds(1000)) { > >>> @Override > >>> public void onTimer(AjaxRequestTarget target) { > >>> target.add(tabPanel); //Doesn't update panels (so > whats the use? Det er nødvendigt for at opdatere PropertyModels, er det > ikke?) > >>> } > >> > >> I was also considering to add only parts of the tabPanel, but I don’t > know how to access the uploadPanel in the AbstractTab instance. > >> > >> \Rune > >> --------------------------------------------------------------------- > >> 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 > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >