?
Solved

Datawindow Query

Posted on 2008-10-07
3
Medium Priority
?
501 Views
Last Modified: 2013-12-26
Hi,

I have a datawindow control which i am using to assign different datawindow objects based on the selection of certain conditions. We have a AFC layer that contains objects specfic to our application which is basically inherited from the PFC layer. I have a function in one of the user objects defined in the AFC layer to format the sql's for all the datawindows dynamically based on the search condition selected by the users for each and every screen/report.
I want to perform an action based on the tag value of a column from a particular datawindow.  For ex.
lets assume we have datawindow  dw_1 which contains column1, colum2, column3.
I want to perform the following logic
If dw_1.object.column1.tag = 'OK' then
   <perform your check>
else if
   <do not perform your check>
End If.

this is a straight away method if i have only one datawindow control/object. In my case i need to get the column name of the appropriate datawindow object that is assigned to the datawindow control for a specific screen and then assign that column/control name to the command line 'dw_1.object.column1.tag ' to perfom the action i need. Can anybody shed me some light on how to go about this..

Please let me know if you need some more clarifications on my request.

Cheers
0
Comment
Question by:senmaddy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 375 total points
ID: 22663061
you can use getcolumn() and gecolumnname() function to get the column no/name from a datawindow and then use Describe function to get the property value instead of '.object 'notation.

See code snippet for example

Regards
Sandeep

e.g.
string ls_colname,ls_val
ls_colname = dw_1.GetColumnName()
ls_val = dw_1.Describ(ls_colname+".tag")
If ls_val = 'OK' Then
<process1>
Else
<process2>
End If
 
OR
string ls_colno,ls_val
 
ls_colno = string(dw_1.GetColumn())
ls_val = dw_1.Describ("#"+ls_colno+".tag")
If ls_val = 'OK' Then
<process1>
Else
<process2>
End If

Open in new window

0
 

Author Comment

by:senmaddy
ID: 22667352
Hi Sandeep,

thanks for your hint. I could not get the column name in the user object function since only the base sql of the datawindow is passed to function as an string argument.  
Neverthless, i used describe method to satisfy my need as described below.

   ll_Poscolumn = Pos(ls_BeforeLike,".",1)
   ls_column_name = Trim(Mid(ls_BeforeLike,ll_Poscolumn+1))
//            ls_check_upper = idw_requestor.object.productcode.tag
   ls_check_upper = idw_requestor.Describe(ls_column_name+".tag")
   Messagebox('ls_check_upper',ls_check_upper)
      IF ls_check_upper <> 'NU' then
            <process1>
      ELSE
            <process2>
      END IF

Many thanks once again for your time on this issue.
0
 

Author Closing Comment

by:senmaddy
ID: 31503913
Many Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question