• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Command button useless

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

I have a command button <h:commandButton type="submit" value="#{msg.esku_title_module}" action="#{eskuNavigatorBean.goWhatDescription}">

which is in a <f:subview> tag, which is included through a <jsp:include> tag in another jsp. The thing is that is not doing anyhing but cleaning the form above it. It passes throught all the JSF phases and that's it, no error, no debug from the invocation phase is being logged.

Any ideas?

Thnx.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it been placed in a (single) h:form? If so, does it or one or more of its parent elements have the 'rendered' attribute set by EL? If so, does it (they all) evaluate true at the moment that JSF determines which command action to invoke (during 2nd phase, the apply request values)?
 
Hernán Quevedo
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I forgot to include the attribute rendered="#{!searchSKUBean.emptyGrid}", which behaves normally checking if some dataTable is empty, if so, it doesn't render.
When I submit the form, the only one, the table gets populated and the button shows up; when I click it, nothing happens, other than erasing table data hence evatulating true at the rendered condition.

I actually have two buttons, set with the same condition on the rendered attribute. They do evaluate true at second phase.
 
Hernán Quevedo
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Done it.

It was very silly... My faces-config.xml was having this bean in a request scope. I put it on session and the dataTable holds the data all the time unless I nullify objetcs on purpose.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Placing it in session scope has more impact on user experience. Think about opening multiple windows/tabs in the same session.

Request scoped data should be placed in the request scope. If the commandbutton is placed in a datatable whose rendering is dependent on the availablility of the datamodel, you should rather construct the datamodel in the constructor of the bean or at least introduce lazy loading in the getter of the datamodel.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic