• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help creating a custom JSF component and adding a validator to it.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I would like to implement my custom component. It is basically an InputText with many other features.
I created it and all is ok but I can't add a tag <f:validator> inside cause it give me the error "Not nested in a tag of proper type."
What can I do?

Html code is that:
<myf:specialInput [...] >
<f:validator validatorId="myValidator">
</myf:specialInput>

the two class files are:
public class SpecialInputTag extends UIComponentTag (also deprecated...what I have to use??) : for the tag
public class SpecialInput extends UIPanel implements NamingContainer : for the renderer and component

Help me, thanks!

coorasse.


 
ala alal
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It was three days I was trying it and now that I posted the problem I solved it.
OK OK OK.
If someone else have my problem the component you are creating must extends UIInput. I solved with that.
Bye.
 
ala alal
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a new problem. The problem appears during the rerendering of my custom component.
It keeps some children inside and during the restore it give me an ArrayIndexOutOfBoundException.
I solved with the solution posted here: LINK that I report here:


Why I need to remove children from the tree? Why they are duplicated? Does anyone has a better solution?
Thanks.
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic