Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Using ListView Client extension with UltraLight

4 posts in General Discussion Last posting was on 2004-11-16 22:36:33.0Z
Dan Tf Posted on 2004-10-30 12:38:37.0Z
From: "Dan Tf" <dantf@zahav.net.il>
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Using ListView Client extension with UltraLight
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Original-NNTP-Posting-Host: diup-180-23.inter.net.il
Message-ID: <41838b48@forums-2-dub>
X-Original-Trace: 30 Oct 2004 05:38:32 -0700, diup-180-23.inter.net.il
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 30 Oct 2004 05:38:34 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 30 Oct 2004 05:38:37 -0700
X-Trace: forums-1-dub 1099139917 10.22.108.75 (30 Oct 2004 05:38:37 -0700)
X-Original-Trace: 30 Oct 2004 05:38:37 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:187
Article PK: 8761

Hi,
How do I connect UL recordset or table to a list view client extension?
I'm writing application that uses on device Ultralight DB with m-business
and use Javascript and SQL statements to retrive data.
refernce to a demo app or simple code example would be highly appreciated.

Thanks,
Dan


David Fishburn Posted on 2004-11-16 22:36:33.0Z
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Re: Using ListView Client extension with UltraLight
From: David Fishburn <fishburn_spam@off.ianywhere.com>
References: <41838b48@forums-2-dub>
Organization: iAnywhere Solutions
Message-ID: <Xns95A3B3162845Efishburnsybasecom@127.0.0.1>
User-Agent: Xnews/06.08.25 Hamster/2.0.6.0
X-Original-NNTP-Posting-Host: vpn-concord-022.sybase.com
X-Original-Trace: 16 Nov 2004 14:36:29 -0800, vpn-concord-022.sybase.com
Lines: 205
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 16 Nov 2004 14:36:30 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 16 Nov 2004 14:36:33 -0800
X-Trace: forums-1-dub 1100644593 10.22.108.75 (16 Nov 2004 14:36:33 -0800)
X-Original-Trace: 16 Nov 2004 14:36:33 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:205
Article PK: 8773

"Dan Tf" <dantf@zahav.net.il> wrote in news:41838b48@forums-2-dub of
ianywhere.public.mbusinessanywhere.general:

DT> How do I connect UL recordset or table to a list view client
DT> extension? I'm writing application that uses on device Ultralight DB
DT> with m-business and use Javascript and SQL statements to retrive
data.
DT> refernce to a demo app or simple code example would be highly
DT> appreciated.


Please ALWAYS include version and MORE importantly BUILD number
with EACH post (dbeng9 -v).

Also the mBus version.
And the mBus client version.

We do this routinely using the mBus ULPod.
If you have an HTML table, you can loop through the result set and
dynamically add <TR> rows to your table:


Here is an email thread I had, hope this helps you a bit ...




So now that you have a connection to the UL database, how do you get
data out of it, and placed in your HTML code.

<table id="troncon_list" width="215" height="120" >
<TBODY id="troncon_list_body">
<TR>
<TH ALIGN="center">Sel</TH>
<TH ALIGN="center">Tronçon</TH>
<TH ALIGN="center">PK Deb</TH>
<TH ALIGN="center">PK Fin</TH>
<TH ALIGN="center">Etat</TH>
<TH ALIGN="center">Zones</TH>
</TR>
</TBODY>
</table>


So in our javascript code, we need to reference that TBODY tag id,
troncon_list_body. In the javascript at the beginning of the page, we
make this function call:
voie.getTronconsHTML(ligne.getID(), voie.getID(),
'troncon_list_body');


Which calls this function:

//
************************************************************************
// getTronconsHTML()
//
// Returns an array consisting of a Troncon object for each troncon
// for the ligne and voie specified
//
************************************************************************

this.getTronconsHTML = function(in_ligne, in_voie, in_html_tbl) {

//alert( 'Voie - getTronconsHTML - HTML table: ' + in_html_tbl );
var tbody = document.getElementById(in_html_tbl);
var titleRow = tbody.firstChild.cloneNode(true);

-- First remove all elements from the existing HTML table
while ( tbody.hasChildNodes() ) {
tbody.removeChild( tbody.firstChild );
}
tbody.appendChild( titleRow );

-- Here is the query against the UL database to retrieve the
-- data we need to display on this form.
var query = "" +
"SELECT troncon.id_troncon " +
" FROM troncon, voie " +
" WHERE voie.id_voie = troncon.id_voie " +
" AND voie.id_ligne = " + in_ligne +
" AND voie.id_voie = " + in_voie +
" ORDER BY troncon.id_troncon";

//alert( 'Voie - getTronconsHTML - l: ' + in_ligne + " v:" +
in_voie );
-- Hmm, I dont think this line is required anymore, it was from a
previous
-- try at this.
var rs, troncons_array = new Array(), error_occurred = false;

-- Here we execute the SQL statement and loop through all the
-- rows adding it to the HTML table.
try {
var stmt = dbConn.prepareStatement( query,
"stmt_get_troncons" );

rs = stmt.executeQuery( null );

-- Move to the beginning of the result set
rs.moveBeforeFirst();

-- Move through each item
while ( rs.moveNext() ) {

-- Retrieve the column value
var id_troncon = rs.getInt( rs.schema.getColumnID(
"id_troncon" ) );
var tron = new Troncon( dbConn, id_troncon );

//alert('getTronconsHTML: id:'+id_troncon+'
voie:'+tron.getId_voie()+' deb:'+tron.getPk_debut());
if ( ! tron )
error_occurred = true;

-- Add the row to the end of the table
//tr = document.createElement("tr");
tr = tbody.insertRow(-1);

-- Create a new TD element
td_sel = document.createElement("td");
td_tron = document.createElement("td");
td_deb = document.createElement("td");
//alert( '11' );
td_fin = document.createElement("td");
//alert( '12' );
td_etat = document.createElement("td");
//alert( '13' );
td_zone = document.createElement("td");

//alert( 'Adding troncon:' + troncon_arrary[i].getId() );
//alert( 'Adding troncon:' + tron.getID() );

-- You must do special things for TDs that are not just
-- straight text. In this case I was using a RADIO button.
var radio_elem = document.createElement( "input" );
radio_elem.type = "radio";
radio_elem.id = tron.getID();
radio_elem.onclick = chooseTroncon;
td_sel.appendChild( radio_elem );

//td_sel.appendChild( document.createTextNode( tron.getID
() ) );
td_tron.appendChild( document.createTextNode( tron.getID
() ) );
td_deb.appendChild( document.createTextNode(
tron.getPk_debut() ) );
td_fin.appendChild( document.createTextNode(
tron.getPk_fin() ) );
td_etat.appendChild( document.createTextNode(
tron.getEtat() ) );
td_zone.appendChild( document.createTextNode( '' ) );
//td_zone.appendChild( document.createTextNode(
tron.getZone() ) );

-- Add the TD element to the TR element
tr.appendChild(td_sel);
tr.appendChild(td_tron);
tr.appendChild(td_deb);
tr.appendChild(td_fin);
tr.appendChild(td_etat);
tr.appendChild(td_zone);

}

-- This will simply catch errors, like table not found, or spelling
mistakes
-- for column names.
} catch ( ex ) {
alert( "Voie - getTronconsHTML - Database Error: " +
ex.getMessage() );
alert( "Voie - getTronconsHTML - query: " + query );
return null;
} finally {
rs.close();
stmt.close();
}

if ( error_occurred )
return null;

return true;
}

--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).

EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm

Developer Community / Whitepapers
http://www.ianywhere.com/developer

CaseXpress - to report bugs
http://casexpress.sybase.com

CodeXchange - Free samples
http://ianywhere.codexchange.sybase.com/servlets/ProjectDocumentList


