0

For some reason,the does not always append the view parameters to the produced link. I can't figure out why. If I change the outcome to another similar link,then it is processed correctly.

Can anyone point me to some requirement that could not be fulfilled? I didn't find anything relevant in the docs.

I am trying to set up 4 views backed by a single bean. Those views all contains the same view parameters, but only one of them process them. All view use the same template.

So i have in all views

<f:metadata>
    <f:viewParam name="param1"
                 value="#{bean.param1}"/>
    <f:viewParam name="param2"
                 value="#{bean.param2}"/>
</f:metadata>
<ui:composition template="/onpage/template.xhtml">
// ...

And in one of them, i included a <f:viewAction>

In the template I have some links

<h:link outcome="#{bean.outcome1}"
        value="Go to view1"/>
<h:link outcome="#{bean.outcome2}"
        value="Go to view2"/>

and in the bean:

private String param1; // And get/setters
private String param2; // and get/setters
public String getOutcome1() {
 return "/my/path.jsf?some=param&includeViewParams=true";
}
public String getOutcome2() {
 return "/my/path2.jsf?some=param2&includeViewParams=true";
}

With this setup, some of the links point to "/my/path.jsf?param1=value1&param2=value2" as expected, while others point to "/my/path2.jsf?some=param2" for no apparent reason, and without any information in the log.

All this running on glassfish 4/JSF 2.2/primefaces 4.

THanks

BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452
cghislai
  • 1,599
  • 11
  • 22
  • you mean, some of the links in the same page? or in some pages you have the parameters and in some other pages you do not? – Antonio Ragagnin Aug 01 '14 at 15:36
  • Also, have you tried adding the ` ` inside the `` ? – Antonio Ragagnin Aug 01 '14 at 15:42
  • on the same page! Im going crazy.. If i add the parameters manually, the link is correctly generated, but view params are not processed in the outcoming view – cghislai Aug 01 '14 at 15:42
  • And it also happens to `link2` or sometimes o `link1`and sometimes to `link2`? – Antonio Ragagnin Aug 01 '14 at 15:46
  • This is always the same link that fails. If I replace the outcome to another one, it works. If i create an empty page with only the view param and ui:define, it fails. – cghislai Aug 01 '14 at 15:54
  • What happened is that I mixed XML namespace domains. The pages using 'xmlns:f="http://java.sun.com/jsf/core"' were working correctly, while those using 'xmlns:f="http://xmlns.jcp.org/jsf/core"' were not. See http://stackoverflow.com/questions/17945943/the-metadata-component-needs-to-be-nested-within-a-fmetadata-tag-suggestion-e for more details. – cghislai Aug 01 '14 at 16:22

1 Answers1

0

Answer part of the OP comments:

What happened is that I mixed XML namespace domains. The pages using xmlns:f="java.sun.com/jsf/core were working correctly, while those using xmlns:f="xmlns.jcp.org/jsf/core were not. See The metadata component needs to be nested within a f:metadata tag. Suggestion: enclose the necessary components within <f:metadata> for more details.

Note: JSF 2.2 schemas use the xmlns:f="xmlns.jcp.org/jsf/core namespace.

Community
  • 1
  • 1
cghislai
  • 1,599
  • 11
  • 22