English
বাংলা
Català
Dansk
Deutsch
Español
فارسی
Français
Galego
Magyar
Italiano
Norsk Bokmål
Português
Português Brasil
Русский
Slovenščina
Svenska
简体中文
THE PROJECT
I am new
Downloads
Blog
Official Communities
Screenshots
Support forums
Developers wiki
Community apps
Free eyeos server
ABOUT US
Who are we?
History and awards
License information
Contact us
Portfolio
Press
PRODUCTS & SERVICES
eyeos for schools
eyeos for administrations
Meetings scheduler
eyeDesigner
Specific programming
Branded installation
Training
Support
PARTNERS
How to be a partner
Partners list
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
September 02, 2010, 04:53:21 pm
Home
Help
Search
Login
Register
eyeos Forums
>
eyeOS Development
>
Applications Development
> Topic:
Troubles with the Hidden widget...
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Troubles with the Hidden widget... (Read 2002 times)
Nanawel
eyeOS Team
Senior User
Offline
Posts: 420
Troubles with the Hidden widget...
«
on:
November 21, 2007, 10:53:57 pm »
Hi everybody,
I'm developping a new application for eyeOS but I encounter some troubles to stabilize it.
After several loooong hours debugging the different points, I discovered that sometimes, when I use the
setText()
method on a
Hidden widget
, the value is not well saved!
What I find very strange is that it does not happen all the time, but randomly during the execution.
To sum up a little what I do:
I use a Hidden widget to store a serialized array. When I need a value, I unserialize the text and pick the data up. But sometimes I also need to delete a cell of the array. So I unserialize it into a variable, unset the cell I want to remove, then serialize the array again and store it in the Hidden widget.
Most of the time, it works. But sometimes, it doesn't.
So when I check if the array is empty in a next request, the cell is still here so the behaviour is not what I expect...
Did someone experience the same problem? And who do know how to solve it?
Thanks in advance
«
Last Edit: November 21, 2007, 11:54:16 pm by Nanawel
»
Logged
Anaël
AnthongRedbeard
Junior User
Offline
Posts: 65
Re: Troubles with the Hidden widget...
«
Reply #1 on:
November 23, 2007, 03:59:32 pm »
make sure you are calling setText() after Show() or else the object won't exist.
make sure it has a globallly unique name.
I have found instances where the content makes a difference in whether or not it will work. For example, the Lable widget won't allow any line returns, so I had to add something to strip them out before applying it to the widget.
-Anthong
Logged
Nanawel
eyeOS Team
Senior User
Offline
Posts: 420
Re: Troubles with the Hidden widget...
«
Reply #2 on:
November 25, 2007, 04:58:22 pm »
Quote from: AnthongRedbeard on November 23, 2007, 03:59:32 pm
make sure you are calling setText() after Show() or else the object won't exist.
make sure it has a globallly unique name.
I already checked that before, but it doesn't seem to be the problem...
Thanks for your help anyway
Another suggestion?
Logged
Anaël
ben-fr34
New User
Offline
Posts: 44
Re: Troubles with the Hidden widget...
«
Reply #3 on:
November 26, 2007, 01:22:50 pm »
I have same proble with it :
If i put a XML structure in a hidden widget, i can't get the value.
Logged
Lars Knickrehm
eyeOS Team
Hero User
Offline
Posts: 2557
Re: Troubles with the Hidden widget...
«
Reply #4 on:
November 26, 2007, 06:19:17 pm »
I think the problem with the xml structure is because we're using UTF-8 and so there problems with < and > ...
Use htmlentities($myvarFORhidden, ENT_QUOTES,'UTF-8'); for creating the HTML code and use html_entity_decode($myvarFROMhidden, ENT_QUOTES,'UTF-8'); for creatting the default sting.
That should work, or?
«
Last Edit: November 26, 2007, 06:21:52 pm by lars-sh
»
Logged
Regards,
Lars Knickrehm
The eyeos project 2010.
http://eyeos.org/
ben-fr34
New User
Offline
Posts: 44
Re: Troubles with the Hidden widget...
«
Reply #5 on:
November 26, 2007, 08:57:21 pm »
It was a part of my problem.
for inject array into a hidden widget, I've unse this function :
function array2HiddenText($array){
//transform array to XML.
$sTbl = getArrayText($array,-1,1);
$sTbl = str_replace("\t", '', $sTbl);
$sTbl = str_replace("\n", '', $sTbl);
return htmlentities($sTbl, ENT_QUOTES);
}
If I use hidden widget with "htmlentities" in UFT-8, i have a proble with other caracters (as é, à, ç, è...)... Sorry, I'm french...
Logged
Lars Knickrehm
eyeOS Team
Hero User
Offline
Posts: 2557
Re: Troubles with the Hidden widget...
«
Reply #6 on:
November 26, 2007, 10:43:18 pm »
I know (German: äöüß
), but that should work! You need to use 'UTF-8' for the third parameter for htmlentinities! So your code should be like this:
Code:
function array2HiddenText($array){
//transform array to XML.
$sTbl = getArrayText($array,-1,1);
$sTbl = str_replace("\t", '', $sTbl);
$sTbl = str_replace("\n", '', $sTbl);
return htmlentities($sTbl, ENT_QUOTES,'UTF-8');
}
Does it work? It should work!
Logged
Regards,
Lars Knickrehm
The eyeos project 2010.
http://eyeos.org/
Nanawel
eyeOS Team
Senior User
Offline
Posts: 420
Re: Troubles with the Hidden widget...
«
Reply #7 on:
November 27, 2007, 10:16:32 am »
Personally I'm not using special characters (because my array only holds md5 sums, so digits and ASCII letters).
But nom it makes me think about a problem Jose solved a few days back when I told him about my problems with getXmlConfig(). It could come from a cache problem. I'm not sure about that but I'll try to search in this direction.
Logged
Anaël
ben-fr34
New User
Offline
Posts: 44
Re: Troubles with the Hidden widget...
«
Reply #8 on:
November 27, 2007, 11:35:25 am »
It doesn't work with 'UTF-8' : this codage generate other special caracters incompatible with the hidden widget.
it be sure, if you have '<' ou '>' un your text, the hidden widget is not usable.
Logged
Nanawel
eyeOS Team
Senior User
Offline
Posts: 420
Re: Troubles with the Hidden widget...
«
Reply #9 on:
November 27, 2007, 12:00:05 pm »
What follows doesn't concern the Hidden widget but it may be applied to any encoding problem experienced with widgets.
In eyeFTP, I was forced to use this to prevent "undefined entity" in Firefox:
Code:
eyeX('rawjs',array('js' => 'document.getElementById("'.$myPid.'_eyeFTP_path_TXTBOX").value=Base64.decode("'.base64_encode($dir).'");'));
The element "eyeFTP_path_TXTBOX" is a basic textbox widget, but if I used "setText()" some characters seem to cause an error in the browser. So I replaced the line
Code:
$GLOBALS['eyeFTP_path_TXTBOX']->setText($dir);
by the previous one and.... it works.
Maybe it could help you but I'm not sure.
I forgot to mention it as a potential bug. I'll do it soon.
«
Last Edit: November 27, 2007, 09:39:21 pm by Nanawel
»
Logged
Anaël
Lars Knickrehm
eyeOS Team
Hero User
Offline
Posts: 2557
Re: Troubles with the Hidden widget...
«
Reply #10 on:
November 27, 2007, 02:53:49 pm »
Maybe the hidden widget should en/decode the text by its own..., or?
Logged
Regards,
Lars Knickrehm
The eyeos project 2010.
http://eyeos.org/
Pages: [
1
]
Go Up
Print
eyeos Forums
>
eyeOS Development
>
Applications Development
> Topic:
Troubles with the Hidden widget...
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Announcements
-----------------------------
=> eyeOS Announcements
-----------------------------
Support Forums
-----------------------------
=> eyeOS 2.0 feedback
=> General Help
=> Installation / Update Help
-----------------------------
eyeOS Users
-----------------------------
=> Tips and Tricks
=> Suggestions and Ideas
=> General Discussion
-----------------------------
eyeOS Development
-----------------------------
=> Applications Development
=> Modifications
=> Bug Reports
=> Websites
-----------------------------
Language Specific
-----------------------------
=> العربية - Arabic forum
===> Egypt- Users Group
===> United Arab Emirates (UAE) - دولة الإمارات العربية المتحدة - Users Group
=> Australia users group
=> Bahasa Indonesia - Indonesian forum
=> বাংলা - Bengali forum
=> Bosanski - Bosnian forum
=> Български - Bulgarian forum
=> Canada users group
=> Català - Catalan forum
=> 汉语 - Chinese forum
=> Deutsch - German forum
===> Ankündigungen
===> Hilfe und Unterstützungen
===> Entwicklung und Ideen
===> Off Topic
=> Español - Spanish forum
===> Ayuda
===> Desarrollo
===> Instalaciones
===> Grupo de usuarios de España
===> Grupo de usuarios de Chile
===> Grupo de usuarios de Colombia
===> Grupo de usuarios de Argentina
===> Grupo de usuarios de México
===> Grupo de usuarios de Venezuela
===> Grupo de usuarios de la República Dominicana
===> Grupo de usuarios de Honduras
=> Français - French forum
===> Annonces
===> Aide
===> Développement
===> Discussions générales
===> Archives
===> Groupe d'utilisateurs du Cameroun
===> Groupe d'utilisateurs de Côte d'Ivoire
===> Groupe d'utilisateurs d'Algérie
=> Ghana users group
=> Groupe d'utilisateurs du Maroc دليل المجموعة في المغرب
=> עברית - Hebrew forum
=> Italiano - Italian forum
=> 日本語 - Japanese forum
=> Lietuvių kalba - Lithuanian forum
=> Magyar - Hungarian forum
=> بهاس ملايو - Malay forum
=> فارسی - Persian forum
=> Polski - Polish forum
=> Português - Portuguese forum
===> Grupo de usuários Brasileiros
===> Grupo de usuários de Portugal
===> eyeOS 2.X
===> eyeOS 1.X
=> Русский - Russian forum
=> Română - Romanian forum
=> Srpski - Serbian forum
=> Slovenčina - Slovak forum
=> Slovenski - Slovene forum
=> Singapore users group
=> (ภาษาไทย - Thai forum
=> Türkçe - Turkish forum
=> Tiếng Việt - Vietnamese forum
-----------------------------
Old forums
-----------------------------
=> eyeEdu
=> eyeLIMS
=> eyeOS 0.9.x
===> Announcements
===> Bug Reports
===> eyeOS MiniServer
===> General Help
===> Installation Help
===> New langs and documentation
===> New programs
===> Requests
Loading...