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.

SubmissionMgrPODS

4 posts in General Discussion Last posting was on 2007-03-12 00:35:13.0Z
Pedro Santos (pedro.santos Posted on 2007-03-09 11:10:14.0Z
Sender: 37ae.45f14017.1804289383@sybase.com
From: Pedro Santos (pedro.santos@sybase.pt)
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: SubmissionMgrPODS
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <45f14096.37c9.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 9 Mar 2007 03:10:14 -0800
X-Trace: forums-1-dub 1173438614 10.22.241.41 (9 Mar 2007 03:10:14 -0800)
X-Original-Trace: 9 Mar 2007 03:10:14 -0800, 10.22.241.41
Lines: 16
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1053
Article PK: 9213

Hi. I'm developing a application and i'm trying to use the
submission
manager POD.
I used the example found in the avantgo.com PODS guide for
"Saving
data in Forms Manager as a form post", but I can't make it
work...

var subMgr = avantgo.submissionManager;

IE says it cannot find the avantgo object, so i'm guessing
it's
because I don't have the necessary POD...
Where can I find/download the correct POD??

Thanks


Shuchit Posted on 2007-03-09 12:58:42.0Z
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Re: SubmissionMgrPODS
From: Shuchit <me@privacy.net>
References: <45f14096.37c9.1681692777@sybase.com>
Message-ID: <Xns98EE5120E8225svelkarprivacynet@127.0.0.1>
User-Agent: Xnews/2006.08.24 Hamster/2.1.0.0
NNTP-Posting-Host: cpe0080c6ee7d81-cm024340006571.cpe.net.cable.rogers.com
X-Original-NNTP-Posting-Host: cpe0080c6ee7d81-cm024340006571.cpe.net.cable.rogers.com
Date: 9 Mar 2007 04:58:42 -0800
X-Trace: forums-1-dub 1173445122 72.140.144.105 (9 Mar 2007 04:58:42 -0800)
X-Original-Trace: 9 Mar 2007 04:58:42 -0800, cpe0080c6ee7d81-cm024340006571.cpe.net.cable.rogers.com
Lines: 22
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1054
Article PK: 9214

Pedro Santos (pedro.santos@sybase.pt) wrote in news:45f14096.37c9.1681692777
@sybase.com:

> Hi. I'm developing a application and i'm trying to use the
> submission
> manager POD.
> I used the example found in the avantgo.com PODS guide for
> "Saving
> data in Forms Manager as a form post", but I can't make it
> work...
>
> var subMgr = avantgo.submissionManager;
>
> IE says it cannot find the avantgo object, so i'm guessing
> it's
> because I don't have the necessary POD...
> Where can I find/download the correct POD??

What version of MBusiness Are you using and what is the OS ?

Shuchit


Pedro Santos Posted on 2007-03-09 14:20:24.0Z
Sender: 3821.45f142c0.1804289383@sybase.com
From: Pedro Santos
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Re: SubmissionMgrPODS
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <45f16d28.3ef2.1681692777@sybase.com>
References: <Xns98EE5120E8225svelkarprivacynet@127.0.0.1>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="-=_forums-1-dub45f16d28"
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 9 Mar 2007 06:20:24 -0800
X-Trace: forums-1-dub 1173450024 10.22.241.41 (9 Mar 2007 06:20:24 -0800)
X-Original-Trace: 9 Mar 2007 06:20:24 -0800, 10.22.241.41
Lines: 253
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1055
Article PK: 17870

I'm using M-Business 6.2 b254 Windows.
In attach, is the file that i'm trying to run.

Thanks

> Pedro Santos (pedro.santos@sybase.pt) wrote in
> news:45f14096.37c9.1681692777 @sybase.com:
>
> > Hi. I'm developing a application and i'm trying to use
> > the submission
> > manager POD.
> > I used the example found in the avantgo.com PODS guide
> > for "Saving
> > data in Forms Manager as a form post", but I can't make
> > it work...
> >
> > var subMgr = avantgo.submissionManager;
> >
> > IE says it cannot find the avantgo object, so i'm
> > guessing it's
> > because I don't have the necessary POD...
> > Where can I find/download the correct POD??
>
>
> What version of MBusiness Are you using and what is the
> OS ?
>
> Shuchit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<html>
<head>
<TITLE>Customer detail page</TITLE>
<META name="HandheldFriendly" content="True">

<script LANGUAGE="JavaScript" SRC="./js/validations.js"></script>

<script>

var dbMgr = CreateObject("avantgo.db");
var dbset = null;
var idValue = "";

var subMgr = CreateObject("avantgo.submissionManager");

<?php

if(isset($_REQUEST['table'])) {
$table = $_REQUEST['table'];
}
else {
// Default table
$table = "";
}

$g_books = array();
$g_elem = null;

function startElement( $parser, $name, $attrs )
{
global $g_books, $g_elem;
if ( $name == mb_strtoupper($table) ) $g_books []= array();
$g_elem = $name;
}

function endElement( $parser, $name )
{
global $g_elem;
$g_elem = null;
}

function textData( $parser, $text )
{
global $g_books, $g_elem;

$g_books[ count( $g_books ) - 1 ][ $g_elem ] = $text;
}

$parser = xml_parser_create();

xml_set_element_handler( $parser, "startElement", "endElement" );
xml_set_character_data_handler( $parser, "textData" );

$xml = "Config".mb_strtoupper($table).".xml";

$f = fopen( $xml, 'r' );

while( $data = fread( $f, 4096 ) )
{
xml_parse( $parser, $data );
}

xml_parser_free( $parser );

$id = 0;
$getval = 0;
$result = "";
$temp = "";

// "Zebra" Efect :)
$par = 0;

// Date Elements
$dateElementsCount = 0;
$dateElements = "";

// String Elements
$stringElementsCount = 0;
$stringElements = "";

// Phone Elements
$phoneElementsCount = 0;
$phoneElements = "";

// Phone Elements
$emailElementsCount = 0;
$emailElements = "";


foreach( $g_books as $book )
{
if($book['SHOW_DETAIL'] == "1")
{
$getval = 1;
}

if($getval == 1 && $book['SHOW_NAME'] != "")
{
if($par == 0)
{
$result = $result."<tr style=\"background-color:#ffffff;\">\n";
$par = 1;
}
else
{
$result = $result."<tr style=\"background-color:#eeeeee;\">\n";
$par = 0;
}

$result = $result."<td style=\"padding-right:1px;padding-left:1px;font-size:9px;padding-bottom:1px;color:#000000;padding-top:3px;\" valign=\"top\"><b>";
$result = $result.$book['SHOW_NAME'];
$result = $result.":</b> </td>";
}

if($getval == 1 && $book['ELEMENT'] != "")
{
$result = $result."<td style=\"padding-right:1px;padding-left:1px;font-size:9px;padding-bottom:1px;color:#000000;padding-top:3px;\" valign=\"top\">";
$result = $result."<input type=\"text\" name=\"".$book['ELEMENT']."\" id=\"".$book['ELEMENT']."\" /></td>\n";
$result = $result."</tr>";

$temp = $book['ELEMENT'];
}

if($getval == 1 && $book['TYPE'] != "")
{
if($book['TYPE'] == "date")
{
$dateElements = $dateElements." dateElementsArray[".$dateElementsCount."] = \"".$temp."\";\n";
$dateElementsCount ++;
}

if($book['TYPE'] == "string")
{
$stringElements = $stringElements." stringElementsArray[".$stringElementsCount."] = \"".$temp."\";\n";
$stringElementsCount ++;
}

if($book['TYPE'] == "phone")
{
$phoneElements = $phoneElements." phoneElementsArray[".$phoneElementsCount."] = \"".$temp."\";\n";
$phoneElementsCount ++;
}

if($book['TYPE'] == "email")
{
$emailElements = $emailElements." emailElementsArray[".$emailElementsCount."] = \"".$temp."\";\n";
$emailElementsCount ++;
}

$id = $id + 1;
$getval = 0;
}
}

if($dateElementsCount>0)
{
echo "var dateElementsArray = new Array(".$dateElementsCount.");\n";
echo $dateElements;
}

if($stringElementsCount>0)
{
echo "var stringElementsArray = new Array(".$stringElementsCount.");\n";
echo $stringElements;
}

if($phoneElementsCount>0)
{
echo "var phoneElementsArray = new Array(".$phoneElementsCount.");\n";
echo $phoneElements;
}

if($emailElementsCount>0)
{
echo "var emailElementsArray = new Array(".$emailElementsCount.");\n";
echo $emailElements;
}
?>

var inputs = 0;

function onloadHandler()
{
/*var dbname = avantgo.preferences.getStringValueForKey("ListPage_dbname");
var id = avantgo.preferences.getStringValueForKey("detailPage_"+dbname+"Id");

idValue = id;

dbset = dbMgr.open(dbname, "r");
if(dbset == null) {
alert("Could not open the '" + dbname + "' database.");
return;
}

var query = "id == " + id;
searchset = dbset.createSearch(query);
dbset.find(searchset);
dbset.moveNext();

var t
for(t=0;t<dbset.metadata.ncolumns;t++)
{
var txt = dbset.metadata.getColumnName(t);
var txt2= dbset.getStringField(dbset.metadata.getColumnName(t));

try
{
document.getElementById(txt).value = txt2;
}
catch(ex)
{
}

dbset.moveNext();
}*/
}


function onunloadHandler() {
/*if( dbset ) dbset.close();*/
}

// Global Validation
function validateValues()
{
// Validade All data acording to the config file

// Validar todos os emails
if( <? echo $emailElementsCount; ?> > 0 )
{
for(i=0;i<emailElementsArray.length;i++)
{
var emailval = document.getElementById(emailElementsArray[i]).value;
if(trim(emailval) != "" && !emailCheck(trim(emailval)))
{
alert("Email: " + emailval + " Invalid ");
return false;
}
}
}

// Validar todos os telefones.
if( <? echo $phoneElementsCount; ?> > 0 )
{
for(i=0;i<phoneElementsArray.length;i++)
{
var phoneVal = document.getElementById(phoneElementsArray[i]).value;

if(trim(phoneVal) != "" && !phoneCheck(trim(phoneVal)))
{
alert("Phone: " + phoneVal + " Invalid ");
return false;
}
}
}

// Validar todas as datas

if( <? echo $dateElementsCount; ?> > 0 )
{
for(i=0;i<dateElementsArray.length;i++)
{
var dateVal = document.getElementById(dateElementsArray[i]).value;

if(trim(dateVal) != "" && !dateCheck(trim(dateVal)))
{
alert("Date: " + dateVal + " Invalid ");
return false;
}
}
}

alert("Dados Correctos");
return true;
}

function createSubmission(){
if(!validateValues()){
alert("Dados incorrectos");
return true;
}
else{
alert("vamos submeter o form...");

//var subMgr = avantgo.submissionManager;

var cnt = subMgr.lenght;
alert("subMgr.lenght="+cnt);
while(cnt--){
submission = subMgr[cnt];

if (submission == null)
continue;

if(submission.title != document.saveform.id.value)
continue;

element = subMgr.submissionElementForName("name");
element.value = document.saveform.name.value;
alert(document.saveform.name.value);
element = subMgr.submissionElementForName("amount");
element.value = document.saveform.amount.value;
alert(document.saveform.amount.value);
element = subMgr.submissionElementForName("opportunity_type");
element.value = document.saveform.opportunity_type.value;
alert(document.saveform.opportunity_type.value);
element = subMgr.submissionElementForName("sales_stage");
element.value = document.saveform.sales_stage.value;
alert(document.saveform.sales_stage.value);

return;
}
alert("Create Submission...");
subm = subMgr.createSubmission(0, new Date(), 0, 0, 0, 0, 0, 0, 0);

subm.appendSubmissionElement(subm.createSubmissionElement("id",document.saveform.id.value));
subm.appendSubmissionElement(subm.createSubmissionElement("name",document.saveform.name.value));
subm.appendSubmissionElement(subm.createSubmissionElement("amount",document.saveform.amount.value));
subm.appendSubmissionElement(subm.createSubmissionElement("opportunity_type",document.saveform.opportunity_type.value));
subm.appendSubmissionElement(subm.createSubmissionElement("sales_stage",document.saveform.sales_stage.value));

subm.status = "UNSUBMITTED_SUBMIT_STATUS";
subm.isHidden = true;
subm.trashResponse = true;
subm.formIndex = 0;
subm.actionMethod = "P";
subm.title = document.saveform.id.value;
subm.sourceURL = "/SUGARMOBILE/sugar.mobile.edit.php";
subm.actionURL = "../sugar.mobile.test.savedata.php";
//subm.resultURL = "/SUGARMOBILE/sugar.mobile.index.php";
subMgr.saveSubmission(subm);

back();
}
}

</script>
</head>

<body onload="onloadHandler()" onunload="onunloadHandler()" bgcolor="#ffffff" style="margin-left:0px;margin-top:0px;" >
<form name="saveform">
<table width="224">
<tbody>
<tr>
<td align="center" style="background-color:#ffffff;font-family:verdana;font-size:10px;padding-top:2px;padding-bottom:1px;" colspan=2>New <? echo ucwords($table) ?></td>
</tr>
<tr>
<td>
<a href="#" onclick="createSubmission();">
<img src="./imgs/save.JPG">
</a>
</td>
<td>
<a href="#" onclick="window.location='sugar.mobile.index.php?table=<? echo strtolower($table); ?>'">
<img src="./imgs/back.JPG">
</a>
</td>
</tr>
<?php
echo $result;
?>
</tbody>
</table>
</form>

<!-- Link to XMLDB PODS -->
<!-- For PalmOS devices, use href="PODS/AG_DEVICEOS/dbpod_qual.prc" instead -->
<a href="PODS/AG_DEVICEOS/dbpod_quad.dll"></a>
<a href="PODS/AG_DEVICEOS/mimelist.dll"></a>
<a href="PODS/AG_DEVICEOS/dbpod_quad.prc"></a>
<a href="PODS/AG_DEVICEOS/mimelist.prc"></a>


</body>
</html>


Shuchit Posted on 2007-03-12 00:35:13.0Z
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Re: SubmissionMgrPODS
From: Shuchit <me@privacy.net>
References: <Xns98EE5120E8225svelkarprivacynet@127.0.0.1> <45f16d28.3ef2.1681692777@sybase.com>
Message-ID: <Xns98F07FF80CA75svelkarprivacynet@127.0.0.1>
User-Agent: Xnews/2006.08.24 Hamster/2.1.0.0
NNTP-Posting-Host: cpe0080c6ee7d81-cm024340006571.cpe.net.cable.rogers.com
X-Original-NNTP-Posting-Host: cpe0080c6ee7d81-cm024340006571.cpe.net.cable.rogers.com
Date: 11 Mar 2007 16:35:13 -0800
X-Trace: forums-1-dub 1173659713 72.140.144.105 (11 Mar 2007 16:35:13 -0800)
X-Original-Trace: 11 Mar 2007 16:35:13 -0800, cpe0080c6ee7d81-cm024340006571.cpe.net.cable.rogers.com
Lines: 21
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1057
Article PK: 9217


Pedro Santos wrote in news:45f16d28.3ef2.1681692777@sybase.com:

>
> I'm using M-Business 6.2 b254 Windows.
> In attach, is the file that i'm trying to run.
>

>>> var subMgr = avantgo.submissionManager;
>>>
>>> IE says it cannot find the avantgo object, so i'm
>>> guessing it's

I guess I do not understand where IE comes into the picture. You are using a
fairly recent version of MBusiness, which is a full fledged browser and not a
plugin for any other browser. So, you should be using the MBusiness browser
to access the content server through an MBusiness Server.

I think SubmissionManager is bundled with the client, so you should not need
deploy any additional files for it to work.

Shuchit