Link to home
Start Free TrialLog in
Avatar of Mahmoud Al Jundi
Mahmoud Al JundiFlag for Jordan

asked on

PowerBuilder Datawindow Problem

Dear Experts

I am using PowerBuilder ver 9.0.3, I have created a datawindow (Free From) in order to make the user to fill Info. to update certain tables using a command button which holds the procedure.

The Datawindow has only four fields, I am using GetItem inside command button to get the data from the four fields for processing.

My problem, if the user forgets to to Press TAB or Enter after entering data in Last Field  the GetItem command will never get the data from that field.

How can I fix that. User generated image User generated image
call super::buttonclicked;
setpointer(hourglass!)
vch_no = getitemstring(1,"CUSTOM_VCH_NO")
vch_date = getitemdatetime(1,"CUSTOM_VCH_DATE")
exit_no = getitemstring(1,"CUSTOM_EXIT_NO")
exit_date = getitemdatetime(1,"CUSTOM_EXIT_DATE")

Open in new window

SOLUTION
Avatar of thoyyib
thoyyib

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

You need to call dw_1.AcceptText() in command button's clicked event, which takes the data of current field even if user does not press tab or enter.

this would solve your problem, if no please let me know.

regards
msn
Avatar of Mahmoud Al Jundi

ASKER

Thanks, it worked

I use it before the Getitem :

if accepttext() = 1 then
Getitem.........
end if

Is there a different way of usage ? I mean ,must be in a condition statement ?

Thanks


hi,

need not be in IF condition statement, but even if you put it works,

Caution: Accepttext() trigegrs itemchanged event, make sure nothing goes wrong when you call Accepttext on itemchanged event.,

regards
msn
Hi,

better prefix with datawindow controlname.accepttext() to avoid future problems when you add another DW control

thanks
msn
Is my syntax correct ?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

"need not be in IF condition statement, but even if you put it works,"

What is the other syntax if it is not in condition format ?

Thanks
hi,
even we can write directly also without IF condition.

i think better have if conditon, if accepttext() fails, we can track it and display user message.

your code holds good

regards
msn
hi,

if the solution had worked, please accept the same and share the points.

thanks
manohar
Thank you guys