\\
JAXFront allows you to overwrite any standard wiget generated by the visualizer factory. Just specify an own plugin class in your XUI for a certain field/block.
\\
!worddavcb6485e9e92f2079ba5fb51986276aae.png|height=33,width=33! As an example see the Wiki-Markup
As an example see the po.xui in the jaxfront-demo.war. There is a HTML plugin defined for the xpath: /purchaseOrder/shipTo/street:
\\
<component xpath="/purchaseOrder/shipTo/street">
<style>
<plugIn class="com.jaxfront.html.plugins.SimpleTypePluginPlainHTMLExampleView">
</plugIn>
</style>
</component>
\\
!worddave6290d961dc319b85aba0adbde617440.png|height=31,width=29! The following simple JAXFront HTML plugin just creates a listbox containing three different street names to choose from. As soon as the user selects a street, the value will be updated asynchronously in the server-side existing JAXFront DOM.
\\
<span style="color: #7f0055"><strong>public</strong></span> <span style="color: #7f0055"><strong>class</strong></span> SimpleTypePluginPlainHTMLExampleView <span style="color: #7f0055"><strong>extends</strong></span> SimpleTypeView \{
\\
<span style="color: #7f0055"><strong>protected</strong></span> <span style="color: #7f0055"><strong>void</strong></span> createEditorComponent(HtmlContainerWidget container) \{
<span style="color: #0000c0">_component</span> = <span style="color: #7f0055"><strong>new</strong></span> HtmlPlainTextWidget(container,
The following simple JAXFront HTML plugin just creates a listbox containing three different street names to choose from. As soon as the user selects a street, the value will be updated asynchronously in the server-side existing JAXFront DOM.
public class SimpleTypePluginPlainHTMLExampleView extends SimpleTypeView {
protected void createEditorComponent(HtmlContainerWidget container) {
_component = new HtmlPlainTextWidget(container, getHTMLContent().toString());
\}
\\
<span style="color: #7f0055"><strong>public</strong></span> <span style="color: #7f0055"><strong>void</strong></span>
}
public void populateView() \{
<span style="color: #7f0055"><strong>super</strong></span>{
super.populateView();
((HtmlPlainTextWidget)<span style="color: #0000c0">_component</span>_component).setHTMLContent(getHTMLContent().toString());
\}
\\
<span style="color: #7f0055"><strong>public</strong></span> StringBuffer
}
public StringBuffer getHTMLContent() \ {
StringBuffer sb = <span style="color: #7f0055"><strong>new</strong></span> = new StringBuffer();
sb.append(<span style="color: #2a00ff">"<b>Choose your favorite street!</b><br/><br/>"</span>);
sb.append(<span style="color: #2a00ff">"<select "<b>Choose your favorite street!</b><br/><br/>");
sb.append("<select id=\""</span> + getXPath() + <span style="color: #2a00ff">"\" size=\"3\" onclick=\"saveData(this)\">"</span>>");
String\[\] names = <span style="color: #7f0055"><strong>new</strong></span> String\[\] \{ <span style="color: #2a00ff">"Nowhere Land"</span>, <span style="color: #2a00ff">"Palm Street"</span>, <span style="color: #2a00ff">"Example Street"</span>, <span style="color: #2a00ff">"Wall Street"</span>, <span style="color: #2a00ff">"Bahnhof Street"</span> \};
String selected = <span style="color: #2a00ff">""</span>;
<span style="color: #7f0055"><strong>for</strong></span> (<span style="color: #7f0055"><strong>int</strong></span> i = 0; i < names.<span style="color: #0000c0">length</span>; i++) \{
<span style="color: #7f0055"><strong>if</strong></span> (getValue() != <span style="color: #7f0055"><strong>null</strong></span> && = new String[] { "Nowhere Land", "Palm Street", "Example Street", "Wall Street", "Bahnhof Street" };
String selected = "";
for (int i = 0; i < names.length; i++) {
if (getValue() != null && getValue().equals(names\[i\]))
selected = <span style="color: #2a00ff">
selected = "selected"</span>;
<span style="color: #7f0055"><strong>else</strong></span>
selected = <span style="color: #2a00ff">""</span>;
\\
;
else
selected = "";
sb.append(<span style="color: #2a00ff">"<option "</span> + selected + <span style="color: #2a00ff">" "<option " + selected + " value=\""</span> + names\[i\] + <span style="color: #2a00ff"\">"\">"</span> + names\[i\] + <span style="color: #2a00ff">"</option>"</span>);
\}
"</option>");
}
sb.append(<span style="color: #2a00ff">"</select>"</span>);
<span style="color: #7f0055"><strong>return</strong></span> sb;
\}
\\
<span style="color: #7f0055"><strong>public</strong></span> <span style="color: #7f0055"><strong>void</strong></span> setSize(String size) \{
<span style="color: #3f7f5f">// do nothing</span>
\}
\\"</select>");
return sb;
}
public void setSize(String size) {
// do nothing
}