![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 10 of 20 total |
![]() |
Thu, Aug 27 2015 11:06 AM | Permanent Link |
Mark Brooks Slikware | Not too sure if this is the right forum for code snippet uploads. Apologies if not.
Today I knocked up a first draft for a HashHandler component. It's a non-visual component that you can drop on a form in order to encapsulate some of the browser hash functionality. It has two main functions: - It will fire an event when the browser hash changes - It can be used to update the browser hash It uses an internal name:value list to represent what's happening with the browser hash and assumes that your chosen format will be of this form: <Application URL>#<name=value>&<name=value>&<name=value> Events: - OnChange (fired when the hash changes) Properties: - NumPairs (readonly, used to get the number of pairs in the internal name:value list, typically in the OnChange event) - Names (readonly, used to get the Name element of a specific pair in the internal name:value list, typically in the OnChange event) - Values (readonly, used to get the Value element of a specific pair in the internal name:value list, typically in the OnChange event) Methods - Clear (empties the internal name:value list in preparation for adding) - Add (adds a new name:value pair to the internal name:value list) - Update (updates the browser hash with the contents of the internal name:value list) Source is attached - hopefully of some use to those of you who I've been discussing browser hash framework mechanisms with. Mark PS. Any bugs found are clearly intentional and put there only to see if you can spot them .............. Attachments: MCBHashHandler.wbs |
Thu, Aug 27 2015 11:12 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Mark,
<< Not too sure if this is the right forum for code snippet uploads. Apologies if not. >> Works for me. ![]() << Today I knocked up a first draft for a HashHandler component. It's a non-visual component that you can drop on a form in order to encapsulate some of the browser hash functionality. It has two main functions: >> Thanks, I'll check it out. Tim Young Elevate Software www.elevatesoft.com |
Fri, Aug 28 2015 8:46 AM | Permanent Link |
Uli Becker | Hi Mark,
thanks a lot for sharing your code. I'll try it after my vacation. Much appreciated. Uli |
Sat, Aug 29 2015 1:56 AM | Permanent Link |
StewCam | >>Mark Brooks wrote:
>>Not too sure if this is the right forum for code snippet uploads. Apologies if not. >>Today I knocked up a first draft for a HashHandler component [...] Thanks, Mark, this works well. The only problem I have encountered is that if the browser back button is used to go back to the start page then it generates an error: "Error: List index 0 out of bounds Line: 3070" I haven't worked out how to eliminate this error. |
Sat, Aug 29 2015 8:41 AM | Permanent Link |
StewCam | StewCam wrote:
>>Thanks, Mark, this works well. The only problem I have encountered is that if the browser back button is used to go back to the start page then it generates an error: >>"Error: List index 0 out of bounds >>Line: 3070" >>I haven't worked out how to eliminate this error. Answer to own question involved adding the following at the beginning of the OnChange handler for MCBHashHandler: var s: String; begin s := Window.Location.Hash; {Reguires WebDOM} if s[1] <> '#' then exit; |
Sat, Aug 29 2015 9:46 AM | Permanent Link |
Mark Brooks Slikware | >>StewCam wrote:
>>Answer to own question involved adding the following at the beginning of the OnChange handler for >>MCBHashHandler: >>var >> s: String; >>begin >> s := Window.Location.Hash; {Reguires WebDOM} >> if s[1] <> '#' then >> exit; Hi Stew Not sure you should ever get that event with no hash? Will have a look anyway. Thanks I've attached a sample project that may help Mark Attachments: HashTest.zip |
Sat, Aug 29 2015 8:08 PM | Permanent Link |
StewCam | Mark Brooks wrote:
>>Not sure you should ever get that event with no hash? Will have a look anyway. Thanks >>I've attached a sample project that may help Thanks, Mark, your project is very helpful. |
Sun, Aug 30 2015 3:45 AM | Permanent Link |
Uli Becker | Mark,
I used your component for the first time now and it really works great. Thanks again. Uli |
Sun, Aug 30 2015 5:57 AM | Permanent Link |
Uli Becker | Mark,
I can confirm what Stew described. Got the same error. The hash is just empty: >#View=home< >#View=edit< >#View=home< >< Uli |
Sun, Aug 30 2015 11:17 AM | Permanent Link |
Mark Brooks Slikware | Uli / Stew
I really canot repeat that here. Very strange. Now I know what Tim feels like! Of course feel free to modify the code as you wish if it fixes your problem, however it would also be great if you could show me some actual code and a series of actions that repeat the issue. Also, what browser(s) and OS(s) are we talking about here? Cheers Mark |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Sunday, March 26, 2023 at 04:50 AM | Privacy Policy![]() © 2023 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |