well there are usually 2-3 ways in dojo as far as I could find out how to pass the dojo params. First of all the way you described it, but that breaks (x)html validation. Except for a few components there usually is another way:
here is an excerpt from the docs: http://dojotoolkit.org/docs/rich_text.html var editorArgs = { items: ["bold", "italic", "underline", "strikethrough"] }; var editor = dojo.widget.fromScript("Editor", editorArgs, dojo.byId("contentNode")); I found out that this breaks the getWidgetFromId method, unless you also specify an id in the args a valid statement with an identifyable id would look like that: the origianl contentNode would look like <input type="textArea" id="contentNode"/> or <div type="textArea" id="contentNode"/> <script type="text/javascript"> <!-- var editorArgs = { id:"theinternaldojoid", items: ["bold", "italic", "underline", "strikethrough"] }; var editor = dojo.widget.fromScript("Editor", editorArgs, dojo.byId("contentNode")); //--> </script> or something very similar to it (I worked originally around the problem by keepding the editor reference. But I think you get the idea.... This works with most components, but some do not work (the debug console for instance, but that one is important only for development, so I did not really care when I implemented the binding) Werner Mike Kienenberger schrieb:
Werner, Can you provide an example of how to specify the "items" line for those of us who are javascript-ignorant? I'd really like to remove the "save/cancel" buttons since these don't work well with JSF and just confuse the end-user. I was hoping that facelets would just pass them through by default, but it doesn't work that way in facelets either. <h:inputTextarea id="contentHtmlEditArea" styleClass="dojo-Editor" items="textGroup;blockGroup;justifyGroup;colorGroup;listGroup;indentGroup;linkGroup" required="#{true}" value="#{text}"/> On 2/13/06, Werner Punz <[EMAIL PROTECTED]> wrote:The reason, Dojo uses some optional extra attributes on taglevel which you cannot provide in plain jsf. What would be needed would be some kind of additionalString or someting attribute to provide those. As for component development not to break the valid html/xhtml I would recommend to go the programmatic control generation upon existing tags: var editorArgs = { items: ["bold", "italic", "underline", "strikethrough"] }; var editor = dojo.widget.fromScript("Editor", editorArgs, dojo.byId("contentNode")); as an example which would work on any normal div or textArea and still would be valid html. Going this route: <textarea dojoType="Editor" name="editorContent" items="bold;italic;underline;strikethrough;"> some content </textarea>
