Markup
The component jtp:inputMarkup is encapsulating the data entry for different markup types:
- text with a p:textArea
- xhtml with a p:textEditor
Several of these markup types may be combined and ordered horizontally in one panel by encompassing them in an element with the styleClass jeesl-editor-list . It is required to have maven artifact org.primefaces.extensions:resources-ckeditor:8.0 included.
A related component for output of the entered data is jtp:outputMarkup .
- XHTML (Text)
- XHTML (Full)
- XHTML (Extended)
- XHTML (Multiple)
- XHTML (Grid)
- XHTML (Mixed)
- XHTML (Data)
- Bean
- Types
<p:panel styleClass="jeesl-panel" header="Text">
<f:facet name="actions">
<j:svg type="jeeslSave" listener="#{componentInputMarkupBean.saveText()}" update="@form"/>
</f:facet>
<jtp:inputMarkup value="#{componentInputMarkupBean.mText}"/>
</p:panel>
<p:panel styleClass="jeesl-panel jeesl-editor" header="Full Panel">
<f:facet name="actions">
<j:svg type="jeeslSave" listener="#{componentInputMarkupBean.saveXhtml()}" update="@form"/>
</f:facet>
<jtp:inputMarkup value="#{componentInputMarkupBean.mXhtml}"/>
</p:panel>
<p:panel styleClass="jeesl-panel jeesl-editor" header="Full Panel">
<f:facet name="actions">
<j:svg type="jeeslSave" listener="#{componentInputMarkupBean.saveXhtml()}" update="@form"/>
</f:facet>
<jtp:inputMarkupExt value="#{componentInputMarkupBean.mXhtml}"/>
</p:panel>
<p:panel styleClass="jeesl-panel jeesl-editor" header="Full Panel">
<f:facet name="actions">
<j:svg type="jeeslSave" listener="#{componentInputMarkupBean.saveXhtml()}" update="@form"/>
</f:facet>
<div class="jeesl-editor-list">
<jtp:inputMarkup value="#{componentInputMarkupBean.mXhtml}"/>
<jtp:inputMarkup value="#{componentInputMarkupBean.mXhtml}"/>
<jtp:inputMarkup value="#{componentInputMarkupBean.mXhtml}"/>
</div>
</p:panel>
<p:panel styleClass="jeesl-panel jeesl-editor" header="Inside j:inputGrid">
<f:facet name="actions">
<j:svg type="jeeslSave" listener="#{componentInputMarkupBean.saveXhtml()}" update="@form"/>
</f:facet>
<j:inputGrid>
<p:outputLabel value="Key"/>
<h:outputText id="panelGridKey" value="Value" />
<p:outputLabel value="Markup"/>
<jtp:inputMarkup value="#{componentInputMarkupBean.mXhtml}"/>
</j:inputGrid>
</p:panel>
<p:panel styleClass="jeesl-panel jeesl-editor" header="Outside j:inputGrid">
<f:facet name="actions">
<j:svg type="jeeslSave" listener="#{componentInputMarkupBean.saveXhtml()}" update="@form"/>
</f:facet>
<j:inputGrid>
<p:outputLabel value="Key"/>
<h:outputText id="panelMixedKey" value="Value" />
</j:inputGrid>
<jtp:inputMarkup value="#{componentInputMarkupBean.mXhtml}"/>
</p:panel>
<p:panel styleClass="jeesl-panel" header="Data">
<h:outputText value="#{componentInputMarkupBean.text}"/>
</p:panel>
@Named @ViewScoped
public class ComponentInputMarkupBean extends AbstractJeeBean implements Serializable
{
final static Logger logger = LoggerFactory.getLogger(ComponentInputMarkupBean.class);
private static final long serialVersionUID = 1L;
private final EjbIoCmsMarkupFactory<IoMarkup,IoMarkupType> efMarkup;
private IoMarkup mText;
public IoMarkup getmText() {return mText;}
public void setmText(IoMarkup mText) {this.mText = mText;}
private IoMarkup mXhtml;
public IoMarkup getmXhtml() {return mXhtml;}
public void setmXhtml(IoMarkup mXhtml) {this.mXhtml = mXhtml;}
private String text;
public String getText() {return text;}
public void setText(String text) {this.text = text;}
public ComponentInputMarkupBean()
{
efMarkup = EjbIoCmsMarkupFactory.instance(IoMarkup.class);
}
@PostConstruct
public void init()
{
super.initSecurity();
mText = efMarkup.build(fUtils.fByEnum(IoMarkupType.class,JeeslIoMarkupType.Code.text));
mXhtml = efMarkup.build(fUtils.fByEnum(IoMarkupType.class,JeeslIoMarkupType.Code.xhtml));
}
public void saveText()
{
text = mText.getContent();
}
public void saveXhtml()
{
text = mXhtml.getContent();
}
}
|
Text | |
|
HTML |