• 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

Custom component & validation/rendering problems

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I need a component that will do the following:

- render an icon with an HtmlAjaxCommandLink
- clicking the icon an action will be triggered
- clicking the icon a modal panel will appear with some label, text and so on.

This is the tag I have in mind:



So, I started to write a custom component that will extend an HtmlAjaxCommandLink




The idea is to use and then add a child component to the DOM:




Tag works fine ....


(see one.gif)

but if a JSF validation is triggered (i.e. a missing value in a mandatory field), something goes wrong.


(see two.gif)

The component is rendered again, so I have two icons in the page.


(see three.gif)

While debugging, I saw that after validation, encodeBegin is called again and that getChildCount() returns 1.
The solution I found is to invoke getChildren().clear() in encodeBegin method.

I know that this is not the right way to fix my problem.

Any suggestion?

Many thanks,
Tommaso

three.gif
[Thumbnail for three.gif]
one.gif
[Thumbnail for one.gif]
two.gif
[Thumbnail for two.gif]
 
Tommaso Tama
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I forgot: I'm using JSF1.2 and Rich components (3.3).
 
reply
    Bookmark Topic Watch Topic
  • New Topic