# Image Size control

## Links in Photo Album Demo. Using the <a4j:commandLink>

The main difference between <h:commandLink> component is a) Ajax request that is generated on a click and b) dynamic rerendering of the page after a response comes back. It's not necessary to plug any support into the component, as Ajax support is already built-in.

The <a4j:commandLink> component is used widely in the application. In the following example clicking on the <Edit> link will rerender the main ares (watching area) of the application and open an album edit form. Each album has its owner and only owner can edit the album contents. The link <Edit> will be rendered only if the current logged-in user is the owner of this album: the "rendered" attribute refers to the owner id and compares it with the current user id:

    ...
    <a4j:commandLink rendered="#{model.selectedAlbum.owner.id == user.id}"
                value="#{messages['album.edit']} "
                actionListener="#{controller.startEditAlbum(model.selectedAlbum)}"
                reRender="mainArea">
    </a4j:commandLink>
    ...

The <value> attribute (text that will appear on the link) is picked up from the `messages_en.properties` file. Such property files are very useful e.g. for multi language applications. Each property is saved in the format "name—value". Let's have a look at this file in the JBDS:

Image size control