Output
0 | |
false |
Button
This component will add a button to the status bar.
- It must be added within <ui:define name="statusBar">...</ui:define>
- It accepts an optional listener as well as an optional JavaScript onclick handler to allow for either use
- It allows a tooltip and an icon attribute
<jp:sbButton icon="jeeslAdd" orientation="right" listener="#{sbButtonBean.click()}" toggled="#{sbButtonBean.toggled}" update="@form :pText"/>
<jp:sbButton icon="jeeslAdd" orientation="right" disabled="true" listener="#{sbButtonBean.click()}"/>
<jp:sbButton icon="jeeslComment" orientation="right" listener="#{sbButtonBean.click()}" toggled="#{sbButtonBean.toggled}" update="@form :pText"/>
<jp:sbButton icon="jeeslComment" orientation="right" disabled="true" listener="#{sbButtonBean.click()}"/>
<jp:sbButton icon="jeeslMegaphone" orientation="right" listener="#{sbButtonBean.click()}" toggled="#{sbButtonBean.toggled}" update="@form :pText"/>
<jp:sbButton icon="jeeslMegaphone" orientation="right" disabled="true" listener="#{sbButtonBean.click()}"/>
<p:panel id="pText" header="Output" styleClass="jeesl-panel">
<p:panelGrid columns="2" columnClasses="jeeslGrid25,jeeslGrid75">
<p:outputLabel value="Counter"/>
<h:outputText value="#{sbButtonBean.counter}"/>
<p:outputLabel value="Toggled"/>
<h:outputText value="#{sbButtonBean.toggled}"/>
</p:panelGrid>
</p:panel>
</ui:composition>
@Named @ViewScoped
public class SbButtonBean extends AbstractJeeBean implements Serializable
{
final static Logger logger = LoggerFactory.getLogger(SbButtonBean.class);
private static final long serialVersionUID = 1L;
private int counter;
public int getCounter() {return counter;}
public void setCounter(int counter) {this.counter = counter;}
private boolean toggled;
public boolean isToggled() {return toggled;}
public void setToggled(boolean toggled) {this.toggled = toggled;}
public SbButtonBean()
{
counter=0;
}
@PostConstruct
public void init()
{
super.initSecurity();
}
public void click()
{
counter++;
toggled = !toggled;
logger.info("Button Clicked: "+counter+" "+toggled);
}
}
Name | Required | Default | Description |
---|---|---|---|
listener | false | ||
disabled | false | false | |
icon | false | ||
label | false | ||
onstart | false | JS execeuted immediatly after clicking. | |
oncomplete | false | JS execeuted after listener is completed. | |
onclick | false | ||
orientation | false | left | |
styleClass | false | ||
toggled | false | ||
tooltip | false | ||
library | false | jeeslGfx | The library attribute which is passed to h:graphicImage. For JEESL icons, jeeslGfx has to be used. |
udpate | false |