Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
ala alal
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic