org.chenillekit.tapestry.core.components.InPlaceEditor

a "just in place" edit component that dont must emmbedded in a form.

[JavaDoc]

Component Parameters

Name Type Flags Default Default Prefix Description
clientId String NOT Allow Null prop:componentResources.id literal The id used to generate a page-unique client-side identifier for the component. If a component renders multiple times, a suffix will be appended to the to id to ensure uniqueness. The uniqued value may be accessed via the clientId property.
context java.util.List NOT Allow Null prop The context for the link (optional parameter). This list of values will be converted into strings and included in the URI.
size String NOT Allow Null 20 literal Size of the input text tag.
value String Required, NOT Allow Null prop The value to be read and updated. This is not necessarily a string, a translator may be provided to convert between client side and server side representations. If not bound, a default binding is made to a property of the container matching the component's id. If no such property exists, then you will see a runtime exception due to the unbound value parameter.

Informal parameters: supported

Examples

This sample describe the implementation of the InPlaceEditor in a grid component.

MyPage.java

this is a sample code sequence of the page class
                    

    @Component(parameters = {"source=trackList", "row=track", "model=beanModel"})
    private Grid _grid;

    @Component(parameters = {"value=track.title", "context=track.id", "size=30"})
    private InPlaceEditor _inPlaceEditor;

    void pageLoaded()
    {
        _beanModel = _beanModelSource.create(Track.class, false, _resources);
        _beanModel.exclude("genre", "playCount", "rating", "album");
        _trackList = _musicLibrary.getTracks();
    }

    @OnEvent(component = "inPlaceEditor", value = InPlaceEditor.SAVE_EVENT)
    void actionFromEditor(Long rackId, String titleValue)
    {
        Track track = _musicLibrary.getById(rackId);
        track.setTitle(titleValue);
    }

                

MyPage.tml

this is a sample code sequence of the page template
                    
    <div t:id="grid">
        <t:parameter name="titleCell">
            <div t:id="inPlaceEditor" size="20"/>
        </t:parameter>
    </div>

                

Back to index