Subject | Re: [IBO] Defining field lengths in IBO4 |
---|---|
Author | Geoff Worboys |
Post date | 2001-08-30T14:08:27Z |
> I once asked for a possibility to specify different fieldI guess the problem you are referring to is that TIB_Edit always
> lengths for TIB_Edit. For example if I have
> CUSTOMERNAME as VARCHAR(50), then I
> sometimes want to let the customer enter only 35
> characters and sometimes 50.
>
> Is it possible to do with existing components? I'm
> using IBO4.2Eb and EnhComponets 2.0.7.Beta
resets its maxlength via the field length - and so you have no control
over it directly.
The solution is going to be dependant on how exactly you want to
implement this requirement. That is;
If the different length requirement is on different controls attached
to different dataset instances then you could setup using TIB_EditEnh
with an enhanced mask on the column similar to...
::EM::cccccccccccc;0;_
where you specify as many 'c' as required for the maximum length.
If you want to change the length depending on the row selection (on
the same control or dataset instance) then things get more
interesting...
* If the length requirement can be detected according to the value
of the input then a masklist in EditEnh may support what you require.
* You may be able to assign/reset enhanced masks like the one
described above to the column at runtime. Not sure how well this
works, I've not tried it.
* You can always revert to API calls to reset the maxlength (reset
it after the any StateChanged event).
* Deriving your own variation of the edit control that makes the
MaxLength property public - and then resetting the value when the
dataset state changes
* Perhaps asking Jason to make this property public (not published)
and then again you need to reset the maxlength whenever a statechange
event occurs (which will have reset the length back to the field
size).
Just some thoughts, depends on what you need.
Geoff Worboys
Telesis Computing