BTW, This has been on tacos for 2 months now
http://svn.sourceforge.net/viewvc/tacos/tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/components/dojo/form/
and
http://tacos.sourceforge.net/tacos4.1/tacos-core/quick-start/downloading.html


On 4/18/07, Steve Shucker <[EMAIL PROTECTED]> wrote:

My company needs one too.  We wrapped the dojo Editor2 component.  I
helped someone get a quick demo of this working a few weeks ago, but I
don't know if it's 100%.  If you're using version 4.1.1, you're welcome
to use this.

-Steve

DojoEditor.java:

import java.util.HashMap;
import java.util.Map;

import org.apache.tapestry.form.AbstractFormComponent;
import org.apache.tapestry.IMarkupWriter;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.IScript;
import org.apache.tapestry.PageRenderSupport;
import org.apache.tapestry.TapestryUtils;
import org.apache.tapestry.annotations.ComponentClass;
import org.apache.tapestry.annotations.InjectScript;
import org.apache.tapestry.annotations.Parameter;

@ComponentClass(allowBody=true)
public abstract class DojoEditor extends AbstractFormComponent {

    @Parameter(required=true)
    public abstract String getValue();
    public abstract void setValue(String value) ;

    @InjectScript("DojoEditor.script")
    public abstract IScript getScript();

    /**
     * @see
org.apache.tapestry.form.AbstractFormComponent#renderFormComponent(
org.apache.tapestry.IMarkupWriter,
     *      org.apache.tapestry.IRequestCycle)
     */
    protected void renderFormComponent(IMarkupWriter writer,
IRequestCycle cycle) {
        PageRenderSupport pageRenderSupport =
TapestryUtils.getPageRenderSupport(cycle, this);

        Map<String,Object> symbols = new HashMap<String,Object>();
        symbols.put("id", getClientId());
        symbols.put("formId", getForm().getClientId());
        getScript().execute(this, cycle, pageRenderSupport, symbols);

        renderDelegatePrefix(writer, cycle);

        writer.begin("textArea");
        writer.attribute("style","width:700px; height:200px");
        renderIdAttribute(writer, cycle);
        writer.attribute("name", getName());
        renderInformalParameters(writer, cycle);
        renderBody(writer, cycle);
        writer.printRaw(getValue());
        writer.end();
        renderDelegateSuffix(writer, cycle);
    }

    /**
     * @see
org.apache.tapestry.form.AbstractFormComponent#rewindFormComponent(
org.apache.tapestry.IMarkupWriter,
     *      org.apache.tapestry.IRequestCycle)
     */
    protected void rewindFormComponent(IMarkupWriter writer,
IRequestCycle cycle) {
        setValue(cycle.getParameter(getName()));
    }

}

DojoEditor.script:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE script PUBLIC
    "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"
    "http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd";>

<script>
    <input-symbol key="id" class="java.lang.String" required="yes"/>
    <input-symbol key="formId" class="java.lang.String" required="yes"/>
    <body>
        <unique>
            dojo.require("dojo.widget.Editor2");
            dojo.require("dojo.widget.Editor2Plugin.DialogCommands");
            dojo.require("dojo.widget.Editor2Plugin.ColorPicker");
        </unique>
    </body>
    <initialization>
        dojo.widget.createWidget("Editor2", {id: "${id}_widget"},
dojo.byId('${id}'));
        dojo.event.connect(dojo.byId('${formId}'), "onsubmit", function ()
{
            dojo.byId('${id}').value =
dojo.widget.getWidgetById("${id}_widget").getEditorContent()
        })
    </initialization>
</script>



Nick Westgate wrote:
> Hi James.
>
> I haven't used it, but perhaps:
>
http://www.tapestrycomponents.org/Tassel/app?service=external/ViewComponent&sp=SHtmlArea
>
>
> There are also several for T4 on Tassel.
>
> Cheers,
> Nick.
>
>
> James Sherwood wrote:
>> Hello,
>>
>> I am looking for a Rich Text Editor component for tapestry that is
>> compatable with (or maybe i could modify) Tapestry 3 and all large
>> browsers.
>>
>> If someone could point me in the right direction that would be great.
>>
>> I have tried creating my own and have been successfull in everything
>> except getting the information from the RTE to come out in the form
>> submit, it is always null.
>>
>> Any help would be greatly appreciated.
>>
>> --James
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

Reply via email to