I thought this should be simple but I can't seem to find the solution.

I have a datatable displayed on my page. After I successfully edit some
row, I would like to refresh a zone on my page.

This is the relevant part of my .tml file, let's say I'm trying to refresh
current time after I edited a row:

<table t:type="jquery/datatable" t:id="najdiEdiDataTable"
t:source="datasource"
                       t:row="moduleItem" t:rowIndex="index"
t:model="sourcemodel"
                       t:rowsPerPage="10" t:options="dataTableOptions" />

<t:zone t:id="boxZone" id="boxZone">
    ${getTime()}
</t:zone>



My java code:
At the end of the edit method, before I return response to re-draw
datatable with the modified objects, I'm also trying to refresh the above
zone:

@InjectComponent
@Property
private Zone boxZone;

@OnEvent(component = DATATABLE_ID, value = EVENT_EDITOR_EDIT)
    public Object edit(@RequestParameter("action") String action) throws
Exception {

        .... // edit and save object

        // refresh module box
        logger.debug("request.isXHR() = " + request.isXHR());      // this
outputs "true"
    ajaxResponseRenderer.addRender("boxZone", boxZone);

        return new TextStreamResponse("application/json",
response.toString());
}

public String getTime() {
    return new java.util.Date().toString();
}


But it seems that ajaxResponseRenderer.addRender("boxZone", boxZone);
doesn't do anything. Am I missing something? Isn't it that simple?

Regards,
Lidija

Reply via email to