• 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

Got stuck with #{param}

 
Greenhorn
Posts: 19
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have a question on how to use #{param.XXXX}
In my code there is button and I want to render it only when #{param.XXXX == 'SomeValue'} ... Rendering happens correctly, but the "action" is not working {for navigation}. It is submitting to same page, even I have placed different value in "action" attribute.

The same is working fine if the "rendered" attribute contains value "true" directly.

Am I using #{param} wrongly?? Please suggest.
Can I find any example on this?

Thanks,
Mamidi

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi mamidi, try this

<h:commandButton value="submit" rendered="#{param.XXXX == 'SomeValue'}" action="#{param.navigate}">

backing bean

public String navigate()
{
return "nextpage";
}

faces-config.xml

<navigation-rule>
<navigation-case>
<from-outcome>nextpage</from-outcome>
<to-view-id>nextpagename.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>


The value returned to the action should match the navigation case in xml file. here in this case it is the value "nextpage". when xml file sees that value it knows that it has to navigate to the page mentioned in <to-view-id>. If both the pages are in the same folder this should work. If not give the path to the page.

Hope this helps.
 
Once upon a time there were three bears. And they were visted by a golden haired tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic