Jump to content

TUniFormattedNumberEdit and inputType',['number']


cyracks

Recommended Posts

Hello.

On mobile keyboard shown for TUniFormattedNumberEdit is not numeric, but alphanumeric. I have tried every tip on the forum but can not make it show numeric keyboard.

None of the options bellow work.

(FrameEditNumQty.NumberEdit as IUniJSInterface).JSConfig('inputType',['number']); // this brakes the whole program
FrameEditNumQty.NumberEdit.JSInterface.JSConfig('inputType',['number']);
FrameEditNumQty.NumberEdit.JSInterface.JSCall('inputEl.dom.setAttribute', ['display', 'number']);
    with FrameEditNumQty.NumberEdit, JSInterface do begin
        JSAssign('inputEl.dom.type', ['number']);
    end;

I am using Version:1.90.0 build 1551.

Alternative would be to use TUniEdit with input type Number, but in this case I do not know how to show decimal separator as , it is always .
(I would actually prefer TUniEdit instead of TUniFormattedNumberEdit)

Thank you for the help.

Link to comment
Share on other sites

I am using desktop version of Unigui also in mobile application (I decided to use desktop version in mobile environment after comparing both and decided that mobile is not ok - I forget all the reasons but one of them was no gridview component and dbgrid did not have option ForceFit).

Desktop is ok also on mobile but there are some problems like inputtype for TUniFormattedNumberEdit. If you add uniedit and set inputtype to number everything is ok (keyboard is numeric), but decimal separator is . instead of , (do not know how to change that I tried a couple of options nothing worked). So I tried to use TUniFormattedNumberEdit, where decimal separator can be changed (there is also a thousand separator which is a bonus), but when used on mobile wrong keyboard is show. 

So the solution to my problem is either:
- change decimal separator (from . to ,) in unidit if inputtype is number or
- on mobile show numeric keyboard when using TUniFormattedNumberEdit.

Or put it another way, I would like to configure the following on one component:
- decimal separator
- keyboard that is show on mobile

Link to comment
Share on other sites

On the link above it is written that decimal separator for uniedit can be changed in ExtEvents function OnBeforeRender, but it does not work form me.

function OnBeforerender(sender)
{
sender.maskRe=/[+\-\,0-9]/
}

Is there really no way to change decimal separator in Uniedit if input type is number ?

Link to comment
Share on other sites

Any mobile device and no TUniFormattedNumberEdit does not show correct keyboard if I run demo \Demos\Desktop\FormattedEdit on mobile device

This is by default

image.jpeg.fd909582e799930fe34b1b10fe9d88e3.jpeg

This is how it looks if I manually change keyboard setting on mobile device that numbers are always shown

image.jpeg.66ac4e01e774d81d7fbf13dfa43dfbb6.jpeg

 

Link to comment
Share on other sites

I did not try on mobile demo, probably yes.

I am having trouble with input-type of desktop component TUniFormattedNumberEdit on mobile device. I know that mobile controls are more designed for mobile devices, but I am not asking for something to specific, just how to show the right type of keyboard.

Link to comment
Share on other sites

  • 2 months later...
Em 14/01/2024 às 11:03, cyracks disse:

Eu não tentei na demonstração móvel, provavelmente sim.

Estou tendo problemas com o tipo de entrada do componente de desktop TUniFormattedNumberEdit no dispositivo móvel. Eu sei que os controles móveis são mais projetados para dispositivos móveis, mas não estou pedindo algo específico, apenas como mostrar o tipo certo de teclado.

Você encontrou uma solução para o seu caso usando formattedNumberEdit ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...