UpdateField

PowerBuilder Native Interface

IPB_Session interface:

UpdateField method

Description

Refreshes a visual property of a PowerBuilder object.

Syntax

UpdateField(pbobject obj, pbfieldID fid)

Argument

Description

obj

The pbobject whose user interface property needs to be changed

fid

The field ID of the object

Return Values

PBXRESULT. Returns success or failure.

Examples

This function changes the title of a DataWindow control:

void CallBack::f_newtitle(IPB_Session* session, pbstring str_val, pbobject dwobj)
{

   pbclass cls;
   pbfieldID fid;
   cls=session->GetClass(dwobj);
   fid=session->GetFieldID(cls, "title");
   if (fid==kUndefinedFieldID)
      return;
   session -> SetPBStringField(dwobj,fid,str_val);
   session -> UpdateField(dwobj,fid);
   return ;
}

Usage

When you change any visual property of a PowerBuilder object by calling Set<type>field functions, the property is changed but the property is not refreshed in the graphical user interface. UpdateField refreshes the visual properties of PowerBuilder objects. You must call this function explicitly when changing any visual property with the Set<type>field functions.

See Also