You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thorsten <al...@fastmail.fm> on 2010/03/11 17:28:18 UTC

Interaction behavior / site

Hi,

my site has two labels. One shows a total amount. If the user clicks on
the other label, a tooltip shows up, where the user can increase the
total amount with help of different links:
+-------------------------------
+ <a href=???>increase by 1</a>+
+ <a href=???>increase by 2</a>+
+ <a href=???>increase by 3</a>+
+-------------------------------

How do I implement this?

So far, I have a QTipBehaviour class, that controls the tooltip. But how
can I change the total amount from there?


Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Interaction behavior / site

Posted by Thomas Kappler <th...@isb-sib.ch>.
On 03/11/10 22:36, Thorsten wrote:
> On Thu, 11 Mar 2010, Michael O'Cleirigh wrote:
>
> Hi Michael,
>
>> The content of the tooltip should be a panel.  The panel's model can
>> contain the List<Integer>  of the increases you want offered and then
>> it can use a repeater or ListView to render each option.  If the
>> links were AjaxLink subclasses you could set their model to be the
>> particular Integer they represented and then within the
>> onClick(final AjaxRequestTarget target) method handle the necessary
>> changes to your totals.
>
> I'm still confused. My main page looks like this:
> <html>
>      <span wicket:id="tooltip">  Click on me, and a tooltip will show up
>      </span>
> </html>
>
> class MainPage extends WebPage {
>      final Label tooltipHolder = new Label("tooltip", "asdf");
>      add(tooltipHolder);
>      tooltipHolder.setOutputMarkupId(true);
>      tooltipHolder.add( new QTipBehaviour( new TooltipPanel(??? ));
> }
>
> So I don't have hany markup-id for the panel. I could define it in the
> html as a hidden div, but is there a way of without an additional div?

I don't know QTipbehaviour, but it should take care of that. That's how 
it works with ModalWindow, for instance.

If you just define a simple TooltipPanel and try it out, what happens?

-- Thomas

-- 
-------------------------------------------------------------------
   Thomas Kappler                        thomas.kappler@isb-sib.ch
   Swiss Institute of Bioinformatics         Tel: +41 22 379 51 89
   CMU, rue Michel Servet 1
   1211 Geneve 4
   Switzerland                              http://www.uniprot.org
-------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Interaction behavior / site

Posted by Thorsten <al...@fastmail.fm>.
On Thu, 11 Mar 2010, Michael O'Cleirigh wrote:

Hi Michael,

> The content of the tooltip should be a panel.  The panel's model can
> contain the List<Integer> of the increases you want offered and then
> it can use a repeater or ListView to render each option.  If the
> links were AjaxLink subclasses you could set their model to be the
> particular Integer they represented and then within the
> onClick(final AjaxRequestTarget target) method handle the necessary
> changes to your totals.

I'm still confused. My main page looks like this:
<html>
    <span wicket:id="tooltip"> Click on me, and a tooltip will show up
    </span>
</html>

class MainPage extends WebPage {
    final Label tooltipHolder = new Label("tooltip", "asdf");
    add(tooltipHolder);
    tooltipHolder.setOutputMarkupId(true);
    tooltipHolder.add( new QTipBehaviour( new TooltipPanel(??? ));
}

So I don't have hany markup-id for the panel. I could define it in the
html as a hidden div, but is there a way of without an additional div?

Thorsten

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Interaction behavior / site

Posted by Michael O'Cleirigh <mi...@rivulet.ca>.
Hi Thorsten,

The content of the tooltip should be a panel.  The panel's model can 
contain the List<Integer> of the increases you want offered and then it 
can use a repeater or ListView to render each option.  If the links were 
AjaxLink subclasses you could set their model to be the particular 
Integer they represented and then within the onClick(final 
AjaxRequestTarget target) method handle the necessary changes to your 
totals.

There is also a client side version to this where all the tooltip's are 
written out invisible with the page and you have a custom Javascript 
class/object that is aware of the totals amount and can update it based 
on a client side "onclick" event's on the links.

Regards,

Mike

> Hi,
>
> my site has two labels. One shows a total amount. If the user clicks on
> the other label, a tooltip shows up, where the user can increase the
> total amount with help of different links:
> +-------------------------------
> +<a href=???>increase by 1</a>+
> +<a href=???>increase by 2</a>+
> +<a href=???>increase by 3</a>+
> +-------------------------------
>
> How do I implement this?
>
> So far, I have a QTipBehaviour class, that controls the tooltip. But how
> can I change the total amount from there?
>
>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org