GetItemString issue

I have a code snippet in rbuttondown event that looks like.

Long var1
var1 = this.GetSelectedRow(0)

String var2
var2 = this.GetItemString(var1,"TABLE_ATTRIBUTE")

IF var2 = 1 THEN
<........
do something
........>
END IF

TABLE_ATTRIBUTE is an attribute from table A which is
varchar(15) and is not null.

But this attribute is always retrieved as null and hence
var2 = null.

Also, certain attributes are retrieved properly in other
similar code snippets whereas some are retrieved wrongly
(Which is uncertain and random as what is properly retrieved
and what is not).

Please help on what might be the issue.

All related variables and attributes are included in the
DataWindow painter Column specification window.
1
Jack
1/6/2011 5:23:56 AM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

2 Replies
1055 Views

Similar Articles

[PageSpeed] 48

Hey Jack,

This works for me...

Long var1
String var2

var1 = row
var2 = dwo.name
var2 = this.GetItemString(var1,var2)

messagebox('',var2)


hth,
Mark

On 1/6/2011 12:23 AM, Jack wrote:
> I have a code snippet in rbuttondown event that looks like.
>
> Long var1
> var1 = this.GetSelectedRow(0)
>
> String var2
> var2 = this.GetItemString(var1,"TABLE_ATTRIBUTE")
>
> IF var2 = 1 THEN
> <........
> do something
> ........>
> END IF
>
> TABLE_ATTRIBUTE is an attribute from table A which is
> varchar(15) and is not null.
>
> But this attribute is always retrieved as null and hence
> var2 = null.
>
> Also, certain attributes are retrieved properly in other
> similar code snippets whereas some are retrieved wrongly
> (Which is uncertain and random as what is properly retrieved
> and what is not).
>
> Please help on what might be the issue.
>
> All related variables and attributes are included in the
> DataWindow painter Column specification window.
0
Mark
1/6/2011 1:11:22 PM
Are you sure GetSelectedRow() is returning a valid row reference? Your 
var1 variable could easily be storing a zero or null itself, which would 
mess up your GetItemString() call.



On 1/5/2011 11:23 PM, Jack wrote:
> I have a code snippet in rbuttondown event that looks like.
>
> Long var1
> var1 = this.GetSelectedRow(0)
>
> String var2
> var2 = this.GetItemString(var1,"TABLE_ATTRIBUTE")
>
> IF var2 = 1 THEN
> <........
> do something
> .......>
> END IF
>
> TABLE_ATTRIBUTE is an attribute from table A which is
> varchar(15) and is not null.
>
> But this attribute is always retrieved as null and hence
> var2 = null.
>
> Also, certain attributes are retrieved properly in other
> similar code snippets whereas some are retrieved wrongly
> (Which is uncertain and random as what is properly retrieved
> and what is not).
>
> Please help on what might be the issue.
>
> All related variables and attributes are included in the
> DataWindow painter Column specification window.
0
Jason
1/6/2011 3:57:43 PM
Reply:

Similar Artilces:

Drop Down Datawindow issues in Datawindow
We recently moved from version 8.0.3 9704 to 8.0.3 9977. Since this move we have had nothing but grief with DropDownDatawindow style columns. Basically - we have columns that are dropdowns that the user can enter their values into or, scroll down and select from. We then have code that verifies that the value entered in the column exists in the drop down list (i.e. is the data entered by the user valid). When we get the value from the column (using either dot notation or, getitem functions) PB is giving us the display value for the drop down NOT the code value. SOMETIMES whe...

Powerbuilder 9.0.1 datawindow activex deployment issue
Hello again. I am trying to deploy the datawindow ActiveX, among other things. It really does not look like the PSDWC90.CAB file does what it needs to do. Reason I say so is, I can not get a deployment to work on a User's PC unless I install powerbuilder. Does anyone have any insight, or am I the only one using this technology? :) Use the window activex, you can associate much more functionality with your datawindow > Hello again. > > I am trying to deploy the datawindow ActiveX, among other > things. It really does not look like the PSDWC90.CAB file > do...

Is there any issue in creating dynamic datawindow in Datawindow.Net?
Hi I have created a datawindow object in PB10 and exported in to SRD file. In my dot.net application, I read the file into string and issued the following command to create datawindow dynamically. But it throws an methodfailureexception error as "incorrect syntax at line 18 and column 14. Dim ls_create As String Dim fs As FileStream fs = New FileStream(curFileName, FileMode.Open, FileAccess.Read) 'declaring a FileStream to open the file named file.doc with access mode of reading Dim d As New StreamReader(fs) 'creating a new StreamReader and passing the filestream...

DataWindow.NET : issue using external datawindow
Hello, I created an external datawindow with 3 columns, but I have error messages when I want to use it in my .NET application : When I want to insert rows, I get the message : "InsertRow was called when no DataWindow object was attached." I set in design mode my pbl library and also the datawindow name I want to use. I also tried to set it dynamically in the code, but it changes nothing. I'm sure SQLCA isn't useful for this kind of DataWindow, but I also tried to set it and I get the message "SetTransaction was called when no DataWindow object was att...

