Shikha bajpai

Greenhorn
+ Follow
since Aug 04, 2014
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Shikha bajpai

Hi Rafael

Thanks for your reply. But I am using Hibernate3 jar which is not having ColumnTransformer annotation class. I can't use Hibernate 3.6.0 jar as this will impact current Project structure. Is there any other way to resolve this issue. Please help me.

Also first one also I tried, but still in same condition.

Thanks
Shikha
Hi All,

I am using Hibernate 3.0, JPA (spring-orm-3.0.3.RELEASE.jar) and Oracle 11G for our project. Project is running in JBOSS 5.1.0GA.

In Oracle we are having one table ( EP) with one COlumn as XMLTYPE datatype.

In JPA Entity defined as with XMLTYPE column type:



when I am running this code always getting below exception:


Can you please let me know what the problem in mapping. I am not getting the issue and its resolution.

Persistence.xml is having dialect and JPA as below:

<properties>
<!-- Transaction integration -->
<property name="hibernate.transaction.factory_class"
value="org.hibernate.ejb.transaction.JoinableCMTTransactionFactory" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup" />
<property name="jboss.entity.manager.factory.jndi.name"
value="persistence-units/JpaPersistence" />
<property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
<property name="hibernate.hbm2ddl.auto" value="validation" />

</properties>
</persistence-unit>
</persistence>

Thanks


Above code is always showing date as "31-Oct-2014 10:28:57 AM GMT". I want to display this in "31-Oct-2014 10:28:57 AM EDT". Please help to know the solution.
10 years ago
JSF
Hi Tim, I was using data model earlier, but as not getting rows in page I removed them to check what is actual issue. Now I am only trying to put simple datatable, where I coded as below. Till application Id code is running fine but <h:outputText where I put hardcoded value is not coming up. In Page source I can see <tbody> is coming blank :(

10 years ago
JSF
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">

<f:loadBundle basename="MessageResources" var="msgs" />
<h:form id="ntfnReportTable" style="border:1">
<h:panelGrid columns="1" width="100%" id="notificationSearchTableGrid"
border="0">
<rich:panel styleClass="panelNoBorder">



<rich:dataTable>

<f:facet name="header">
<h:outputText value="#{msgs.logSearch_listOfSuccess}" />
</f:facet>

<f:facet name="header">
<rich:columnGroup>
<h:column>
<h:outputText styleClass="headerText" value="Make" />
</h:column>
<h:column>
<h:outputText styleClass="headerText" value="Model" />
</h:column>
<h:column>
<h:outputText styleClass="headerText" value="Price" />
</h:column>
<h:column>
<h:outputText styleClass="headerText" value="Mileage" />
</h:column>
</rich:columnGroup>
</f:facet>

<h:column>
<h:outputText value="Process" />
</h:column>
<h:column>
<h:outputText value="Application Id" />
</h:column>
<h:column>
<h:outputText value="Component ID" />
</h:column>
<h:column>
<h:outputText value="Dev" />
</h:column>
</rich:dataTable>





</rich:panel>
</h:panelGrid>
</h:form>
</ui:composition>

I tried many times but always getting only Table Header. Above file is called from below file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">

<!--
Replace path to template, title, header and body
with actual data.
-->
<ui:composition template="../../WEB-INF/template/common.xhtml">
<ui:define name="title">WILEY(Knowledge For Generations)</ui:define>
<ui:define name="header">
<ui:include src="../../WEB-INF/template/header.xhtml" />

</ui:define>
<ui:define name="menu">
<ui:include src="../../WEB-INF/template/menu.xhtml" />
</ui:define>
<ui:define name="body">
<f:loadBundle basename="MessageResources" var="msgs" />
<div align="center">
<h:outputLabel value="#{msgs.menu_dashboardAll}"
styleClass="homePageText2" />
</div>
<ui:include src="overAllTxnVolTable.xhtml" />
</ui:define>
<ui:define name="footer">
<ui:include src="../../WEB-INF/template/footer.xhtml" />
</ui:define>
</ui:composition>

</html>

Please help not getting what is the actual error.. no error is on view or console
10 years ago
JSF



Will above work..
10 years ago
JSF

Tim Holloway wrote:I do not recommend using actionListeners. They have a purpose, but it is so specialized that I cannot recall a single webapp I've ever done in JSF that required one. An action method is POJO, and thus less platform-specific.

Besides, when using RichFaces 4, the a4j tags are supplanted by JSF2 f:ajax tags, and the f:ajax listener is a completely different construct than an actionListener, and sends a completely different parameter. So avoid confusion.

The reason why your updated data isn't being seen is because you didn't tell the View to refresh its data after the ajax process. Use the reRender a4j:commandButton attribute to indicate what elements of the View should be re-rendered (updated) after the ajax call is done.




Hi Tim, Thanks for your answer, but problem here is that what to reRender. loadOTVsubmit method will update one bean property, this updated bean property is passed to Javascript function which is using value of this to update Google chart. So I am not getting wht to reRender here in this case.


Please help to understand re can I put reRender="data" in below code.

<h:commandButton
value="#{msgs.notification_searchNotificationReportLbl}"
id="searchNotificationRptBtn" styleClass="controlButtonActive"
actionListener="#{dashboardCtrl.loadOTVsubmit}">
<a4j:jsFunction name="createEventpie" data="#{pieChartMBean.pieData}" oncomplete="drawChartsub(data);">
</a4j:jsFunction>
</h:commandButton>
10 years ago
JSF
Hi,

I need help to get updated bean property in javascript function. This function I am calling from <a4j: commandbutton> this button is having actionListner, which is updatin bean property based on some User selection. When this action is completed then I am calling javascript function in oncomplete. But that javascript function is not taking updated bean value, it is always taking first value. Please help me, I can't use hidden text as there are some drop downs which User will selct and then hit commandbutton which will update bean property.

<div align="center">
<a4j:commandButton
value="#{msgs.notification_searchNotificationReportLbl}"
id="searchNotificationRptBtn" styleClass="controlButtonActive"
actionListener="#{dashboardCtrl.loadOTVsubmit}"
oncomplete="drawChart();"


/>
</div>

<script type="text/javascript">
//bc udefined error solution
Array.prototype.reduce = undefined;
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {
'packages' : [ 'corechart' ]
});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Alert
alert("In Drawchart function"+#{pieChartMBean.pieChartData});
// Create the data table.
var data = google.visualization.arrayToDataTable([
[ 'Country', 'Area(square km)' ],
#{pieChartMBean.pieChartData}
]);

// Set chart options
var options = {
'title' : 'Overall Transaction Volume',
is3D : true,
pieSliceText : 'label',
tooltip : {
showColorCode : true
},
'width' : 900,
'height' : 500
};

// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document
.getElementById('chart_div'));
chart.draw(data, options);
}
10 years ago
JSF
Hi Tim,

