0

Good morning in my timezone,

I am adding some features in a JSF application, i add the following code

 <h:link outcome="nameOut1.innerName" >
        <f:param name="idX" value="#{xbean.idElement}"/>
        <f:param name="idY" value="#{xBean.param1.param2.id}"/>
</h:link>

And i change it by this one

 <h:commandLink  action="#{xBean.validateBeforeClose}" >
        <f:param name="idX" value="#{xbean.idElement}"/>
        <f:param name="idY" value="#{xBean.param1.param2.id}"/>
</h:commandLink>

And in the bean

 public String validateBeforeClose(){
        if (isValidToRemove()) {
            setValidationToRemove(true);
            return "";
        }else{
            return "nameOut1.innerName";
        }
    }

if the first condition is true then it come back to the same View, and displays a popupWindow, if this condition is not met , then return the same outcome that the old link tag was setting. The problem is : True the link the h:link tag the parameters are sent, i see that in the URL, but through the action the parameters are not sent. in the faces-config i have the following configuration

<navigation-case>
      <from-outcome>nameOut1.innerName</from-outcome>
      <to-view-id>/folder1/folder2/view2.xhtml</to-view-id>
      <redirect include-view-params="true">
      </redirect>
    </navigation-case>

Why is this happening ?

Thanks in advance Best regards

Tiny
  • 27,221
  • 105
  • 339
  • 599
tt0686
  • 1,771
  • 6
  • 31
  • 60
  • So you seem to have assumed that an `` sends an HTTP GET request exactly as done by an ``. – Tiny Feb 04 '15 at 11:30
  • It uses a POST correct ? So if this is the case i must use hidden fields ? – tt0686 Feb 04 '15 at 11:35
  • That depends... If you are merely doing page-to-page navigation, you should drop using ``. Otherwise, you can use `` which also provides you with fine-grained control over conversions and/or validations, if any. – Tiny Feb 04 '15 at 11:40
  • 1
    @Tiny: OP is attempting Post-Redirect-Get. – BalusC Feb 04 '15 at 11:41
  • Yes @BalusC , should i use hidden fields in the post, then in the method action mapping those fields to the param object ? – tt0686 Feb 04 '15 at 11:46

0 Answers0