• 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

Composite Components

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm currently looking at creating some components to replace common patterns within my application (name, phone number, ssn, address, etc.), so that a developer need only add one tag to the their JSP instead of dragging several components onto the screen.

I've looked at creating the components in a standard way (obtaining the ResposeWriter and then creating the markup), but cannot seem to figure out how that decode() method would work. In my case, I'm not just trying to run setSubmittedValue() once. I'd need to do that for every input declared within my new component.

I've also looked into using existing components (HtmlInputText) and adding them to a PanelGroup as children, and using the default rendering for a Panel. In this case, getClientId is returning a different value when the constructor runs and when decode() runs.

In both cases, I'm able to get my component to render to the screen. I'm just not able to sucessfully decode the component and set the submitted value.

Has anyone done anything similar to this that would be able to provide me with an example?
 
Saloon Keeper
Posts: 27886
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you can define a JSP tag that will do that. That is, use the ability of recent versions of the JSP standard to define custom JSP tags in JSP. I'm fairly sure that any J2EE server recent enough to support JSP will also support custom tags written in JSP, and I'm reasonably sure that such tags generally won't interfere with the JSF rendering mechanism.

If you can do that, it would save time over creating everything in Java, and be somewhat tidier as well.
 
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic