CN103473054A - Method for displaying data correctly in input box in Webview based on Android platform - Google Patents
Method for displaying data correctly in input box in Webview based on Android platform Download PDFInfo
- Publication number
- CN103473054A CN103473054A CN2013104030853A CN201310403085A CN103473054A CN 103473054 A CN103473054 A CN 103473054A CN 2013104030853 A CN2013104030853 A CN 2013104030853A CN 201310403085 A CN201310403085 A CN 201310403085A CN 103473054 A CN103473054 A CN 103473054A
- Authority
- CN
- China
- Prior art keywords
- input
- data
- webview
- label
- assignment
- 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.)
- Granted
Links
Images
Abstract
A method for displaying data correctly in an input box in Webview based on an Android platform includes that data formatting is conducted in a function of last input label. blur () losing a focus, data resetting operation is conducted in a function of next input label. focus () obtaining the focus, and assignment reduction or assignment emptying is conducted; the assignment is an original value, namely a value in the input box is not changed; the assignment is empty, namely the value in the input box is empty. Emptying is that a unique Editview input box control is found through a method of conducting finding step by step by using a parent label, the content of the control is emptied when the input box is switched, and webview data is operated at an application end. By means of the method, complex Javascript can be used for conducting data formatting in an Input label, and the phenomenon that displaying can not be conducted normally due to hardware and software limitation is avoided.
Description
[technical field]
The invention belongs to software technology field, specifically refer to that input frame in the Webview based on Android platform correctly shows the method for data.
[background technology]
Web page program based on Android Webview technological development, its framework is divided into Webcore core layer and Android display layer, and parsing the label of webpage, Webcore all to show by the Android presentation layer, the input frame control of Android presentation layer definition at present is a plurality of labels in a corresponding webpage, can cause inputting data and occur abnormal.
Webview is the bridge control of Html and Android inside, Webview is responsible for parsing and the demonstration work of Html, and for the Input input frame, Html holds show as<input > label form, when Webview loads Html, resolve Html and be presented on screen.For Input input frame label, in order to realize input function, Webview creates an Android input control Editview certainly, and only creates one.The flow process of input is, clicks the Input label, and Input label and Android are bound from the input control of wound, the purpose of binding, one is that another one is exactly data sharing, i.e. Input label and the data sharing of Android input control in order on Input, to cover and to show.At this moment data interaction presents two kinds of modes, one is when the Input label data has renewal (this situation is exactly to operate the Input label by Javascript), another kind of mode is (situation is exactly because use input method to be inputted mostly, directly data is write in the Android input control) exactly when Android input control Data Update.Because there is data binding, so, when the Input label data changes, can upgrade the Android input control.When changing, the Android input control can be updated in the Input label.
And the operation of Javascript end and the operation of Android end adhere to different threads separately.And, topmost being problematic in that, all Input labels all share an Android input control, when this just uses the Javascript special efficacy to carry out input control, when switching during input frame, because call the reason such as sequential, make the data of control or can not get upgrading in time, perhaps delayed updating, so just there will be, the data problem of leaping up presented at present.
As shown in Figure 1, redraw operation and adhere to two different threads separately and carry out because Webview initiates Javascript data manipulation and Editview, so operation sequential the unknown, and normal order should be, the value of the current input label of advanced row data operation change, then carry out the Editview transposition and redraw 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]
Technical matters to be solved by this invention is to provide input frame in a kind of Webview based on Android platform correctly to show the method for data.
The present invention is achieved in that
In a kind of Webview based on Android platform, input frame correctly shows the method for data, comprises the steps:
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 the interior value of input frame empties for sky.
Further, described emptying, for the mode of searching step by step by father's label finds unique Editview input frame control, adopt in the switching input frame, empties the content of this control, thereby operate the data of webview in application end.
The invention has the advantages that: in the Webview Web page application program, can use complicated Javascript to carry out the format of data in the Input label, and can the situation that can not normally show not occur because of the hardware and software limitation.
[accompanying drawing explanation]
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.
[embodiment]
Webview is the control that Android realizes browser technology, and its core technology is Webcore.Utilize Webview can realize browser function, comprise the Javascript technology of using.In prior art, when the Input label is used the complex operations such as Javascript is emptied, providing data formatting in to Webview, occur that in Webview, the Input label data is altered the abnormal situation in position.Find the problem reason, the present invention provides concrete foundation for dealing with problems, since redraw and carry out in Editview after the code that the phenomenon presented is Javascript holds, can only be the working time of improving Javascript, and the technology of this respect be difficult to solve because of the software and hardware bottleneck.
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 next input label .focus() operation of data once being reset in obtaining the function of focus, carry out assignment reduction or assignment for empty, assignment is that initial value is that the interior value of input frame is constant, and assignment is that the interior value of input frame empties for sky.
The 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 control in Webview does not directly provide modification, so the mode of searching step by step by father's label finds unique Editview input frame control, employing is in the switching input frame, empty the content of this control, thereby the data at application end operation webview, solve the problem that do not empty existed at present.
The modification code is as follows:
Adding above-mentioned code in the webview control, and by seteditviewclear() function is provided to the Javascript end, at input label .focus() initiatively call and empty in event.
The present invention can make and on multimedia terminal, use exploitation based in the Webview Web page application program, can use complicated Javascript to carry out the format of data in the Input label, and can the situation that can not normally show not occur because of the hardware and software limitation.
The foregoing is only better enforcement use-case of the present invention, be not intended to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any modification of doing, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.
Claims (2)
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:
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 the interior value of input frame empties for sky.
2. in the Webview based on Android platform as claimed in claim 1, input frame correctly shows the method for data, it is characterized in that: described emptying, for the mode of searching step by step by father's label finds unique Editview input frame control, employing is in the switching input frame, empty the content of this control, thereby operate the data of webview in application end.
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 true CN103473054A (en) | 2013-12-25 |
CN103473054B 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 (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102436391A (en) * | 2010-09-29 | 2012-05-02 | 卓望数码技术(深圳)有限公司 | Android WebKit control method and system |
US20120311526A1 (en) * | 2011-06-02 | 2012-12-06 | Recursion Software, Inc. | System and method for pervasive software platform-based model driven architecture application generator |
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 |
US20130268446A1 (en) * | 2012-04-10 | 2013-10-10 | Talkto, Inc. | System and method for entry of structured data |
-
2013
- 2013-09-06 CN CN201310403085.3A patent/CN103473054B/en active Active
Patent Citations (6)
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 |
US20120311526A1 (en) * | 2011-06-02 | 2012-12-06 | Recursion Software, Inc. | System and method for pervasive software platform-based model driven architecture application generator |
CN102955694A (en) * | 2011-08-31 | 2013-03-06 | 中国电信股份有限公司 | Client implementation method based on WebKit browser and client |
US20130268446A1 (en) * | 2012-04-10 | 2013-10-10 | Talkto, Inc. | System and method for entry of structured data |
CN102999336A (en) * | 2012-11-19 | 2013-03-27 | 北京奇虎科技有限公司 | Application interface realizing method and application interface realizing system |
Also Published As
Publication number | Publication date |
---|---|
CN103473054B (en) | 2016-05-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9448977B2 (en) | Website blueprint generation and display algorithms to reduce perceived web-page loading time | |
US20170031574A1 (en) | Supporting webpage design and revision irrespective of webpage framework | |
CN103135879B (en) | Display packing, display device and electronic equipment | |
US20130050249A1 (en) | Selective rendering of off-screen content | |
US20180349107A1 (en) | Preview Changes To Mobile Applications At Different Display Resolutions | |
CN104503655A (en) | Application program interface display control method and device | |
CN103309560A (en) | Multi-interface information display method and terminal | |
CN111339463A (en) | List data display method and device and electronic equipment | |
CN104020950A (en) | Input method based on touch screen and input device with touch screen | |
CN111290737B (en) | Method and device for application program development and electronic equipment | |
US10768947B2 (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 | |
CN102591685B (en) | Method and device for implementation of automatic online updating of application program | |
CN103685328A (en) | Advertisement broadcasting method | |
US8850354B1 (en) | Multi-window web-based application structure | |
CN104052769A (en) | Method, apparatus and system for updating resources contained by mobile terminal application | |
CN114218890A (en) | Page rendering method and device, electronic equipment and storage medium | |
US10747943B2 (en) | Method, device, client apparatus, and electronic device for presenting webpages | |
CN106155708A (en) | A kind of dynamic load and the method and system of renewal content of pages | |
US8819568B1 (en) | Electronic paper display updates | |
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 | |
CN105607909B (en) | Method and system for improving list development efficiency on basis of MVC frame | |
CN109522507B (en) | Method for uniformly managing webpage components | |
CN103473054B (en) | In Webview based on Android platform, input frame correctly shows the method for data |
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 |