Guest User

Untitled

a guest
Jan 24th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <h:form >
  2. <p:commandButton class="btn" value="mostrar foo"
  3. action="#{developerController.foo}" update="foo"/>
  4.  
  5. <h:panelGroup id="foo" rendered="#{developerController.bar}">
  6. foo
  7. </h:panelGroup>
  8. </h:form>
  9.  
  10. import java.io.Serializable;
  11. import javax.enterprise.context.SessionScoped;
  12. import javax.inject.Named;
  13.  
  14. @Named(value = "developerController")
  15. @SessionScoped
  16. public class DeveloperController implements Serializable {
  17.  
  18. private boolean bar;
  19.  
  20.  
  21. public DeveloperController() {
  22.  
  23. }
  24.  
  25. public void foo() {
  26. bar=!bar;
  27. }
  28.  
  29. public boolean isBar() {
  30. return bar;
  31. }
  32.  
  33. public void setBar(boolean bar) {
  34. this.bar = bar;
  35. }
  36. }
Add Comment
Please, Sign In to add comment