Hello,
I am using appFuse JSF 1.9.4. I am trying to implement some Ajax
functionalities
using DWR to one of my form.
I have a CategoryManager implementation like this.
Category Manager-------------------------------------------------------
public class CategoryManagerImpl extends BaseManager implements
CategoryManager
{
private CategoryDao dao;
public void setCategoryDao(CategoryDao dao)
{
this.dao = dao;
}
public List getCategorys(final Category category)
{
return dao.getCategorys(category);
}
public void saveCategory(Category category)
{
dao.saveCategory(category);
}
}
Category Manager end----------------------------------------------------
I created another manager to expose some functions to DWR
DWR Manager-------------------------------------------------------
public class CategoryDwrManagerImpl implements CategoryDwrManager
{
private CategoryManager categoryManager;
public CategoryManager getCategoryManager()
{
return categoryManager;
}
public void setCategoryManager(CategoryManager categoryManager)
{
this.categoryManager = categoryManager;
}
public void saveCategory(Category category)
{
categoryManager.saveCategory(category);
}
}
DWR Manager end----------------------------------------------------
Now, somebody please give me some hint on how to change the following
client-side
xhtml script to make calls to the DWR categoryManager functions.
xhtml--------------------------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:v="http://corejsf.com/validator">
<f:view>
<f:loadBundle var="text" basename="#{categoryForm.bundleName}"/>
<head>
<title>#{text['categoryDetail.title']}</title>
<meta name="heading" content="#{text['categoryDetail.heading']}"/>
<meta name="menu" content="CategoryMenu"/>
</head>
<body id="categoryForm">
<h:form id="categoryForm" onsubmit="return validateCategoryForm(this)">
<h:inputHidden value="#{categoryForm.category.id}" id="id"/>
<h:panelGrid columns="3">
<h:outputLabel styleClass="desc" for="category"
value="#{text['category.category']}"/>
<h:inputText styleClass="text large" id="category"
value="#{categoryForm.category.category}" required="true">
<v:commonsValidator type="required"
arg="#{text['category.category']}"/>
</h:inputText>
<t:message for="category" styleClass="fieldError"/>
<h:panelGroup styleClass="buttonBar bottom">
<h:commandButton value="#{text['button.save']}"
action="#{categoryForm.save}" id="save" styleClass="button"/>
<c:if test="${not empty categoryForm.category.id}">
<h:commandButton value="#{text['button.delete']}"
action="#{categoryForm.delete}"
id="delete" styleClass="button" onclick="bCancel=true; return
confirmDelete('Category')"/>
</c:if>
<h:commandButton value="#{text['button.cancel']}" action="cancel"
immediate="true"
id="cancel" styleClass="button" onclick="bCancel=true"/>
</h:panelGroup>
<h:outputText/><h:outputText/>
</h:panelGrid>
</h:form>
<v:validatorScript functionName="validateCategoryForm"/>
<script type="text/javascript">
Form.focusFirstElement($('categoryForm'));
highlightFormElements();
</script>
</body>
</f:view>
</html>
xhtml end--------------------------------------------------------
Thank you.
Sudheer P
--
View this message in context:
http://www.nabble.com/client-side-scripting-to-incorporate-DWR-tp16583502s2369p16583502.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]