I am creating a Component to use <button > HTML tag in my apps.
I am implementing Bootstrap in my WO application and I want to create buttons with icons.
I followed the example in the book Practical WebObjects, chapter 6 that creates a Hyperlink Component.
public class BootstrapSubmitButton extends ERXComponent {
public BootstrapSubmitButton(WOContext context) {
super(context);
}
@Override
public void appendToResponse(WOResponse response, WOContext context) {
String tabindex = stringValueForBinding("tabindex");
String cssClass = "btn "+stringValueForBinding("class", "");
String icon = stringValueForBinding("icon");
response.appendContentString("<button name=\""+context.elementID()+"\"");
if(tabindex != null){
response.appendContentString("tabindex=\""+tabindex+"\" ");
}
response.appendContentString("class=\""+cssClass+"\" type=\"submit\">");
if(icon != null){
response.appendContentString("<i class=\""+stringValueForBinding("icon")+"\" > </i> ");
}
response.appendContentString(stringValueForBinding("value"));
response.appendContentString("</button>");
}
@Override
public boolean synchronizesVariablesWithBindings() {
return false;
}
@Override
public WOActionResults invokeAction(WORequest request, WOContext context) {
if(context.elementID().startsWith(context.senderID())){
return (WOActionResults)valueForBinding("action");
}
return null;
}
}
I just changed a line:
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden