QeelwaEtech / omnifaces

Automatically exported from code.google.com/p/omnifaces
0 stars 1 forks source link

Raw cc:insertFacet work within all components #180

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In my bean there is an action method which reads `f:param` child objects of the 
processed component like `h:commandButton` and creates a query string using 
those parameters like `h:link` works for example.

I tried to create a composite with a commandbutton where `cc.renderFacet` was 
used as a child of that button.

Either my `f:param` components are now a child of that `cc.renderFacet` and 
thus not read in my action method or the facet is not rendered at all. (Did not 
tested it.)

Composite: "testComposite"

<cc:facet name="queryParams"/>
<p:commandButton>
  <cc:renderFacet name="queryParams"/>
</p:commandButton>

Markup:

<comp:testComposite>
  <f:facet name="queryParams>
    <f:param name="key" value="value"/>
  </f:facet>
</comp:testComposite>

This seems similar to the custom rawInserFacet requirement/component of this 
Users.

http://stackoverflow.com/questions/7891650/using-compositeinsertfacet-renderface
t-does-not-work-inside-tdatatable

My use case is a primefaces dialog which is rendered if a specific view-param 
was not provided and forces the user to select it and reload the page via 
GET-request and append all defined params.

I could also simply use `includeViewParams=true` in this case since all 
view-parameters should be added anyway but this requirement is maybe usefull 
for others.

Original issue reported on code.google.com by releases...@googlemail.com on 28 May 2013 at 5:41

GoogleCodeExporter commented 9 years ago
Proposal is sound, but I believe the composite component is in such case just 
the wrong tool for the puspose. If it's really a fixed parameter, you could 
also add a <cc:attribute> for the parameter value.

Original comment by balusc on 6 Jul 2013 at 4:12

GoogleCodeExporter commented 9 years ago
It can be made a fixed parameter but in general this would need all possible 
view-params to be added as composite attributes. 

In some other composite components I just pass attributes for the purpose of 
link creation to be inserted as `f:param` within `h:link`.

But these attributes are boilerplate if they only are used for this purpose.
Sometimes this are 3-4 parameters which are not used else in the component.

Original comment by releases...@googlemail.com on 7 Aug 2013 at 1:24

GoogleCodeExporter commented 9 years ago
Furthermore using <o:param> I need not only to add the view-params but also the 
converter's ass attributes.

Especially necessary if the composite component is in a shared library where 
many of those pass-through parameters would just overloading the interface 
definition.

This can be usefull for static `<h:link>` aswell as my ajax approach.
Will post my method which is based on 
http://code.google.com/p/omnifaces/issues/detail?id=235 later.

Original comment by releases...@googlemail.com on 8 Sep 2013 at 1:32

GoogleCodeExporter commented 9 years ago
Closing off as wontfix.

Feel free to reopen at GitHub if you've a more concrete real life example 
https://github.com/omnifaces/omnifaces/issues

Original comment by balusc on 17 Apr 2014 at 6:32