How can i display collection of records in HTML Table using DWR framework
Dear All,
Just i start using the Direct Web Remoting framework.I am worrying to get the list of records to display html table using this concept.I did the same like.
index.js
var cellFuncs = [
function(data) { return data; },
function(data) { return data.toUpperCase(); },
function(data) { return "<input type='button' value='Test' onclick='alert(\"Hi\");'/>"; },
function(data) { return count++; }
function update() {
var name = dwr.util.getValue("demoName");
Demo.sayHello(name, function(data) { dwr.util.setValue("demoReply", data); } );
var count = 1;
dwr.util.addRows( "tabs",[ 'Africa', 'America', 'Asia', 'Australasia', 'Europe' ], cellFuncs);
alert("hai");
index.jsp
<!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">
<head>
<script type='text/javascript' src='dwr/engine.js'> </script>
<script type='text/javascript' src='dwr/util.js'> </script>
<script type='text/javascript' src='dwr/interface/Demo.js'> </script>
<script type="text/javascript" src='index.js'> </script>
</head>
<body>
<div id="tabContents">
<div id="demoDiv">
<p>
Name:
<input type="text" id="demoName" value="Joe"/>
<input value="Send" type="button" onclick="update()"/>
Reply: <span id="demoReply" style="background:#eeffdd; padding-left:4px; padding-right:4px;"></span>
<table id="tabl1">
<tbody id="tabs">
<tr>
<td>name</td>
<td>name1</td>
<td>name2</td>
<td>name3sdf</td>
</tr>
<tbody>
</table>
</p>
</div>
</div>
</body>
</html>
dwr.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://getahead.org/dwr/dwr20.dtd">
<dwr>
<allow>
<!-- simpletext -->
<create creator="new" javascript="Demo">
<param name="class" value="org.getahead.dwrdemo.simpletext.Demo"/>
</create>
</allow>
</dwr>
web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="dwr">
<display-name>DWR (Direct Web Remoting)</display-name>
<description>A Simple Demo DWR</description>
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<display-name>DWR Servlet</display-name>
<description>Direct Web Remoter Servlet</description>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>activeReverseAjaxEnabled</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>initApplicationScopeCreatorsAtStartup</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>maxWaitAfterWrite</param-name>
<param-value>500</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
</web-app>
Demo.java
package org.getahead.dwrdemo.simpletext;
import java.io.IOException;
import javax.servlet.ServletException;
import org.directwebremoting.WebContext;
import org.directwebremoting.WebContextFactory;
public class Demo
public String sayHello(String name)
return "Hello, " + name;
the sayHello() is printing the display.But the table rows not updating.But its object expected.So can you tell me where i need to change and how to add the pagination for the table like 10 by 10 records to display.
Please help me.
Saravanan
Hi Brian,
OAF supports the master-detail based design. You can very well implement your model. You can use 2 VO for your 2 objects and link them using a ViewLink. Check OAF Dev guide for more details.
--Shiv
Similar Messages
-
How can i get all the records from three tables(not common records)
Hi
I have four base tables at R/3-Side. And i need to extract them from R/3-Side.
And i dont have any standard extractor for these tables .
If i create a 'View' on top of these tables. Then it will give only commom records among the three tables.
But i want all the records from three base tables (not only common).
So how can i get the all records from three tables. please let me know
kumarYou can create separate 3 datasources for three tables and extract data to BW. There you can implement business login to build relation between this data.
-
how can we display svg files in flex at runtime using FileReference? Actually we are trying to load the svg file from the local directory.
This should give you the JRE version;
System.out.println(System.getproperty("java.version"));
and this should tell you where its running from;
System.out.println(System.getProperty("java.home"));
There are loads more system properties, check the JDK documentation for java.lang.System and look at the getProperties method which has a list.
Stewart -
How can I display Excel document saved as html in ebDynpro Office Contol?
Hello,
I have a problem with displaying of Excel document saved as html inside WebDynpro Office Control.
Could you explain why OfficeControl cannot display Excel document with content type =text/htm?
How you know, control must be bound to binary data. And then mime type is set as
bin.setMimeType(new WebResourceType("html", "text/html", false));
The empty document is displayed always.
Nevertheless, excel file is displayed perfect, when
bin.setMimeType(new WebResourceType("xls ", "application/msexcel", false));The OfficeControl UI element is made available as an ActiveX control, so that the UI element can be displayed in browsers that support ActiveX controls.
The ActiveX control enables display of the following documents:
1.Microsoft Word documents with the doc file extension
2.Microsoft Excel documents with the xls file extension
This is the reason why document with other content types are not displayed.
Data source must be bound to binary data because files are read as bytes in this scenario.
Hope this helps you.
Do let me know if your problem is solved.
Regards,
Vijith -
How can I make sure my record insert to table was successful?
Here is the insert statement:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:MyDB", "", "");
String queryStr = "INSERT INTO MyTable(a,b) VALUES(?,?)";
PreparedStatement pstmt = con.prepareStatement(queryStr);
pstmt.setString(1,strFirst);
pstmt.setString(2,strSecond);
pstmt.executeUpdate();
How can check that record has been inserted properly?
thanks
YahyaIt is working.
Here is the code:
int result;
result = pstmt.executeUpdate();
if (result != 1) {
System.out.println("Success Insertion");
thanks
Yahya -
How to call webservice for each record in a table using ODI
Hi
I am new to ODI and Webservice. I want to invoke a scenario in ODI using web service. I hava a weblogic application server with axis 2 deployed.
But I want call webservice for each record in a table
For eg: "EMP" table have 50 records, for each record web service should invoke
Can any one help me on it.
Thanks,
phani
Edited by: user12774166 on Jun 6, 2010 11:16 PMIf your goal is "call" a web service, Jason's Straub's [flex-ws-api|https://flex-ws-api.samplecode.oracle.com/] is by far the best I've seen. You might want read more about it on [his blog|http://jastraub.blogspot.com/search?q=+flex_ws_api+].
Tyler Muth
http://tylermuth.wordpress.com
[Applied Oracle Security: Developing Secure Database and Middleware Environments|http://sn.im/aos.book] -
How can i store a picture file in a table using sql
can anyone help me
to store a pic file in a table using sqlYou can find an example in this link
http://www.orafaq.com/forum/t/38347/0/ -
How can I display the elapsed time of the course using Advanced Actions in Captivate?
I have a Captivate course which is approximately 35 minutes in length. On each slide I would like to display to the user, the current elapsed time.
EXAMPLE:
25/35 minutes complete
The 35 would remain static, so I have been working with the elapsed time system variable in CP: elapsed:$$cpInfoElapsedTimeMS$$
I can't seem to get the variable to properly display the elapsed time in minutes, rather than miliseconds. Attached is a screen shot of my advanced action.
Can anyone provide guidence regarding how I should structure this differntly?I talked about that Timer widget in that blog post and pointed to another one:
http://blog.lilybiri.com/timer-widget-to-stress-your-learners
If you are on CP7, you'll have this widget also as an interaction, which means it is compatible with HTML5 output. Amd there is also an hourglass interaction, with similar functionality but... did not blog about that one
PS: Check Gallery\Widgets to find all widgets. Default path is set to Interactions -
How can i display 7 segment dispay on front panel using any kind of input
Hi,
I need help..!! I need to dispay the numeric data in 7 segment format. Is it possible to do in labview?you need to display the number onto a 7 segment display?
i think you would need sometype of microcontroller board like the AVR or the aurdino. and use the visa usb port to display out into the 7 segment display.
i am new to this too. but that's what i would do.
i hope someone with more expertise can give better advice.
Arduino and 7 Segment LED
7 Segment LED
The
seven segment display is a pretty simple device. Its actually just 7
LEDs (8 really including the decimal point) arranged so different
combinations can be used to make numerical digits. This tutorial will
show you how to wire one up and drive it with an Arduino.
Message Edited by krispiekream on 07-23-2009 11:48 AM
Best regards,
Krispiekream -
How can i display data from mysql (cant do it using netbeans)
im confused with changing ResultSet-->List->Array;
i already done displaying a data table from mysql but im lost on how to display mysql rows to ComboBoxes and JLists...
im new here.
how does the setModel() work?
i hate this GUI stuff.. = (
thanks...im new here.
how does the setModel() work?
i hate this GUI stuff.. = (You claim you have JDBC working already, if I understand your post correctly. So you're asking a question about GUIs in the JDBC forum. Not a good strategy. Try the Swing forum. -
How can I display sort icons of an af:table column permanently
Hello all,
I'm using JDEV 11.1.1.5. Is there a way using skinning or any other mean to make the sort icons of a column in a af:table to be displayed permanently and not only after a mouse over on the column title?Can you try with skinning?
Check the forum post:
Column Sort image display permanent
Thanks,
Navaneeth -
How can I find number of columns in a table using a query
Hi
I want to find the number of columns in a table using a query.
Any help in this regard is much appreciated.
CheersHi,
This is the output i get when i executed ur query
OWNER OBJECT_NAME OBJECT_TYPE
SMLDBO T2311_SURVEY_QUESTIONS TABLE
select OWNER,OBJECT_NAME,OBJECT_TYPE
from all_objects
where OBJECT_NAME = 'T2311_SURVEY_QUESTIONS';
works Fine.
But if i use the below query it returns : 0
SELECT count(*) FROM user_tab_columns
WHERE table_name =upper( 'T2311_SURVEY_QUESTIONS');
What could be problem.
The table exists + name of the table is correct + it resides in my schema itself.
Any guess !!! -
How can one display 1 record at a time
How can one display a single record at a time.
The next record should be displayed on the press of a button.
Thanks in advanceVijaya,
I have 3 regions, each contains a check box item,
the label for which is dynamicaly generated through a SQL Select.
( &P1_ANSWER1. P1_ANSWER1 is the hidden item name)
In the Region Source,
I have put
SELECT col1 from (SELECT col1, row_number() over(ORDER BY col1) row_number from prototype) WHERE row_number = :P1_QUESTION_NO;
SELECT col3 from (SELECT col3, row_number() over(ORDER BY col3) row_number from prototype) WHERE row_number = :P1_QUESTION_NO;
for each of the reqion that contains these items,
Here the table is prototype and P1_QUESTION_NO is the hidden item.
As directed I have included under Processes (after submit and computations) on button "Next Record" clicked:
:P1_QUESTION_NO := ::P1_QUESTION_NO + 1;
When I am doing this, the label seems to blank out.
Thanks
Message was edited by:
faq123 -
How can I display contacts in a relationship
I have companies in my CRM. I have a customers/contacts in the CRM I have tied as a relationship with each companies. How can I display all the records/contacts associated with a company? I have a already created a secure zone, so the company user would have logged in. Is this possible? If not, any workaround?
The only workaround I thought of is to use webapp to import the company data and create another web app containing the employees data. Then link both tables/webapp using datasource. But the way the client's data is structured could create a lot of problems going forward.
Any suggestion, help will be appreciatedThe relationship feature and how companies work currently in BC is really limited. It is an association and not true relationships at the moment. You cant output a company and show all its relationships at the moment.
-
How can i display the values in the vector in a jsp using jstl
in a task i am recieving a vector in a jsp... how can i display those vector values in the jsp using jstl.... plz help me
thanks in advance<%
here you got vector say; v
pagecontext.setAttribute("varname",v);
%>
<c:forEach var="i" items="${varname}">
<c:out value="${i}">
</c:forEach>
Maybe you are looking for
-
How to include input user parameter values in XML report output?
How can i include input user parameter values in XML report output. I a have a report which can be run by providing start date and end date. I would like to include value of these parameters in XML output to enable me to figure out dates for report,
-
I would like to send an email with a link to an app I found on the App Store. How can I do that?
-
What's iOS is the best performance for iP4 & 3Gs
Hi all guys here. How are you all guys? I'm new here. I'm now running IOS 4.1 for my both iPhone(3Gs and 4) But i want the new features. Can anyone here recommend me what the best IOS for iP3Gs and iP4? ( d best performance ) Without battery draining
-
All images would still remain as referenced files on the NAS. (There are no managed files for my setup). Thanks so much David
-
Embarrassed to say, but I dropped my iphone into a glass of red wine. what should I do?