Hi, I think it would be much better to use a css class for the email icon and
for any other icons that are just repeated. 

Maybe another improvement would be to just use a single ajaxbehaviour for
the whole table that corresponds to a certain action like, for example in
case of a "Delete", keep an itemid for the whole line and have js logic that
intercepts the clicks on the icons and call the behaviour with the line id,
something like. 

        AbstractDefaultAjaxBehavior itemDeleteBehavior = new
AbstractDefaultAjaxBehavior() {

            @Override
            protected void respond(AjaxRequestTarget target) {
                String id =
RequestCycle.get().getRequest().getRequestParameters().
                        getParameterValue("id").toString();
                //do delete logic with item ID. Just be careful that
malicious users exploit it by passing items of other users.

            }

            @Override
            protected void updateAjaxAttributes(AjaxRequestAttributes
attributes) {
                super.updateAjaxAttributes(attributes);

                attributes.getDynamicExtraParameters().add("return { 'id':
itemid }");
            }

            @Override
            public void renderHead(Component component, IHeaderResponse
response) {
                AppendingStringBuffer js = new AppendingStringBuffer();
                js.append("function deleteItem(itemid)
{").append(getCallbackScript()).append("}");

                response.render(JavaScriptHeaderItem.forScript(js,
"deleteItem"));
            }
        };
        add(itemDeleteBehavior);

then on the clientside js have something like: 
$(".actions_delete").click(function(event){
        deleteItem($(this).prop("id_to_remove"));
});

This way you'd keep the page size sent to the client small(there would not
be a big url for each icon link). Smaller pagesize, means faster transfer
and less data for the browser to parse and render. You get a bonus also in
simple component hierarchy because you don't even need to have a java
component for the links. 
The same for other "common" behaviours like edit, etc.

Hope it helps.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Lots-of-Images-slowing-rendering-in-DataView-tp4665733p4665735.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to