Yadong.LiuNOSPAM Posted on 2004-11-04 23:53:57.0Z
From: Yadong.LiuNOSPAM@ianywhere.com
Subject: Re: Using ListView Client extension with UltraLight
Newsgroups: ianywhere.public.mbusinessanywhere.general
MIME-Version: 1.0
References: <41838b48@forums-2-dub>
X-Newsreader: Lotus Notes Release 6.5 September 26, 2003
X-MIMETrack: Serialize by Notes Client on Yadong Liu/SYBASE(Release 6.5|September 26, 2003) at 11/04/2004 03:53:58 PM, Serialize complete at 11/04/2004 03:53:58 PM
Content-Type: text/plain; charset="US-ASCII"
NNTP-Posting-Host: vpn-dub-146.sybase.com
X-Original-NNTP-Posting-Host: vpn-dub-146.sybase.com
Message-ID: <418ac115$1@forums-1-dub>
Date: 4 Nov 2004 15:53:57 -0800
X-Trace: forums-1-dub 1099612437 10.22.120.146 (4 Nov 2004 15:53:57 -0800)
X-Original-Trace: 4 Nov 2004 15:53:57 -0800, vpn-dub-146.sybase.com
Lines: 20
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:193
Article PK: 17611

My understanding is that this is currently not possible out of the box.
Future versions of these two products may provide tighter integration.
However, conceptually, you could dynamically create temporary XML dbs and
populate it with a few columns of data from the UL db, then use MIMEList
player to for display. Depending on your app requirement, this may not
work for your purpose.

Btw, there is a sample MIMEList player code for download here:
http://www.ianywhere.com/developer/code_samples/master_detail_mbus.html


====
Hi,
How do I connect UL recordset or table to a list view client extension?
I'm writing application that uses on device Ultralight DB with m-business
and use Javascript and SQL statements to retrive data.
refernce to a demo app or simple code example would be highly appreciated.

Thanks,
Dan


Dan Tf Posted on 2004-11-05 13:58:23.0Z
From: "Dan Tf" <dantf@zahav.net.il>
Newsgroups: ianywhere.public.mbusinessanywhere.general
References: <41838b48@forums-2-dub> <418ac115$1@forums-1-dub>
Subject: Re: Using ListView Client extension with UltraLight
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Original-NNTP-Posting-Host: diup-180-23.inter.net.il
Message-ID: <418b86fc@forums-2-dub>
X-Original-Trace: 5 Nov 2004 05:58:20 -0800, diup-180-23.inter.net.il
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 5 Nov 2004 05:58:20 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 5 Nov 2004 05:58:23 -0800
X-Trace: forums-1-dub 1099663103 10.22.108.75 (5 Nov 2004 05:58:23 -0800)
X-Original-Trace: 5 Nov 2004 05:58:23 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:195
Article PK: 8765

Thanks for your reply.
I already thought of this kind of solution and currently implementing a
prototype to review the expected performance hit.
Thanks again for your help.

P.S.
IMHO
implementing these kind of controls for m-business and integrating them with
UL is a must.
We are considering migrating our mobile application from .NET/Codewarrior to
m-bussiness and this obstacle is a real issue.

<Yadong.LiuNOSPAM@ianywhere.com> wrote in message
news:418ac115$1@forums-1-dub...
> My understanding is that this is currently not possible out of the box.
> Future versions of these two products may provide tighter integration.
> However, conceptually, you could dynamically create temporary XML dbs and
> populate it with a few columns of data from the UL db, then use MIMEList
> player to for display. Depending on your app requirement, this may not
> work for your purpose.
>
> Btw, there is a sample MIMEList player code for download here:
> http://www.ianywhere.com/developer/code_samples/master_detail_mbus.html
>
>
> ====
> Hi,
> How do I connect UL recordset or table to a list view client extension?
> I'm writing application that uses on device Ultralight DB with m-business
> and use Javascript and SQL statements to retrive data.
> refernce to a demo app or simple code example would be highly appreciated.
>
> Thanks,
> Dan