CN103473054B - In Webview based on Android platform, input frame correctly shows the method for data - Google Patents

In Webview based on Android platform, input frame correctly shows the method for data Download PDF

Info

Publication number
CN103473054B
CN103473054B CN201310403085.3A CN201310403085A CN103473054B CN 103473054 B CN103473054 B CN 103473054B CN 201310403085 A CN201310403085 A CN 201310403085A CN 103473054 B CN103473054 B CN 103473054B
Authority
CN
China
Prior art keywords
input
data
input frame
label
webview
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310403085.3A
Other languages
Chinese (zh)
Other versions
CN103473054A (en
Inventor
吕宏伟
张登峰
余杭军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Centerm Information Co Ltd
Original Assignee
Fujian Centerm Information Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Centerm Information Co Ltd filed Critical Fujian Centerm Information Co Ltd
Priority to CN201310403085.3A priority Critical patent/CN103473054B/en
Publication of CN103473054A publication Critical patent/CN103473054A/en
Application granted granted Critical
Publication of CN103473054B publication Critical patent/CN103473054B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

In Webview based on Android platform, input frame correctly shows the method for data, comprise, at a upper input label .blur() lose in the function of focus and carry out providing data formatting, then at next input label .focus() operation of data once being reset in obtaining the function of focus, carry out assignment reduction or assignment for empty; Described assignment is initial value, refers to that the value in input frame is constant; Described assignment is that sky is that value in input frame empties. Emptying is that the mode of searching step by step by father's label finds unique Editview input frame control, adopts in switching input frame, empties the content of this control, thereby operates the data of webview in application end. The present invention can use complicated Javascript to carry out the format of data in Input label, and can not occur the situation that can not normally show because of hardware and software limitation.

Description

In Webview based on Android platform, input frame correctly shows the method for data
[technical field]
The invention belongs to software technology field, specifically refer to input frame in the Webview based on Android platformThe correct method that shows data.
[background technology]
Based on the web page program of AndroidWebview technological development, its framework is divided into Webcore coreLayer and Android display layer, and Webcore parses the label of webpage and will pass through Android presentation layerShow, the input frame control of at present Android presentation layer definition is multiple in a corresponding webpageLabel, can cause inputting data and occur abnormal.
Webview is the bridge control of Html and Android inside, and Webview is responsible for the parsing of HtmlWith demonstration work, for Input input frame, Html holds show as<input>label form, work as WebviewWhile loading Html, resolve Html and be presented on screen. For Input input frame label, for realityExisting input function, Webview is an Android input control Editview of wound certainly, and only creates one.The flow process of input is, clicks Input label, and Input label and Android tie up from the input control of woundFixed, the object of binding, one is that another one is exactly data sharing in order to cover and to show on Input,Be Input label and the data sharing of Android input control. At this moment data interaction presents two kinds of modes, oneIndividual is that (this situation is exactly to operate Input mark by Javascript in the time that Input label data has renewalSign), exactly in the time of Android input control Data Update, (situation is exactly because make to another kind of mode mostlyInput by input method, directly data are write in Android input control). Because having data ties upFixed, so, in the time that Input label data changes, can upgrade Android input control. Work as AndroidWhen changing, input control can be updated in Input label.
And the operation of Javascript end and the operation of Android end adhere to different threads separately. And, mainBe problematic in that, all Input labels all share an Android input control, this just usesWhen Javascript special efficacy is carried out input control, in the time switching input frame, because call the reasons such as sequential, makeThe data of control or can not get upgrading in time, or delayed updating, so just there will be, and presents at presentThe data problem of leaping up.
As shown in Figure 1, because Webview initiates Javascript data manipulation and Editview redraws operationAdhere to two different threads separately and carry out, thus the unknown of operation sequential, and normal order should be, advanced personThe value of the current input label of row data operation change, then carries out Editview transposition and redraws bindings,Because the unknown because of two threads of operation sequential, so there will be the problem of the data that leap up.
In view of this, the inventor, for the defect further investigation of prior art, has this case to produce then.
[summary of the invention]
It is defeated in a kind of Webview based on Android platform that technical problem to be solved by this invention is to provideEnter the method that frame correctly shows data.
The present invention is achieved in that
In Webview based on Android platform, input frame correctly shows a method for data, comprises as followsStep:
At a upper input label .blur() lose in the function of focus and carry out providing data formatting, then existNext input label .focus() obtain the operation of in the function of focus, data once being reset,Carry out assignment reduction or assignment for empty; Described assignment is initial value, refers to that the value in input frame is constant; InstituteThe value of stating assignment and being sky and be in input frame empties.
Further, described in empty, for the mode of searching step by step by father's label finds uniqueEditview input frame control, adopts in switching input frame, empties the content of this control, therebyIn the data of application end operation webview.
The invention has the advantages that: in Webview Web page application program, can use complicatedJavascript carries out the format of data in Input label, and can be because of hardware and software limitationThe situation that appearance can not normally show.
[brief description of the drawings]
The invention will be further described in conjunction with the embodiments with reference to the accompanying drawings.
Fig. 1 is input control sequential chart in the present invention.
[detailed description of the invention]
Webview is the control that Android realizes browser technology, and its core technology is Webcore. ProfitCan realize browser function with Webview, comprise the Javascript technology that uses. In prior art, whenWhile Input label in Webview being used to the complex operations such as Javascript empties, providing data formatting,Occur that in Webview, Input label data channels bit abnormal situation. Find problem reason, the present inventionConcrete foundation is provided for dealing with problems since the phenomenon presenting be after the code of Javascript end inEditview redraws and carries out, and can only be the running time of improving Javascript, and the technology of this respect is because of softHardware bottleneck and be difficult to solve.
In order to use Webview also to solve the problem of the data that leap up, use following technical scheme,At a upper input label .blur() lose in the function of focus and carry out providing data formatting, then at nextIndividual input label .focus() obtain the operation of in the function of focus, data once being reset, carry outAssignment reduction or assignment be sky, and assignment is that initial value is that value in input frame is constant, and assignment is that sky is inputtedValue in frame empties.
Javascript example code is as follows:
Wherein empty the settling mode of problem:
The mode that adopts application end initiatively to empty Editview is carried out, because the Editview in WebviewControl does not directly provide amendment, so that the mode of searching step by step by father's label finds is uniqueEditview input frame control, adopts in switching input frame, empties the content of this control, therebyIn the data of application end operation webview, solve the problem that do not empty existing at present.
Amendment code is as follows:
In webview control, adding above-mentioned code, and by seteditviewclear() function providesTo Javascript end, at input label .focus() initiatively call and empty in event.
The present invention can make to use exploitation based on Webview Web page application program on multimedia terminalIn, can use complicated Javascript to carry out the format of data in Input label, and can be because ofFor there is the situation that can not normally show in hardware and software limitation.
The foregoing is only better enforcement use-case of the present invention, be not intended to limit protection of the present inventionScope. Within the spirit and principles in the present invention all, any amendment of doing, be equal to and replace and improveDeng, within all should being included in protection scope of the present invention.

Claims (1)

1. in the Webview based on Android platform, input frame correctly shows and it is characterized in that the method for data:Comprise the steps:
Lose in the function of focus at a upper input label .blur (), to the buffer memory in input labelData are carried out providing data formatting, then obtain in the function of focus at next input label .focus ()The operation that data are once reset, carries out assignment reduction or assignment for empty; Described assignment reduction,Refer to that the value in input frame is constant; Described assignment is that sky is that value in input frame empties;
Described emptying, for the mode of searching step by step by father's label finds unique Editview input frameControl, adopts in switching input label input frame, empties the content of this control, thereby in applicationThe data of end operation webview.
CN201310403085.3A 2013-09-06 2013-09-06 In Webview based on Android platform, input frame correctly shows the method for data Active CN103473054B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310403085.3A CN103473054B (en) 2013-09-06 2013-09-06 In Webview based on Android platform, input frame correctly shows the method for data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310403085.3A CN103473054B (en) 2013-09-06 2013-09-06 In Webview based on Android platform, input frame correctly shows the method for data

Publications (2)

Publication Number Publication Date
CN103473054A CN103473054A (en) 2013-12-25
CN103473054B true CN103473054B (en) 2016-05-18

Family

ID=49797926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310403085.3A Active CN103473054B (en) 2013-09-06 2013-09-06 In Webview based on Android platform, input frame correctly shows the method for data

Country Status (1)

Country Link
CN (1) CN103473054B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102436391A (en) * 2010-09-29 2012-05-02 卓望数码技术(深圳)有限公司 Android WebKit control method and system
CN102955694A (en) * 2011-08-31 2013-03-06 中国电信股份有限公司 Client implementation method based on WebKit browser and client
CN102999336A (en) * 2012-11-19 2013-03-27 北京奇虎科技有限公司 Application interface realizing method and application interface realizing system
US8453065B2 (en) * 2004-06-25 2013-05-28 Apple Inc. Preview and installation of user interface elements in a display environment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9250883B2 (en) * 2011-06-02 2016-02-02 Open Invention Network, Llc System and method for pervasive software platform-based model driven architecture application generator
US20130268446A1 (en) * 2012-04-10 2013-10-10 Talkto, Inc. System and method for entry of structured data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8453065B2 (en) * 2004-06-25 2013-05-28 Apple Inc. Preview and installation of user interface elements in a display environment
CN102436391A (en) * 2010-09-29 2012-05-02 卓望数码技术(深圳)有限公司 Android WebKit control method and system
CN102955694A (en) * 2011-08-31 2013-03-06 中国电信股份有限公司 Client implementation method based on WebKit browser and client
CN102999336A (en) * 2012-11-19 2013-03-27 北京奇虎科技有限公司 Application interface realizing method and application interface realizing system

Also Published As

Publication number Publication date
CN103473054A (en) 2013-12-25

Similar Documents

Publication Publication Date Title
US9857959B2 (en) Supporting webpage design and revision irrespective of webpage framework
US9448977B2 (en) Website blueprint generation and display algorithms to reduce perceived web-page loading time
EP3667520A1 (en) Webpage content extraction method and terminal device
US8959142B2 (en) Combining server-side and client-side user interface elements
US9122657B2 (en) Webpage display system leveraging OSGI
CN110263351A (en) A kind of multi-language translation method of webpage, device and equipment
CN103135879B (en) Display packing, display device and electronic equipment
CN109144615A (en) A kind of information issuing method, device, equipment and storage medium
DE202014010943U1 (en) Switch to and from native web applications
CN107908793A (en) The method and system of web page popup window
CN105528217A (en) Partial refreshing method and device based on display list
WO2014193380A1 (en) Multi-display system
US10810019B2 (en) Method for interface refresh synchronization, terminal device, and non-transitory computer-readable storage medium
CN104021016A (en) Method and browser for loading browser plug-in icons
CN106776784A (en) A kind of method that WEB page is quickly loaded
US8850354B1 (en) Multi-window web-based application structure
CN114218890A (en) Page rendering method and device, electronic equipment and storage medium
JP2022539442A (en) dynamic typesetting
CN109542404B (en) Page componentization construction method and device, storage medium and electronic equipment
CN106155708A (en) A kind of dynamic load and the method and system of renewal content of pages
US8819568B1 (en) Electronic paper display updates
CN103473054B (en) In Webview based on Android platform, input frame correctly shows the method for data
CN103744663A (en) Pre-caching technology based Android interface design frame model
US20140310589A1 (en) Creating a communication editable in a browser independent of platform and operating system
CN103838575A (en) Plug-in type page customization implementation method based on EXTJS frame

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant