AnsweredAssumed Answered

How to build a custom component

Question asked by nahanni on May 18, 2007
Latest reply on May 22, 2007 by nahanni
Hi,

I would like to build my owns component generators in order to execute javascript during some events (onBlur, onClick, …).

Staring with TextFieldGenerator.java component generator, I tried to add javascript for the onChange event with the line 

component.getAttributes().put("onChange", "alert('Hello !');");

But the generated page do not contains any javascript for the event. I am sure that my component generator is used as the modification I made for the maxlength attribute is visible.

Do I have to implement my own component at myFaces level by developing a my own myFaces component type and use it in a component generator with the line

      UIComponent component = context.getApplication().createComponent("my_own_component");

Thank you for your help

Dom

Outcomes