Fork me on GitHub

Announcement

The oneye project has been discontinued. You might not expect further fixes and support from us. All community related systems are set to read-only mode. Though feel free to download and use oneye as-is or even fork it over at GitHub.

#1 2011-12-29 16:34:23

Steven
Member
From: Near Aix en Provence, France
Registered: 2011-07-19
Posts: 20
Website

Coding question

Hi,

I do this in an event.

            $Hdr = "Reservations: list of ".$Tmp[1]." for the ".$source." ".$userName;

            $Txt = $GLOBALS['Label_'.$father.'title']->text;
                eyex('messageBox', array('content' => 'Text: '.$Txt)); <-- just for testing !
            if($Txt) {
                $GLOBALS['Label_'.$father.'title']->setText($Hdr);
            } else {
                $Labelh = new Label(array(
                    'name' => 'Label_'.$father.'title',
                    'father' => $father,
                    'text' => $Hdr,
                    'x' => 20,
                    'y' => 20,
                ));
                $Labelh->show();
            }


The eyex instruction always displays an empty string, Why ?
Even if I change the code to force re-construction of the label, it will never do it, there is always the message (on the browserside)
    94665_Label_actions_panneltitle_Container already exists.
(Also when I destroy the label with ->remove() first!

I must be doing something -very basic- wrong.

Any ideas ?

Steven


Steven Lobbezoo
[url=http://www.maisons-de-france.com]www.maisons-de-france.com[/url]

Offline

#2 2011-12-29 22:18:34

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 731
Website

Re: Coding question

Hey again smile ,

some widgets do not get seriaized to minimized overhead in the $GLOBALS. In all the widget files at eyeOSxxxxxxxxxx/system/lib/eyeWidgets/widgets you can find a line like the following:

function show ($noserialize = 1) {

In case $noserialize is set to "0", you can use it from $GLOBALS without problems. In either case (as it is for labels), you cannot.

But setting $noserialize to "0" from within your code, helps wink ... So replace the latest statement in the shown code by:

$Labelh->show(0);

Best regards,
Lars Knickrehm

The oneye project.

Offline

#3 2011-12-29 23:12:34

Steven
Member
From: Near Aix en Provence, France
Registered: 2011-07-19
Posts: 20
Website

Re: Coding question

Thanks Lars,

I thought so ! :-))

Steven


Steven Lobbezoo
[url=http://www.maisons-de-france.com]www.maisons-de-france.com[/url]

Offline

#4 2011-12-29 23:19:48

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 731
Website

Re: Coding question

Steven wrote:

I thought so ! :-))

Me, too... Just to make sure wink


Best regards,
Lars Knickrehm

The oneye project.

Offline

Board footer

Powered by FluxBB