linghtboxes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

linghtboxes

Bèrto ëd Sèra
Hi!

A very stupid question, I know... but how do I make a lightbox that
simply has a "close" button? Using formula when I'm actually not
editing anything (I'm just showing a message) seems pretty much an
overkill, or is it?

Bèrto

--
==============================
Constitution du 24 juin 1793 - Article 35. - Quand le gouvernement
viole les droits du peuple, l'insurrection est, pour le peuple et pour
chaque portion du peuple, le plus sacré des droits et le plus
indispensable des devoirs.


--
To unsubscribe, reply using "remove me" as the subject.
Reply | Threaded
Open this post in threaded view
|

Re: linghtboxes

Steven Costiou
Hi,
i think a simple anchor with a call to the "answer" method in the enclosed widget of the lightbox is enough, like :

e a action:|self answer] text: 'Close' (you can replace it by a button, i guess e button action:[self answer] text: 'Close').

The "self answer" closes the lightbox and can get back an value with "self answer: aValue".

You can handle the returned value when you do create your lightbox :

self lightbox: aWidget onAnswer:[:ans| ]

"ans" is here the returned value by the "self answer: aValue".

I'm not 100% sure but i think it does work.

However if you just show something, you do not need any formula in your lightbox, a simple widget with formatted text is enough (if i'm not mistaken).

-Steven Costiou-



2010/4/15 Bèrto ëd Sèra <[hidden email]>
Hi!

A very stupid question, I know... but how do I make a lightbox that
simply has a "close" button? Using formula when I'm actually not
editing anything (I'm just showing a message) seems pretty much an
overkill, or is it?

Bèrto

--
==============================
Constitution du 24 juin 1793 - Article 35. - Quand le gouvernement
viole les droits du peuple, l'insurrection est, pour le peuple et pour
chaque portion du peuple, le plus sacré des droits et le plus
indispensable des devoirs.


--
To unsubscribe, reply using "remove me" as the subject.

Reply | Threaded
Open this post in threaded view
|

Re: linghtboxes

Nicolas Petton
In reply to this post by Bèrto ëd Sèra
Le jeudi 15 avril 2010 à 19:12 +0300, Bèrto ëd Sèra a écrit :
> Hi!
>
> A very stupid question, I know... but how do I make a lightbox that
> simply has a "close" button?

Hi Berto,

a lightbox is just a decorator, so you can call #answer from the widget
displayed inside the lightbox.

e a
    text: 'close';
    action: [self answer]



Cheers!

Nico

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: linghtboxes

Nicolas Petton
In reply to this post by Steven Costiou
Le jeudi 15 avril 2010 à 18:39 +0200, Steven Costiou a écrit :
>
> You can handle the returned value when you do create your lightbox :
>
> self lightbox: aWidget onAnswer:[:ans| ]
>
> "ans" is here the returned value by the "self answer: aValue".
>
> I'm not 100% sure but i think it does work.


yes, that's exactly how it works :-)

Nico

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: linghtboxes

Bèrto ëd Sèra
Thanks guys, it works like a charm :) I have one more stupid question,
to make sure your idea of my cleverness doesn't get exceedingly
optimistic :))

I have this method:

    dive: aSymbol [
      <category: 'navigation'>
      self application profileWidget profileUUID: aSymbol.
      self lightbox: (self application profileWidget).
      self application profileWidget markDirty.
    ]

that is supposed to open the lightbox. Too bad it doesn't, but if I
reload the page I see the lightbox there. So I guess marking the
lightbox widget dirty to force visualization is just not the way it
works...

Bèrto

--
==============================
Constitution du 24 juin 1793 - Article 35. - Quand le gouvernement
viole les droits du peuple, l'insurrection est, pour le peuple et pour
chaque portion du peuple, le plus sacré des droits et le plus
indispensable des devoirs.


--
To unsubscribe, reply using "remove me" as the subject.
Reply | Threaded
Open this post in threaded view
|

Re: linghtboxes

Steven Costiou
I'm not sure to understand why you mark your widget dirty.
When you do (try to) open the lightbox, it should update your "profileWidget" when it does display this widget in your lightbox.

If you need to mark it dirty after seeing it in the lightbox, you should do something like :

e a action:[self markDirty. self answer]; text: "close" (in your profileWidget).

When closing the lightbox, it'll do it.

However, i'm not sure to understand what you want to do...

-Steven Costiou-



2010/4/15 Bèrto ëd Sèra <[hidden email]>
Thanks guys, it works like a charm :) I have one more stupid question,
to make sure your idea of my cleverness doesn't get exceedingly
optimistic :))

