I found how I should do in place of getCallbackScript() I should call getEventHandler() in the renderHead method but with AjaxFormComponentUpdatingBehavior > > . >
it works like charm. Thank you pedro. On Thu, Jan 14, 2010 at 3:25 PM, Pedro Santos <[email protected]> wrote: > You can take a look at AjaxFormComponentUpdatingBehavior, this behavior > will > keep the 'judet' field model data updated. > About the generated id, this is the default behavior, you can override the > onBind method to avoid id. But later you will can not add the component to > an AjaxRequestTarget, so see if you can work with the generated id. > > On Thu, Jan 14, 2010 at 11:11 AM, Alexandru Barbat < > [email protected]> wrote: > > > Hello, > > > > .. > > AbstractDefaultAjaxBehavior behave = new AbstractDefaultAjaxBehavior() { > > protected void respond(AjaxRequestTarget target) { > > target.addComponent(orasListPanel); > > } > > > > public void renderHead(IHeaderResponse response) { > > super.renderHead(response); > > response.renderJavascript("function load_orase(){\n" + > > getCallbackScript().toString() + "\nalert('ok');\n}", "loadOrase"); > > } > > > > }; > > > > > > TextField judet = new TextField("judetSelectat"); > > judet.add(new SimpleAttributeModifier("id","judetSelectat")); > > ///xxxxx > > judet.add(behave); > > > > .. > > > > > > I use this to generate a js function in order to call it from flash > > component but it does't work at all because o line ///xxxx. > > SimpleAttributeModifier change the element id but the > > AbstractDefaultAjaxBehaviour doesn;t take that in account.. it use the > > generated id. This is one problem. How I could overcome that? > > > > > > And second, even if I don't change the id of 'judetSelectat' and even if > > the > > behaviour it is called the model of the 'judet' field it is not called. > > Why? > > > > > > Thank you, > > > > Alexandru > > > > > > -- > Pedro Henrique Oliveira dos Santos >