that is having "session" scope. Actually we want to implement the code in following way using JSF, Ricfaces:

1. User will see dropdown list in UI. He will select one iten from Dropdown and submit the selection.
2. This selection will be saved in dashboardCtrl bean, which is further used by DAO layer to get the count of records.
3. These count of records need to pass in CHart method which in turn return the graph.

In below code during time of Hit to VIew chart button selected data is getting stored in dashBoardCtrl bean and then in mediaOutput calling the Chart creator method.

This is required to refresh the chart based on User selected values, that is te reason used Re-render. Now don't know this is the correct way or not

Please help me to know.

10 years ago
JSF

Hi All,

I need Urgent help in JSF, RichFaces, Jfree chart. I am new for these technolgies.

I am having form which is having some drop down menu and one submit button. Suppose I selected 'A' from dropdown this selection pass to Java code based on which DAO layer will return row counts. This count is passed in Jfree Pie chart method to create a Pie chart. In UI I need to display this chart in second Panel of same Dropdown page. UI is developed with RichFaces. Code is as below for UI:

<h:form id="txnDashBoardDataForm" style="border:0">
<rich:panel>

<div align="center">
<a4j:commandButton value="View Chart" id="searchButton"
styleClass="controlButtonActive"
reRender="resultPanelId"
actionListener="#{dashboardCtrl.loadTxnCount}"
oncomplete="if(#{facesContext.maximumSeverity != null}){
#{rich:component('InfoMessagePopUp')}.show();
}else{ } " />
</div>
</rich:panel>

<a4j:outputPanel id="resultPanelId" ajaxRendered="true">
<rich:panel>

<a4j:mediaOutput style="width:200px;height:200px;" element="img"
cacheable="false" session="true" createContent="#{dashboardCtrl.loadTxnCounts}"
mimeType="image/gif" />
</rich:panel>
</a4j:outputPanel>


In above code in <a4j:commandButton> I used reRender attribute, which is having same id as given in <a4j:outputPanel id="resultPanelId" ajaxRendered="true">. If I am first time loading page then I can see Pie chart is coming on UI this is due to <a4j: mediaOutput createContent attribute where I am calling the function which is calling Chart creation function. But if I am selection one item from Drop down and then submitting the Form chart is not getting displayed. Though in console I can see Graph method is called, but then some Decode error is coming :

ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
javax.faces.FacesException: Error decode resource data

Please help me to know how I can display Pie chart after submitting form. As of now I only know that richfaces mediaOutput I can use. Please help on urgent basis.
10 years ago
JSF