How to get a row number in DDDW

Hi, All,
     When a DDDW on a column opens for the user to pick an item, and
when the user clicks on a row or scrolls up/down in the DDDW, is there
any way to get the row number of the DDDW? I have tried this in PB 5,
and it did not seem to work. Any ideas about PB 6.5 or PB 7.0? Thanks in
advance.

0
Ben
8/24/1999 10:18:02 PM
sybase.powerbuilder.general 62418 articles. 14 followers. Follow

5 Replies
596 Views

Similar Articles

[PageSpeed] 48

Ben

You can't directly get the row that the user clicked on. You can write code
in the ItemChanged event of the parent DW where you get the data value on
the parent column, get a handle to the child DW, then perform a Find ( ) on
the child DW looking the the data value in the relevant column. This will
tell you which row had the selected value.

HTH

Sanjiv Das [TeamSybase]


Ben Gong <dazhig@yahoo.com> wrote in message
news:37C31A1A.DEAEF47@yahoo.com...
> Hi, All,
>      When a DDDW on a column opens for the user to pick an item, and
> when the user clicks on a row or scrolls up/down in the DDDW, is there
> any way to get the row number of the DDDW? I have tried this in PB 5,
> and it did not seem to work. Any ideas about PB 6.5 or PB 7.0? Thanks in
> advance.
>


0
Sanjiv
8/25/1999 3:58:02 AM
Sanjiv & Ben, 

Use the GETROW() function on the Datawindowchild to get the row selected by the
user in a DDDW.  Following is the sample code:

/**********************************************************************/
datawindowchild ldwc_customer
long ll_rtncode, ll_row, ll_custid
String ls_customer

// Get the DDDW attached to the 'cust_id' column.
ll_rtncode = dw_order.GetChild('cust_id', ldwc_customer)

IF ll_rtncode = -1 THEN MessageBox("Error", "Not a DataWindowChild")

// Get the row selected by the user
ll_row = ldwc_customer.getrow()

// For DEBUG purpose.
// Get the ID & Company Name from the Datawindowchild
ll_custid   = ldwc_customer.GetItemNumber(ll_row, 'id')
ls_customer = ldwc_customer.GetItemString(ll_row, 'company_name')

MessageBox ( 'Select ID and Customer', 'ID   : ' + &
                                       string(ll_custid) + '~n~r' + &
                                       'Name : ' + ls_customer)
/****************************************************************************/

I am not sure whether there are any events that gets executed when the user is
scrolling in a DDDW. 

Sambu Subramanyam
Saudi Aramco
Dhahran, Saudi Arabia.

On Tue, 24 Aug 1999 20:58:02 -0700,
 in powersoft.public.powerbuilder.general
Sanjiv Das [TeamSybase] <No-Spam-SDas@CompuServe.Com> wrote: 
>Ben
>
>You can't directly get the row that the user clicked on. You can write code
>in the ItemChanged event of the parent DW where you get the data value on
>the parent column, get a handle to the child DW, then perform a Find ( ) on
>the child DW looking the the data value in the relevant column. This will
>tell you which row had the selected value.
>
>HTH
>
>Sanjiv Das [TeamSybase]
>
>
>Ben Gong <dazhig@yahoo.com> wrote in message
>news:37C31A1A.DEAEF47@yahoo.com...
>> Hi, All,
>>      When a DDDW on a column opens for the user to pick an item, and
>> when the user clicks on a row or scrolls up/down in the DDDW, is there
>> any way to get the row number of the DDDW? I have tried this in PB 5,
>> and it did not seem to work. Any ideas about PB 6.5 or PB 7.0? Thanks in
>> advance.
>>
>
>
0
Sambu
8/25/1999 6:55:22 AM
Thanks for both. The problem with this technique is the ItemChanged event only
fires once and this will only gets the first row fo the DDDW the user selects. If
the user scrolls up and down in the DDDW, and the item remains the same, the
ItemChanged event does not fire. Here is what I have to do:
       The State criminal statute codes have chapters, sections, subdivisions and
sequences. A chapter always has more than one section, which almost always has more
than one subdivision, whih may have more than one sequence. Now all of these are
separate columns. The user wants to just select the chapter columns and wants me to
auto set all of the rest plus the charge description. This can be done when the
chapter is first selected, which is also the first record of that chapter. When the
user scrolls up and down the DDDW, the chapter value remains the same, so the
ItemChanged event does not fire again. Here is what the DDDW looks like:
     Chapter    Section           Subd           Sequence          Charge Desc
        609         001                2bd                1
Murder1
       609          001                2bd                2
Murder2
       609          001                2bd                3
Attempted Murder
       Etc, etc
Thanks.

Sambu Subramanyam wrote:

> Sanjiv & Ben,
>
> Use the GETROW() function on the Datawindowchild to get the row selected by the
> user in a DDDW.  Following is the sample code:
>
> /**********************************************************************/
> datawindowchild ldwc_customer
> long ll_rtncode, ll_row, ll_custid
> String ls_customer
>
> // Get the DDDW attached to the 'cust_id' column.
> ll_rtncode = dw_order.GetChild('cust_id', ldwc_customer)
>
> IF ll_rtncode = -1 THEN MessageBox("Error", "Not a DataWindowChild")
>
> // Get the row selected by the user
> ll_row = ldwc_customer.getrow()
>
> // For DEBUG purpose.
> // Get the ID & Company Name from the Datawindowchild
> ll_custid   = ldwc_customer.GetItemNumber(ll_row, 'id')
> ls_customer = ldwc_customer.GetItemString(ll_row, 'company_name')
>
> MessageBox ( 'Select ID and Customer', 'ID   : ' + &
>                                        string(ll_custid) + '~n~r' + &
>                                        'Name : ' + ls_customer)
> /****************************************************************************/
>
> I am not sure whether there are any events that gets executed when the user is
> scrolling in a DDDW.
>
> Sambu Subramanyam
> Saudi Aramco
> Dhahran, Saudi Arabia.
>
> On Tue, 24 Aug 1999 20:58:02 -0700,
>  in powersoft.public.powerbuilder.general
> Sanjiv Das [TeamSybase] <No-Spam-SDas@CompuServe.Com> wrote:
> >Ben
> >
> >You can't directly get the row that the user clicked on. You can write code
> >in the ItemChanged event of the parent DW where you get the data value on
> >the parent column, get a handle to the child DW, then perform a Find ( ) on
> >the child DW looking the the data value in the relevant column. This will
> >tell you which row had the selected value.
> >
> >HTH
> >
> >Sanjiv Das [TeamSybase]
> >
> >
> >Ben Gong <dazhig@yahoo.com> wrote in message
> >news:37C31A1A.DEAEF47@yahoo.com...
> >> Hi, All,
> >>      When a DDDW on a column opens for the user to pick an item, and
> >> when the user clicks on a row or scrolls up/down in the DDDW, is there
> >> any way to get the row number of the DDDW? I have tried this in PB 5,
> >> and it did not seem to work. Any ideas about PB 6.5 or PB 7.0? Thanks in
> >> advance.
> >>
> >
> >

0
Ben
8/25/1999 2:33:04 PM
Create a computed column in the dddw defined as
chapter+"~t"+string(sequence)
and use this for the display column.  This should mean that ItemChanged
fires for all rows.

HTH

Simon

Ben Gong wrote in message <37C3FE9F.123211A@yahoo.com>...
>Thanks for both. The problem with this technique is the ItemChanged event
only
>fires once and this will only gets the first row fo the DDDW the user
selects. If
>the user scrolls up and down in the DDDW, and the item remains the same,
the
>ItemChanged event does not fire. Here is what I have to do:
>       The State criminal statute codes have chapters, sections,
subdivisions and
>sequences. A chapter always has more than one section, which almost always
has more
>than one subdivision, whih may have more than one sequence. Now all of
these are
>separate columns. The user wants to just select the chapter columns and
wants me to
>auto set all of the rest plus the charge description. This can be done when
the
>chapter is first selected, which is also the first record of that chapter.
When the
>user scrolls up and down the DDDW, the chapter value remains the same, so
the
>ItemChanged event does not fire again. Here is what the DDDW looks like:
>     Chapter    Section           Subd           Sequence          Charge
Desc
>        609         001                2bd                1
>Murder1
>       609          001                2bd                2
>Murder2
>       609          001                2bd                3
>Attempted Murder
>       Etc, etc
>Thanks.
>
>Sambu Subramanyam wrote:
>
>> Sanjiv & Ben,
>>
>> Use the GETROW() function on the Datawindowchild to get the row selected
by the
>> user in a DDDW.  Following is the sample code:
>>
>> /**********************************************************************/
>> datawindowchild ldwc_customer
>> long ll_rtncode, ll_row, ll_custid
>> String ls_customer
>>
>> // Get the DDDW attached to the 'cust_id' column.
>> ll_rtncode = dw_order.GetChild('cust_id', ldwc_customer)
>>
>> IF ll_rtncode = -1 THEN MessageBox("Error", "Not a DataWindowChild")
>>
>> // Get the row selected by the user
>> ll_row = ldwc_customer.getrow()
>>
>> // For DEBUG purpose.
>> // Get the ID & Company Name from the Datawindowchild
>> ll_custid   = ldwc_customer.GetItemNumber(ll_row, 'id')
>> ls_customer = ldwc_customer.GetItemString(ll_row, 'company_name')
>>
>> MessageBox ( 'Select ID and Customer', 'ID   : ' + &
>>                                        string(ll_custid) + '~n~r' + &
>>                                        'Name : ' + ls_customer)
>>
/***************************************************************************
*/
>>
>> I am not sure whether there are any events that gets executed when the
user is
>> scrolling in a DDDW.
>>
>> Sambu Subramanyam
>> Saudi Aramco
>> Dhahran, Saudi Arabia.
>>
>> On Tue, 24 Aug 1999 20:58:02 -0700,
>>  in powersoft.public.powerbuilder.general
>> Sanjiv Das [TeamSybase] <No-Spam-SDas@CompuServe.Com> wrote:
>> >Ben
>> >
>> >You can't directly get the row that the user clicked on. You can write
code
>> >in the ItemChanged event of the parent DW where you get the data value
on
>> >the parent column, get a handle to the child DW, then perform a Find ( )
on
>> >the child DW looking the the data value in the relevant column. This
will
>> >tell you which row had the selected value.
>> >
>> >HTH
>> >
>> >Sanjiv Das [TeamSybase]
>> >
>> >
>> >Ben Gong <dazhig@yahoo.com> wrote in message
>> >news:37C31A1A.DEAEF47@yahoo.com...
>> >> Hi, All,
>> >>      When a DDDW on a column opens for the user to pick an item, and
>> >> when the user clicks on a row or scrolls up/down in the DDDW, is there
>> >> any way to get the row number of the DDDW? I have tried this in PB 5,
>> >> and it did not seem to work. Any ideas about PB 6.5 or PB 7.0? Thanks
in
>> >> advance.
>> >>
>> >
>> >
>


0
Simon
8/25/1999 3:19:10 PM
Thanks. Philip also suggested this way, and tried just now. It works but this is
much slower than a table column, especially when I backspaced to delete the
entry. So I would like to create such a field by itself and let the users select
from this column. Thanks again.

Simon Caldwell wrote:

> Create a computed column in the dddw defined as
> chapter+"~t"+string(sequence)
> and use this for the display column.  This should mean that ItemChanged
> fires for all rows.
>
> HTH
>
> Simon
>
> Ben Gong wrote in message <37C3FE9F.123211A@yahoo.com>...
> >Thanks for both. The problem with this technique is the ItemChanged event
> only
> >fires once and this will only gets the first row fo the DDDW the user
> selects. If
> >the user scrolls up and down in the DDDW, and the item remains the same,
> the
> >ItemChanged event does not fire. Here is what I have to do:
> >       The State criminal statute codes have chapters, sections,
> subdivisions and
> >sequences. A chapter always has more than one section, which almost always
> has more
> >than one subdivision, whih may have more than one sequence. Now all of
> these are
> >separate columns. The user wants to just select the chapter columns and
> wants me to
> >auto set all of the rest plus the charge description. This can be done when
> the
> >chapter is first selected, which is also the first record of that chapter.
> When the
> >user scrolls up and down the DDDW, the chapter value remains the same, so
> the
> >ItemChanged event does not fire again. Here is what the DDDW looks like:
> >     Chapter    Section           Subd           Sequence          Charge
> Desc
> >        609         001                2bd                1
> >Murder1
> >       609          001                2bd                2
> >Murder2
> >       609          001                2bd                3
> >Attempted Murder
> >       Etc, etc
> >Thanks.
> >
> >Sambu Subramanyam wrote:
> >
> >> Sanjiv & Ben,
> >>
> >> Use the GETROW() function on the Datawindowchild to get the row selected
> by the
> >> user in a DDDW.  Following is the sample code:
> >>
> >> /**********************************************************************/
> >> datawindowchild ldwc_customer
> >> long ll_rtncode, ll_row, ll_custid
> >> String ls_customer
> >>
> >> // Get the DDDW attached to the 'cust_id' column.
> >> ll_rtncode = dw_order.GetChild('cust_id', ldwc_customer)
> >>
> >> IF ll_rtncode = -1 THEN MessageBox("Error", "Not a DataWindowChild")
> >>
> >> // Get the row selected by the user
> >> ll_row = ldwc_customer.getrow()
> >>
> >> // For DEBUG purpose.
> >> // Get the ID & Company Name from the Datawindowchild
> >> ll_custid   = ldwc_customer.GetItemNumber(ll_row, 'id')
> >> ls_customer = ldwc_customer.GetItemString(ll_row, 'company_name')
> >>
> >> MessageBox ( 'Select ID and Customer', 'ID   : ' + &
> >>                                        string(ll_custid) + '~n~r' + &
> >>                                        'Name : ' + ls_customer)
> >>
> /***************************************************************************
> */
> >>
> >> I am not sure whether there are any events that gets executed when the
> user is
> >> scrolling in a DDDW.
> >>
> >> Sambu Subramanyam
> >> Saudi Aramco
> >> Dhahran, Saudi Arabia.
> >>
> >> On Tue, 24 Aug 1999 20:58:02 -0700,
> >>  in powersoft.public.powerbuilder.general
> >> Sanjiv Das [TeamSybase] <No-Spam-SDas@CompuServe.Com> wrote:
> >> >Ben
> >> >
> >> >You can't directly get the row that the user clicked on. You can write
> code
> >> >in the ItemChanged event of the parent DW where you get the data value
> on
> >> >the parent column, get a handle to the child DW, then perform a Find ( )
> on
> >> >the child DW looking the the data value in the relevant column. This
> will
> >> >tell you which row had the selected value.
> >> >
> >> >HTH
> >> >
> >> >Sanjiv Das [TeamSybase]
> >> >
> >> >
> >> >Ben Gong <dazhig@yahoo.com> wrote in message
> >> >news:37C31A1A.DEAEF47@yahoo.com...
> >> >> Hi, All,
> >> >>      When a DDDW on a column opens for the user to pick an item, and
> >> >> when the user clicks on a row or scrolls up/down in the DDDW, is there
> >> >> any way to get the row number of the DDDW? I have tried this in PB 5,
> >> >> and it did not seem to work. Any ideas about PB 6.5 or PB 7.0? Thanks
> in
> >> >> advance.
> >> >>
> >> >
> >> >
> >

0
Ben
8/25/1999 5:15:52 PM
Reply:

Similar Artilces:

How to set the row number and get the row number for ("selected row) in Datagrid
I face a problem that i can't get the selected row of the datagrid in both server side script (VB.net) and client side script (javascript) As i can't use the button column / hyperlink column in the datagrid. Thus , i need to handle the change the background color of the selected row and also to get the selected row number for Update/Delete. Thanks in advance. This depends on how do you perform the selection. Do you want to implement chaning of the SelectedRow at the client side without any postback? If you have no issues with postback, then you can do s little trick here: 1. ...

Get the Row Number or Row ID
Hi, I am using Sybase Central v4.3 with Interactive SQL to query the SQL Commands. My concern is how to get the rownumber or row id in select queries. Is there any in built commands in the ASE. If not please suggest me how to get the rownumber. Thanks.... Unless i'm mistaken, ASE does not use a rowid... it can have a timestamp, but it is updated with every modification to the row. http://infocenter.sybase.com/help/topic/com.sybase.help.ase_15.0.blocks/html/blocks/blocks34.htm -- Cory Sane [TeamSybase] Certified Sybase Associate DBA for ASE 15.0 "Santhanam P" wrote...

The row number and offset of each row in the page should have a matching entry in row number table
Is the proper correction for the following to recreate the table BCPout/IN or table to table insert, or just drop and recreate the index? Row number is 0. Is there a way to correct just the data page? Table Corrupt: The row number and offset of each row in the page should have a matching entry in row number table; check this page (page#=772121 row#=0 offset in row number table=0) Table Corrupt: The row number and offset of each row in the page should have a matching entry in row number table; check this page (page#=772121 row#=0 offset in row number table=0) Table Corrupt: The row...

Get the ROW of DDDW
Hello, pls' help me I'm wirking in a Data Window, into that, i have a DDDW in a column, i want get the information about the row choised in the DDDW, but i can�t. I�m using scrolltorow(row) --- row of DOW, and retrieve,and setfocus, that no function. pleas help meeeee!!!! Thanks Bye -- Juan Antonio Ben�tez Do a GetChild on the DDDW, and then a GetRow on that handle. However, there are only a subset of the datawindow functions that will work on a DDDW. On Fri, 16 Apr 1999 17:18:58 -0400, in powersoft.public.powerbuilder.datawindow Juan Antonio Ben�tez <algod...

get number from row
if i have a this string to select a row from database of acess: select TOP 1 * from odkazy how i elicit from it id column? i need know id from select row then just get the id... select top 1 id from odkazy... PS..you would need an order by clause in the select statement otherwise the TOP has no meaning.. hth***********************Dinakar NethiLife is short. Enjoy it.*********************** my problem: (for example) if i have 5 columns with numbers in select row and i want display cast of this numbers I write: one = ds.tables("Odkazy").Rows(i)("...

getting the number of rows...
how can you get the number of rows in query resault with out filling dataset and checking the "count"? afaik - you can't - - you've got to have an entity to count the rows - the dataset is the 'finished product' that contains the result of your query - until you've queried and received the data from the database, you don't know how many rows you've receivedDavid WierMCP/ASPInsiderASPNet101.com - where to look first!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calendar Generator on the web!(Please 'Mark as ...

How do you get the number of rows
I have a gridview and I want to display the total number of rows of data like 5000 rows? This is not the same as the GridView1.Rows.Count, which gives the number of rows being displayed like 10 of 5000 rows. How do I get at the total? Hi, i think what you are asking is how to get the number of rows of the bounded dataset. Lets say you bound a dataset to the grid, you only need to get the number of rows of the first table in the dataset: myDataset.tables(0).rows.count As simple as that!   regards, njs That works in ASP.NET 1.x That doesn't work in ASP.NET 2.0...

How do I get the row number?
I have tryed to find a way to include the row number in a querry but without result. I have a table select some rows ordered and now I will add a column called rank How do I get the rownumber in the field rank ? Thanks in advance Jan O Jan O www.olsmar.com The way I'd suggest assigning a row number to your resultset is to INSERT your resultset into a temporary table or table variable which has an IDENTITY column, something like this: -- set up a table variable to hold the resultset DECLARE @myTable (Rank int identity(1,1) primary_key, ColumnA va...

How to get the number of rows that were UPDATED
Using DW.NET 1.0 And VB.NET 71 I have a datastore after Updatadata() i want know the number of rows updated. How to get the number of rows ?? Thanks Peter Stojkovic Try using the RowsAffected property of the Transacation object. Regards, Dave Fish Sybase DataWindow .NET Webcast December 16, 2004: www.customermining.com/Sybase/NETRegPage.html TeamSybase blogs: http://www.teamsybase.net/blogs DataWindow.NET code examples available on CodeXchange: http://datawindownet.codexchange.sybase.com On 16 Dec 2004 05:00:23 -0800, "Peter M�ller" &...

Getting the number of Rows (Records)
How do I get and return the number of rows (records) in a sql 2005 database, Some code samples would be helpful Thanks Joe   Hi, that would be something like this: select count(*) from yourTable The * can also be replaced by a columnname but since I didn't know your table structure I used * in the example. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons. Ok, guys this isn't going to work. Take a look at my code. I need it to return the current record that was inserted. Is there a was to do that &n...

Getting row number from SelectedIndexChanged??
Hello, now, I have 2 template columns, the first is a hyperlink column that consist of userno, the next is the gender which is represented by a radiobuttonlist. The radiobuttonlist fire up a method when somebody clicks on or change the selected one: Protected Sub SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim objItem As DataGridItem Response.Write(CType(DataGrid1.Items.Item(DataGrid1.SelectedIndex).FindControl("hl_oNo"), HyperLink)) End Sub I need to read the userno from the hyperlink column so that the...

How to get selected rows in Powerbuilder
Greetings All, Using PB 9.0.3. I have a window that has 1 datawindow on it. This datawindow is being populated with data to serve as a "email" type system. I need the user to be able to highlight rows and then delete all rows they chose. So far I have been unsuccessful trying to get information on the selected rows. I am currently using: dw_1.Object.Data.Selected to try to get the information, but am getting the following error: Error: Non-array expected in ANY variable at line 2 in clicked event of object cb_1 of w_inboxdel. string setting setting = dw_1.Object.Da...

Getting numbers of rows from a database
Hi!Can anybody help me please? I don't know what is wrong with the underline row... Dim UtilizadorID As String = HttpContext.Current.User.Identity.Name.ToString Dim ProducaoSource As New SqlDataSource() ProducaoSource.ConnectionString = ConfigurationManager.ConnectionStrings("seaempiresdbConnectionString1").ToString() ProducaoSource.SelectCommandType = SqlDataSourceCommandType.Text ProducaoSource.SelectCommand = "SELECT * FROM Producao WHERE ProdUserID = UtilizadorID" TotalLinhas = ProducaoSource.Rows.Count() If TotalLi...

get the current row in DDDW
I need to get the row that has been selected by the user in the DDDW. The value that gets displayed and stored as data value is not unique. i think this is a bug in pb8 build 9056: i have a dddw that has non-unique display value and unique data values. when i pick a value in the dddw other than the first one it always picks the first one that matches the display value.. e.g, display value = A, B, B, B, B data value = 1, 2, 3, 4, 5 IF i PICK ROW NUMber 5 with data value = 5 and display value = B it will pick data vale = 2 and display value = 2 in the itemchanged...

Web resources about - How to get a row number in DDDW - sybase.powerbuilder.general

Number - Wikipedia, the free encyclopedia
A number is a mathematical object used to count , label, and measure . In mathematics , the definition of number has been extended over the years ...

Number - Wikipedia, the free encyclopedia
A number is a mathematical object used to count , label, and measure . In mathematics , the definition of number has been extended over the years ...

Europeans open their hearts to vast numbers of the desperate
More than 1 million refugees arrived in Europe in 2015, and were mostly met with kindness and empathy, writes Ruth Pollard.

'Significant Number' Of Harper Patronage Appointees Have Offered To Resign: Liberals 122
... were made in the last days of the previous Conservative government. OTTAWA — The federal Liberal government says a "significant number'' of ...

Return of investment for cybersecurity: Can we put a number on it?
... to make money in order to pay salaries (including salaries of the cybersecurity team), so their point of view, based mainly on financial numbers, ...

Here are Amazon's cute holiday sales figures translated into real numbers
Amazon is notoriously tight-lipped about the details of its business. It took years before the company revealed the size of its cloud business ...

Wild ride: China markets by the numbers
For investors who couldn't bear to look, here are the giant slides and huge gains on the wild ride that was investing in China.

2015: By The Numbers
... what with last year’s GM recall, Sony hack, and the like — we still had rather a lot go on in the last 365 days. Here’s a run-down of the numbers ...

FIRST LOOK: Kylie Minogue Strips Joshua Sasse Down in Sexy, New 'Galavant' Number
ETonline has your first look at the singer, who is adding her star power to the new season of the ABC musical.

By The Numbers: Disastrous End For Chip Kelly With The Eagles
A look at what led to the Philadelphia Eagles firing head coach Chip Kelly. Why the move made sense and what Kelly himself did to lead to it. ...

Resources last updated: 1/3/2016 2:33:49 PM