on ‎2009 May 15 11:34 AM
Hi Guys,
I am little new to the world of AJAX.
What i have to implement is, After the input from the user into an input field, I need to populate a table with data.I am doing this in AJAX but failing.
I am using HTMLB:TableView to display the data.
Please help me out with some basic code.
Regards,
Abhi
Request clarification before answering.
Hi,
at first you need an event, to send the data. The simplest thing for that, you use a htmlb-button.
A little bit trickier is to bind the on-Blur-Event to your field. OnBlur means: the user has finished
doing his entry and the focus for this leaves, i.e. the user click anywhere outside the field.
If you want to do this, take the jquery-library (jquery.com), which is free, and have a look at the documentation. The only thing, you need to know, is the id of your field.
The second thing, you have to do, is to prepare yor page with the tableviewdata. Do it like
<%loop at itab into structure. id = sy-tabix. condense id.%>
<htmlb:inputField id = "itab[<%= id %>].field1" value = "<%=structure-field1%>" visible = "false" />
<%loop at itab into structure. id = sy-tabix. condense id.%>
<htmlb:inputField id = "itab[<%= id %>].field2" value = "<%=structure-field2%>" visible = "false" />
<%endloop.%>
and so on, assuming that your table has a structure with two fields.
For third, you can use the jquery library with their ajax function to submit these data to the remote page.
That's all. There a many posts on inet for that stuff. Goggle it. But using jquery or another library makes
this much easier.
Best regards, Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
where are you having problem?
in AJAX or in htmlb:tableview?
check these weblogs
/people/piotr.plusa/blog/2008/01/31/ajax-with-htmlb-elements-on-bsp-pages
/people/sap.user72/blog/2005/08/15/ajax-and-htmlb--a-sample-bsp-application
/people/renald.wittwer/blog/2007/05/07/bsp-htmlb-tree-view-with-ajax
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Durai & Stefan
Thanks a lot for your time.
I have problem in the AJAX end.I want to make the trip to server and back using AJAX during which i will populate data in the table.How to send the table from the server to view using AJAX.
@Stefan i have to use the htmlb:tableview tag.Please help me with this.
Regards,
Abhishek
Edited by: Abhi on May 18, 2009 6:06 AM
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 7 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.