I want to add a datebox similar to the one in give link
http://www.jeasyui.com/demo/main/index.php?plugin=DateBox&theme=default&dir=ltr&pitem=
in my web aplication project(smartgwt).
In short I want the datebox(jquery) equivalent in smartGwt.
when i googled i found out there is something called dateChooser in smartGwt but it works like a calendar i want something like the one in above link textfield with a button which on clicking displays the calendar and the selected date appears on the textbox.
please give any suggestions i am using smartGwt LGPL.
You can use a DateItem with useTextField=true to get the required behavior.
DateItem dateItem2 = new DateItem();
dateItem2.setTitle("Date");
dateItem2.setUseTextField(true);
dateItem2.setHint("<nobr>Direct date input</nobr>");
Check 'Date Controls' section in http://www.smartclient.com/smartgwt/showcase/#form_controls_various.
DateItem is a FormItem, meaning you need to put it in a form, and will work just like other form controls.
DateChooser on the other hand is a standalone widget that you can embed among other widgets on its own.
I haven't seen such a component in smartgwt showcase but there is something called PickerIcon which can be coupled to a TextItem to achieve what you want.
PickerIcon datePicker = new PickerIcon(PickerIcon.DATE, new FormItemClickHandler() {
public void onFormItemClick(FormItemIconClickEvent event) {
SC.say("Date Picker clicked"); // or show a dateChooser component
}
});
TextItem datePickerControl = new TextItem("datePicker", "Date Picker");
datePickerControl.setIcons(datePicker);
http://www.smartclient.com/smartgwt/showcase/#form_category_picker_icons
Hope this can help !
Related
I need to enable source button on my richText control ( I have to put there HTML code ) and I have follow this tutorial:
https://documentation.magnolia-cms.com/display/DOCS/Rich+text
So I have added following settings source - true - Boolean in standard-templating-kit/dialogs/generic/controls/text but it doesn't work for me.
I'm using Magnolia CMS 5.2.4. Can anybody please tell me how I can turn on this button or maybe if there is another control to put there html code ?
Best Regards
Jan
Have you defined your dialogs using Blossom? If so, they are completely distinct from the STK dialogs. If you have something like the following example, you will need to change your code to set up the rich text area with a source button.
#TabFactory("heading")
public void headingTab(UiConfig cfg, TabBuilder tab) {
FieldConfig fields = cfg.fields;
tab.fields(
fields.text("headingtitle").i18n().required(),
fields.richText("headingtext").i18n().required()
);
}
The above example would be modified by defining the rich text field and then modifying the definition.
#TabFactory("heading")
public void headingTab(UiConfig cfg, TabBuilder tab) {
FieldConfig fields = cfg.fields;
RichTextFieldBuilder richText = fields.richText("headingtext").i18n().required();
richText.definition().setSource(true);
tab.fields(
fields.text("headingtitle").i18n().required(),
richText
);
}
I'm using GWT 2.3.0 and Sencha EXT 2.3.1. I can not upgrade due to software requirements.
I've got a combobox, in a form, with some values.
A few of these values cannont be entirely displayer because the width of the combobox is too short. But I'm not allowed to enlarge this field.
Is there a solution to add a tooltip, or show the entire value when you are hovering the value in the list ?
Or make the displayed list larger than the display field ?
Thx,
Q.
Actually it's pretty simple. Sencha Gxt 2.3 Examples has already provide a quite good example on how to add tooltip to combobox. But I will post it again for you in here, so here it goes:
public void onModuleLoad() {
VerticalPanel vp = new VerticalPanel();
vp.setSpacing(10);
ListStore<State> states = new ListStore<State>();
states.add(getStates());
ComboBox<State> combo = new ComboBox<State>();
combo.setEmptyText("Select a state...");
combo.setDisplayField("name");
combo.setTemplate(getTemplate());
combo.setWidth(150);
combo.setStore(states);
combo.setTypeAhead(true);
combo.setTriggerAction(TriggerAction.ALL);
vp.add(combo);
RootPanel.get().add(vp);
}
private native String getTemplate() /*-{
return [
'<tpl for=".">',
'<div class="x-combo-list-item" qtip="{slogan}" qtitle="State Slogan">{name}</div>',
'</tpl>' ].join("");
}-*/;
The key is to use a template to render the combobox value with qtip added to each one of the value div. You can read more about it in here
If you want to see the result, it will looks like in sencha gxt 2 examples in here, just take a look at the second combobox, it will show you tooltip every time you hover the combobox item.
That's it, hope it will help you. Thanks & Regards.
Pretty straight-forward question, but I can't find this anywhere. I'm using WicketStuff's TinyMCE to make a Rich Text Editor in my application, and can't find anywhere how to get the input from the text area. For brevity's sake, the following is a simplified version of the code I'm using.
private String input;
...
TinyMCESettings settings = new TinyMCESettings(TinyMCESettings.Theme.simple);
TextArea<String> textArea = new TextArea<String>("editor", new PropertyModel<String>(this, "input"));
textArea.add(new TinyMceBehavior(settings));
form.add(textArea);
Using this, I would expect the usual manner to simply use my String 'input' since it's set as the model. This always results in null as the model isn't being updated.
I tried using the auto-save plugin in case it was expecting the save button to be clicked (which doesn't update the model either), and neither worked. The only thing I've been able to do to get the user's input is to add a HiddenField, with a new model, and make a JavaScript call like
document.getElementById('hiddenField').value = tinyMCE.get('editor').getContent();
but this has led to other problems with trying to call the JS in the desired place and to get it to work properly. I feel this shouldn't be necessary anyways, as surely someone must have implemented a method to get the contents of the text area being used.
Any help would be greatly appreciated.
Thanks to a blog post at Nevermind Solutions, the way to get the model updated is to add the following JavaScript to the form's submitting button:
onclick="tinyMCE.triggerSave(true,true);"
My text area is inside a panel with the button outside of the panel, so it doesn't directly work for me. The trick was to add the JavaScript call to the button's onSubmit, move the logic into the onAfterSubmit, and to make the button MultiPart so that it could call the save trigger before doing the other logic associated to the model.
Hope this might help some others in the future.
You have to add a modifier to the submit button so that the model can update.
AjaxButton btnSubmit = new AjaxButton("btnSubmit", new Model()) {
#Override
public void onSubmit(AjaxRequestTarget target, Form<?> form) {
doSomething();
}
};
btnSubmit.add(new TinyMceAjaxSubmitModifier());
Have a look here for more info
I have implemented a CellTable in gwt, which has a column of type DatePickerCell, which opens a datepicker on click of the cell. I would like to implement something like DateBox, which has a textbox, on click of which a date picker will be opened and date can be removed from textbox, which does not happen in the case of DatePickerCell. I have tried to extend the DatePickerCell to use DateBox instead of DatePicker.
interface Template extends SafeHtmlTemplates {
#Template("<input type=\"text\" value=\"{0}\" tabindex=\"-1\" style=\"width: 85px;\"></input>")
SafeHtml div(String value);
}
Please help in this.
Thanks in advance.
One simple way is to create your own DateBoxCell by coping the class DatePickerCell and change the DatePicker to DateBox and use your own class in columns.
I want to add a new custom component in the Web page Editor Palete named "myHTMLComponent".
So, as soon as user opens any html page with WPE, myHTMLComponentM should be present there.
How can I do the needful, moreover this component will as well need to generate the code changes accordingly. How to achieve the desired result.
Is there any input I can get for this.
I already created standardmetadata tag, but what next!
Finally, I found the solution of the problem.
For adding new categories in the palette, we need to use pagedesignerextension in plugin.xml as following -
<extension
point="org.eclipse.jst.pagedesigner.pageDesignerExtension">
<paletteFactory
class="com.comp.myeditor.palette.CustomEditorPaletteFactory">
</paletteFactory>
</extension>
Where CustomEditorPaletteFactory will be extending AbstractPaletteFactory. Here in createPaletteRoot(), we can add our category.
public PaletteRoot createPaletteRoot(IEditorInput editorInput){
PaletteRoot paletteRoot = new PaletteRoot();
paletteRoot.add(createStandardComponents());
return paletteRoot;
//return null;
}
private static PaletteContainer createStandardComponents() {
PaletteDrawer componentsDrawer = new PaletteDrawer("CustomHTMLComponent");
TagToolPaletteEntry paletteEntry = new TagToolPaletteEntry(
new FormPaletteComponent(".....);
componentsDrawer.add(paletteEntry);
return componentsDrawer;
}
This will create the component category in the palette and we can add as many components as needed using the componentsdrawer.
For adding a new category in the existing one -
Add this in the constructor -
super();
this._paletteContext = PaletteItemManager.createPaletteContext(file);
this._manager = PaletteItemManager.getInstance(_paletteContext);
Then use Palette Grouping like this -
PaletteGroup controls = new PaletteGroup("CUST HTML");
super.add(controls);
ToolEntry tool = new SelectionToolEntry("CUST Cursor",
"Cursor DESCRIPTION");
controls.add(tool);
setDefaultEntry(tool);
//Custom Marquee
controls.add(new MarqueeToolEntry("Marquee", "Marquee Desc"));
controls.add(new PaletteSeparator());
//This class maintins or load all categories features
controls.add(new CustomComponentToolEntry("Custom Component", "Custom Component Descrition",
This really is a good start but I can't find any tutorial or book that get deeper in this matter. For instance, I don't want to replace the default palette but this code does with "new PaletteRoot()" and I lost my HTML tags. Also I want that my new custom components behave as HTML Tags using Drag and Drop, but I don't know how?????????
More Info:
I discovered this code, that was very helpful, whereas file come from ((FileEditorInput)editorInput).getFile()
PaletteRoot paletteRoot = DesignerPaletteRootFactory.createPaletteRoot(file);
This is very interesting topic and I think we are pioneer documenting this feature of eclipse. Here other good point, I want to personalize the tag... e.g. something similiar what I want to achieve is add a tag like "MY TRUEFALSE TAG" and then when is selected and place it in the HTML Designer, I want to become something like <select><option>YES</option><option>NO</option></select> and I guess that I can achieve it by doing something with the tagTransformOperation extension... if you know how to implement it, please let me know. also there is others extensions(tagConverterFactory, elValueResolver). I am guessing here! please I would like your help.
<extension point="org.eclipse.jst.pagedesigner.pageDesignerExtension">
<paletteFactory ...>
<tagTransformOperation id="plugin.tagTransformOperation1XXXXXX">...
SOLUTION?? (Chinese) -solved with tagConverterFactory
http://www.blogjava.net/reloadcn/archive/2007/11/08/webeditor1.html