What about creating the component by hand in the renderer, like saying
link = new HtmlOutputLink();

setting the values you need and then rendering this component - look
for an example into the HtmlCalendarRenderer, it is done there as
well.

regards,

Martin


On Wed, 19 Jan 2005 11:16:45 +0100, Hendrik Neumann
<[EMAIL PROTECTED]> wrote:
> Hi guys,
> 
> I'm currently trying to write a JSF-component for a content-mangement-system.
> The goal of the component is to render a HTML-page which lists all elements
> of an article (with all things like text-components, pictures, headline etc.)
> and provides a link for every article-element which referes the user to a
> special JSF-site in which the selected article-component can be edited. For
> example: the user sees the site which lists all article-elements and selects
> a "edit this text-component button" from one text component. Aftter that he
> would be forwarded to a "editTextComponent.jsf"-Site which loads the selected
> component into a managed bean. The site "editTextComponent.jsf"-Site itself
> would then provide a JSF-form which fields are binded with the managed-bean
> properties. To do this I need my own component-renderer to create a special
> "command link" with an additional parameter of the selected component ID
> (similar to the <h:commandLink />- and <h:f:param />-Tags in a normal
> JSF-site). Because I need the ID of the selcted component in the new
> JSF-site.
> 
> Now I need to know how I can pass such a parameter in a renderer. In a
> jsf-site I would simply do something like
> 
> <h:commandLink action="myUser.accessRequestEditTextComponent">
>  <h:outputText value="articleAdminPage.editThisTextComp" />
>  <h:f:param name="componentID" value="myTextComp.databaseID" />
> </h:commandLink>
> 
> But how can I do such a thing in a JavaClass??? I already tried a thing like
> 
>  public void encodeEnd(FacesContext ctx, UIComponent comp)
>  {
> [...]
>     writer.write("   <form
> action=\"../articlecomponents/createnewpiccomp.jsf\" method=\"get\">");
>     writer.write("   <input type=\"hidden\" name=\"position\" value=\"" +
> textComponent.getID() + "\" />");
>     writer.write("    <input type=\"image\" src=\"" +
> myUIArticle.getCreateNewIcon() + " \" />");
>     writer.write("   </form>");
> [...]
> 
> But this is not working and it is very ugly because the url of the new site is
> hard-coded (and not a "action"-attribute which can be used in the
> faces-config.xml for navigation), I'm not able to pick out this attribute in
> the new jsf-site and the HTML-code is also hard coded.
> 
> Can you guys give at least a little hint, a keyword to what I shall look for?
> I have defintly no idea and I'm already a little bit despaired.
> 
> Greetings,
> Hendrik
>

Reply via email to