You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Neal Haggard <Ne...@sas.com> on 2005/03/31 20:11:07 UTC
Jscookmenu - ThemeOffice - Images not displaying?
I'm attempting to use the jscookmenu as an actionmenu in a table, to allow table actions per row. When I click on the link in the second column (to call #{selectContactBean.overview}, it properly chooses the correct row from the dataTable, but when choosing the #{selectContactBean.overview} action from the x:jscookMenu, it does not. Any ideas why this isn't working, and more importantly how I can fix it so I can do this?
Here's a snippet of my JSP:
<h:dataTable value="#{selectContactBean.myContacts}"
var="contact"
binding="#{selectContactBean.contactTable}">
<h:column>
<x:jscookMenu layout="hbr" theme="ThemeOffice" >
<x:navigationMenuItem id="showActions" icon="#{resources['actions.showActions.image']}" itemLabel=" ">
<x:navigationMenuItem id="overview" icon="#{resources['actions.overview.image']}"
itemLabel="#{resources['actions.overview.txt']}" action="#{selectContactBean.overview}"/>
<x:navigationMenuItem id="copy" icon="#{resources['actions.copy.image']}"
itemLabel="#{resources['actions.copy.txt']}" action="copy" />
<x:navigationMenuItem id="delete" icon="#{resources['actions.delete.image']}"
itemLabel="#{resources['actions.delete.txt']}" action="delete" />
<x:navigationMenuItem id="summary" split="true" icon="#{resources['actions.summary.image']}"
itemLabel="#{resources['actions.summary.txt']}" action="summary" />
</x:navigationMenuItem>
</x:jscookMenu>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{resources['column.contacts.contact.txt']}" />
</f:facet>
<h:commandLink action="#{selectContactBean.overview}">
<h:outputText value="#{contact.name}" />
</h:commandLink>
</h:column>
</h:dataTable>
Here's a piece of my selectContactBean:
/**
* Handle retrieving & selecting contacts from a user's contacts.
*/
public class SelectContactBean extends AbstractBaseBean {
/** UIData object so we can see what row was selected. */
private UIData contactTable;
/**
* Get the contact table
*
* @return Returns the contactTable.
*/
public UIData getContactTable() {
return contactTable;
}
/**
* Set the contact table.
*
* @param contactTable The contactTable to set.
*/
public void setContactTable(UIData contactTable) {
this.contactTable = contactTable;
}
/**
* Get a list of the user's contacts.
*
* @return A List holding all the contacts for the current user.
*/
public List getMyContacts() {
return getVisit().getUser().getContacts();
}
/**
* Get the contact that was selected and, if successful, navigate to the
* overview page for that contact.
*
* @return Navigation outcome string
*/
public String overview() {
return getContact();
}
/**
* Use the contactTable UI component to get the selected contact. Verify
* they are still in the datastore and set the contact as the current
* contact.
*
* @return Navigation outcome string
*/
public String getContact() {
FacesContext facesContext = getFacesContext();
// Get the selected row as a Contact
Contact contact = (Contact) contactTable.getRowData();
// Set the current contact on our visit
getVisit().setCurrentContact(contact);
// Success
return Constants.SUCCESS_OUTCOME;
}
}