Himanshu
Himanshu

Reputation: 825

How can I click on image inside dynamically generated Oracle MAF List Item?

I am creating list view dynamically by using code below:

<amx:listView var="row" value="#{bindings.allMeetingsAsOrganizer.collectionModel}"
                  fetchSize="#{bindings.allMeetingsAsOrganizer.rangeSize}"
                  selectedRowKeys="#{bindings.allMeetingsAsOrganizer.collectionModel.selectedRow}"
                  selectionListener="#{bindings.allMeetingsAsOrganizer.collectionModel.makeCurrent}"
                  showMoreStrategy="autoScroll" bufferStrategy="viewport" id="panel1">
      <amx:listItem id="li1"  showLinkIcon="false"  actionListener="#{viewScope.browseMeetingsBean.onMeetingSelect}" action="toDisplayMeeting">
            <amx:tableLayout width="100%" id="tl3" cellSpacing="5">
                <amx:rowLayout id="rl1">
                    <amx:cellFormat width="40px" halign="center" id="cf2">
                        <amx:image source="images/outlook.png" id="i3" inlineStyle="height:38px;"/>
                    </amx:cellFormat>
                    <amx:cellFormat width="100%" height="43px" id="cf5">
                        <amx:outputText value="#{row.subject}" id="ot2" inlineStyle="font-size:large;margin:5px;"/>
                        <amx:outputText value="#{row.meeting_location}" id="ot3"
                                        inlineStyle="font-size:medium; margin:5px;"/>
                        <amx:outputText value="#{row.start_date_time}" id="ot7"
                                        inlineStyle="color:Teal; font-size:small;margin:5px;"/>
                        <amx:outputText value="Attendees : #{row.attendees_count_internal}/#{row.attendees_count_external}" id="ot4"
                                        inlineStyle="color:Teal; font-size:small;margin:5px;"/>
                    </amx:cellFormat>
                     <amx:cellFormat width="40px" halign="center" id="cf1">
                        <amx:image source="images/confirm.png" id="i1" inlineStyle="height:28px;"/>
                    </amx:cellFormat>
                </amx:rowLayout>
            </amx:tableLayout>
      </amx:listItem>
</amx:listView>

As you can see there is already an action listener on list item, then how can I perform any action by clicking on image inside list item?

which is :

<amx:cellFormat width="40px" halign="center" id="cf1">
 <amx:image source="images/confirm.png" id="i1" inlineStyle="height:28px;"/>

Upvotes: 1

Views: 454

Answers (1)

User404
User404

Reputation: 2192

Surround your amx:image tag with an amx:commandLink tag, on the amx:commandLink tag you can define your actionListener for the image.

Upvotes: 1

Related Questions