Angelo.Hannes
Angelo.Hannes

Reputation: 1729

update form on commandlink click in adf

I am new to the whole oracle adf thing. So please excuse me for this question.

In my JSP page I got a tabel and above it is a view. The view should display details, when I click on a commandlink in the tabel. But how can I invoke the loadData of the form on click of the commandlink.

Here is the layout for clarification:

<h:form>
    <tr:panelHeader text="Browse" styleClass="af_m_toolbar" size="-1"/>
    <tr:panelFormLayout>
        <tr:panelLabelAndMessage label="#{bindings.name.hints.label}">
            <tr:outputText value="#{bindings.name.inputValue}"/>
        </tr:panelLabelAndMessage>
        <tr:panelLabelAndMessage label="#{bindings.id.hints.label}">
            <tr:outputText value="#{bindings.id.inputValue}"/>
        </tr:panelLabelAndMessage>
        <tr:panelLabelAndMessage label="#{bindings.salary.hints.label}">
            <tr:outputText value="#{bindings.salary.inputValue}"/>
        </tr:panelLabelAndMessage>
    </tr:panelFormLayout>
    <tr:table value="#{bindings.emp.collectionModel}" var="row" rows="#{bindings.emp.rangeSize}"
              emptyText="#{bindings.emp.viewable ? 'No data to display.' : 'Access Denied.'}"
              width="100%" inlineStyle="width:100%">
        <tr:column sortProperty="#{bindings.emp.hints.name.name}" sortable="false" inlineStyle="width:100%">
            <tr:outputText value="#{row.bindings.name.inputValue}" styleClass="af_m_listingLink"/>
            <tr:outputText value="ID: #{row.bindings.id.inputValue} Salery: #{row.bindings.salary.inputValue}"
                           styleClass="af_m_listingDetails"/>
        </tr:column>
    </tr:table>
</h:form>

I am using Oracle JDeveloper 11g R2. This should become a adf mobile browser application, therefore I am only using trinidad components.

Thanks for your help Angelo Hannes

Upvotes: 0

Views: 1616

Answers (2)

lokoko
lokoko

Reputation: 5803

You would have to use ppr. You can set the partialPageRefresh to true and give the component Id which would trigger this component to get refreshed. Something like :

<tr:panelLabelAndMessage label="#{bindings.name.hints.label}" id="pl1">
    <tr:outputText value="#{bindings.name.inputValue}"/>
</tr:panelLabelAndMessage>
<tr:panelLabelAndMessage label="#{bindings.id.hints.label}">
    <tr:outputText value="#{bindings.id.inputValue}" partialTriggers="pl1"/>
</tr:panelLabelAndMessage>

This would mean the component2 would get refreshed when component1 changes.

Upvotes: 0

Timo Hahn
Timo Hahn

Reputation: 2496

Try to use PartialPageRefresh (http://myfaces.apache.org/trinidad/devguide/ppr.html) on your form. For this you add the link id as partialTriggers to the form or panelFormLayout. This is how it works in ADF, never tested this in Trinidad.

Upvotes: 0

Related Questions