I have this method:

   dive: aSymbol [
     <category: 'navigation'>
     self application profileWidget profileUUID: aSymbol.
     self lightbox: (self application profileWidget).
     self application profileWidget markDirty.
   ]

that is supposed to open the lightbox. Too bad it doesn't, but if I
reload the page I see the lightbox there. So I guess marking the
lightbox widget dirty to force visualization is just not the way it
works...

Bèrto

--
==============================
Constitution du 24 juin 1793 - Article 35. - Quand le gouvernement
viole les droits du peuple, l'insurrection est, pour le peuple et pour
chaque portion du peuple, le plus sacré des droits et le plus
indispensable des devoirs.


--
To unsubscribe, reply using "remove me" as the subject.

Reply | Threaded
Open this post in threaded view
|

Re: linghtboxes

Bèrto ëd Sèra
That means I'm definitely moving the wrong way, okay, let's show some
bad code. I have a table showing a list of search results. They are in
short form and you have two functions:
1) drop, which drops a result you don't care for, so you can save the
juice of what you really need). This works fine.
2) dive, which is supposed to be a popup object inspector, shown in a light box.

This code generates the anchors to be clicked:

    rowContentsForProfile: aResult atIndex: anIndex onTable: aTable [
        <category: 'building'>
        | taxonomy profile |
        taxonomy := Ambaradan.AmbaradanLocalizedApplication metamapper taxonomy.
        profile := Ambaradan.AmbaradanLocalizedApplication metamapper profile.
        ^[:e | | row head separator |
            row := e tr.
            head := row td.
            head colspan: 5.
            (head a)
               build: (self localize: #dive);
               action: [self dive: (aResult uuid)].
            (head a)
               build: (self localize: #drop);
               action: [self drop: anIndex].
            (aResult mmtSet)
                do: [:each | aTable build: (self rowContentsForMatch: each
withTaxonomy: taxonomy withProfile: profile)].
            separator := e tr.
            (separator td)
               colspan: 5;
               hr. ]

These are the two methods that are supposed to do the job:
    drop: anIndex [
      <category: 'data manipulation'>
      self result resultSet removeAtIndex: anIndex.
      self markDirty.
    ]

    dive: aSymbol [
      <category: 'navigation'>
      self application profileWidget profileUUID: aSymbol.
      self lightbox: (self application profileWidget).
      self application profileWidget markDirty.
    ]

Bèrto

--
==============================
Constitution du 24 juin 1793 - Article 35. - Quand le gouvernement
viole les droits du peuple, l'insurrection est, pour le peuple et pour
chaque portion du peuple, le plus sacré des droits et le plus
indispensable des devoirs.


--
To unsubscribe, reply using "remove me" as the subject.
Reply | Threaded
Open this post in threaded view
|

Re: linghtboxes

Nicolas Petton
Le jeudi 15 avril 2010 à 20:23 +0300, Bèrto ëd Sèra a écrit :
>
>     dive: aSymbol [
>       <category: 'navigation'>
>       self application profileWidget profileUUID: aSymbol.
>       self lightbox: (self application profileWidget).
>       self application profileWidget markDirty.
>     ]

Hi Berto,

the markDirty here shouldn't be necessary, as you will build the
profileWidget in the lightbox anyway.

Except for that I don't really see what's wrong.

Nico

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: linghtboxes

Bèrto ëd Sèra
What happens is that it doesn't show up, but if you reload the whole
page it's there. I ended up not using it, because it was too small in
size, but I'll post an example later, I have other places in which it
will be needed.

Bèrto

2010/4/16 Nicolas Petton <[hidden email]>:

> Le jeudi 15 avril 2010 à 20:23 +0300, Bèrto ëd Sèra a écrit :
>>
>>     dive: aSymbol [
>>       <category: 'navigation'>
>>       self application profileWidget profileUUID: aSymbol.
>>       self lightbox: (self application profileWidget).
>>       self application profileWidget markDirty.
>>     ]
>
> Hi Berto,
>
> the markDirty here shouldn't be necessary, as you will build the
> profileWidget in the lightbox anyway.
>
> Except for that I don't really see what's wrong.
>
> Nico
>



--
==============================
Constitution du 24 juin 1793 - Article 35. - Quand le gouvernement
viole les droits du peuple, l'insurrection est, pour le peuple et pour
chaque portion du peuple, le plus sacré des droits et le plus
indispensable des devoirs.


--
Subscription settings: http://groups.google.com/group/iliad/subscribe?hl=fr