DataWindow.NET : issue using external datawindow #2
Hello, I created an external datawindow with 3 columns, but I have error messages when I want to use it in my VB.NET application : When I want to insert rows, I get the message : "InsertRow was called when no DataWindow object was attached." I set in design mode my pbl library and also the datawindow name I want to use. I also tried to set it dynamically in the code, but it changes nothing (I can see the DataWindow in design mode). I'm sure SQLCA isn't useful for this kind of DataWindow, but I also tried to set it and I get the message "SetTransaction ...

Powerbuilder 7 (NT) to Powerbuilder 8 (win2000) has migration issues
I work for a company called Stanley Associates, and we have independent applications that were created under powerbuilder. Up until recently we had been using PB7 without any problems or compilation errors. Upon creating a new workspace, adding a target, and doing the initial rebuild, we ran into several information statements and even some errors in our migration/compilation. Silly statements like window name is invalid due to global variable of same type, or incomatible types in assignment. several erorrs and information that make no sense, yet never came up in version 7. What ar...

datawindows issues
This is a multi-part message in MIME format. ------=_NextPart_000_0018_01C37C3F.4F741F60 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable I create a datawindows that source by query from SQL. After I made, I = set update properties, I type table name and select unique key, = updateable column, then click "Ok". the error said: " Table "xxx" not = found". So How can I solve this problem? In additionally I create a datawindows source by stored procedure, and = made upate properties properly, then retriev...

Datawindow Issue
Why does the computed field in a datawindow with this formula : Round( 10*52.66*0.5*0.95, 2 ) will give the result = 250.13 ?? The exact result is 250.135 and Round( 250.135, 2) = 250.14 ! Am I doing something wrong ? I tested with all PB versions from 6.5.1 to 10.0 Build 4500 (60 trial) and the result is the same... This is an extreme FAQ: read this: Losing Accuracy - Understanding Floating Point and Decimal Number Representations http://www.sybase.com/detail?id=1012599 > Why does the computed field in a datawindow with this > formula : > > Roun...

DataWindow issues
Hi. I have a couple issues in PB 8.0. 1. I create datawindow on the fly. When I select columns of type 'text' I maje its height bigger, and back height when column loose focus in ItemFocusChanged event. When I do it in grid presentation it works good, but in tabular one it looks like DW does not redraw. I try to use SetRedraw function but it does not help. DW color is gray, column's color is white. After I changed height of column to normal region under column stay white. 2. I have a DW with 2 protected column. When I select row (SelectRow, ScrollToRow) first column ...

DataWindow issue
Hello There! I have a datawindow with the TitleBar property activated, when running, this DW can be moved across the parent window, is there a way to prevent this? please help! DW controls with a TitleBar are also moveable. That's part of the package. If you want a header but don't want the control to be moveable then either put a title in the DW or create a separate object and place it above the DW control. Regards, John "Ricardo Alba Medrano" <alba_ricardo@hotmail.com> wrote in message news:46a7c6d2$1@forums-1-dub... > Hello There! ...

Powerbuilder Datawindow
Hello, Can you do a Datawindow in VS 2005 without using Datawindow.NET just by using common controls i.e DataGrid etc. Thanks Chris What would you use the DataWindow for then? To retieve the datawindow into a datastore and then attempt to use it to populate the DataGrid? I've heard of people who want to have their cake and eat it too, but it sounds like you want no cake but you want to eat it... On 20 Feb 2007 23:42:31 -0800, Chris Ceniza wrote: >Hello, > >Can you do a Datawindow in VS 2005 without using >Datawindow.NET just by using common control...

DataWindow This, DataWindow That...
Blah blah blah You've heard it enough that you don't even want to comment on how many times... The DataWindow. ....but it can't be enough anymore...can it? This from one of our colleagues (and yes my apologies for taking it out of context)... "...PB covers all you need to do that in ONE Tool. This includes Windowprogramming ( meaning the interface to the user: Windows, Sheets, diallougeboxes, etc.), Database operability AND Reporting! Well, I see als well as many other PB users that some of the implementations and features PB offers are improvable. But thi...

Powerbuilder datawindow
Hi! I'm importing a some data into my application. The way I do this is to insert a the rows into a datawindow and then do an update() on the datawindow. If a row in the database allready exists with the same primary key as I have inserted into the datawindow, what will happen then? Will then datawindow do an update or will I get an error? I'm doing this on a datastore object. How can I get an errormessage from the datastore? I have tried the errormessages and codes from the transaction object (sqlca.sqlerrtext and sqlca.sqlcode). Jan Erik > If a row in the...

DataWindow issue
Hello there! I have a composite style datawindow, this DW has 3 dw inside, 1 free-form and 2 graph. When running in PB everything worls just fine, but when running in appeon the dw shows only the free-form one, the other appear as a gray space with no data or image. Any idea of how to fix this? please help! Hi Ricardo Alba Medrano, What's your Appeon version? And what Appeon deployment mode did you choose, Appeon Xecelerator or Pure-JavaScript? Besides please provide Appeonserver.log and Appeonerror.log for us to further the study. Regards Sally Li >...

Web resources about - GetItemString issue - sybase.powerbuilder.datawindow

Resources last updated: 1/20/2016 4:28:27 PM