You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by sv...@madsep.de on 2010/01/31 23:17:55 UTC

Re: Congratulations for Apache Click and some questions from a novice

Hi André,

I can shed some light on second question.

The request parameter are bound after the constructor was called, so 
you cannot
use these fields within the constructor.

If you move your code into onInit it should work.

If you need it inside the constructor you could read the paramter from the
request using getContext().getRequest().getParameter("enderecoIP");


AFAIK there is nothing like a ProgressBar (yet).
You might want to take a look at the clickclick project [1], there is 
an example
called "Lazy Load Demo" [2] (also it looks like the example is currently
broken), you could use this to show a message, that you're doing your analyzis
and show the result whens it's finished.
I'm currenty trying to implement this myself, so maybe I can help you if you
want to give it a try.

[1] http://code.google.com/p/clickclick/
[2] http://clickclick-jquery.appspot.com/ajax/lazy-load-demo.htm

hth
SVen

Zitat von André Gustavo Lomônaco <lo...@ipplus.com.br>:

>  Hi guys,
>
>   Congratulations for the Apache Click.
>
>   I'm just a simple Network Specialist and I'm impressioned how easy is to
> build a Web Application using Apache Click,
>   even for me with litte knowledgment about J2EE...
>
>   I'm trying to develop a Web Application to analyze Cisco and Juniper
> Configurations (Routers) using the examples in Click, and
>   if possible I would like to make 4 questions (if someone could help in
> any question I will appreciate a lot)
>
>   1) Is there any way to localize the menu.xml file, like
>
> menu.xml
> menu_pt_BR.xml
> menu_fr.xml
>
>    2) To permit the user chose the router to be analyze, I'm using the
> populate-on-select.htm example
>       I modified the populate-on-select.js to create a hyperlink     var
> html = 'Selected state: key -> ' + state.value + ', value -> ' +
> state.options[state.selectedIndex].text;
>    html+="<br>" + 'Selected city: key -> ' + city.value  + ', value -> ' +
> city.options[city.selectedIndex].text;
>    html+="<br>" + 'Selected suburb: key -> ' + suburb.value  + ', value ->
> ' + suburb.options[suburb.selectedIndex].text;
>    html+="<br>" + "<a
> href=/NetworkAdvisor/user/analisa-dot1x.htm?enderecoIP="+ suburb.value
> +">Verificar Dot1x</a>";
>
>    In the AnalisaDot1x.java file, I need to use the enderecoIP variable as
> an argument. Take a look:
>
> package br.com.ipplus.networkadvisor.page.user;
>
> import br.com.ipplus.networkadvisor.Cisco.*;
> import br.com.ipplus.networkadvisor.page.BorderPage;
> import org.apache.click.util.Bindable;
>
> public class AnalisaDot1x extends BorderPage {
>
>     @Bindable public String enderecoIP;
>
>     private String teste = new String();
>
>     public AnalisaDot1x() {
>
>         AnaliseDot1xCisco cisco = new AnaliseDot1xCisco();
>         System.out.println(enderecoIP);
>         //teste = AnaliseDot1xCisco.RetornaDot1x(enderecoIP);
>         addModel("teste", teste);
>           }
>        }      But when I try to access the enderecoIP variable, its value
> is null. I think the Page Public Method is invoked before the AutoBinding.
> What's the better way to modify my program to be able to receive the
> correct value from enderecoIP ??     3)  I could use with success the
> click-charts-1.0.jar.
>        But when I tried to use the graphs inside the tabbed-panel-demo the
> $chart wasn't render. Is there any way for me do that ?
>
> bar-chart.htm
>
> <div style="margin-left: 100px">
>  $chart
> </div>
>
> TabbedPanelDemoDevices.java
>
> package br.com.ipplus.networkadvisor.page.user;
>
> import java.util.List;
>
> import javax.annotation.Resource;
>
> import org.apache.click.control.Panel;
> import br.com.ipplus.networkadvisor.page.BorderPage;
> import org.apache.click.extras.panel.TabbedPanel;
> import org.apache.click.util.Bindable;
>
> /**
> * Provides an TabbedPanel demonstration.
> *
> * @author Phil Barnes
> */
> public class TabbedPanelDemoDevices extends BorderPage {
>
>    @Bindable public TabbedPanel tabbedPanel = new TabbedPanel();
>
>    public TabbedPanelDemoDevices() {
>        Panel panel1 = new Panel("panel1", "user/pie-chart.htm");
>        panel1.setLabel("The First Panel");
>        tabbedPanel.add(panel1);
>
>        Panel panel2 = new Panel("panel2", "user/line-chart.htm");
>        panel2.setLabel("The Second Panel");
>        tabbedPanel.add(panel2);
>
>        Panel panel3 = new Panel("panel3", "user/bar-chart.htm");
>        panel3.setLabel("The Third Panel");
>        tabbedPanel.add(panel3);
>
>        // Register a listener that is notified when a different panel is
> selected.
>        tabbedPanel.setTabListener(this, "onTabClick");
>    }
>
>    public boolean onTabClick() {
>        System.out.println("Tab Clicked");
>        return true;
>    }
> }
>
>    4) My analyze takes time. I'm thing using a Progress Bar or something
> like that. Is there any control in click today which I can use to make a
> Progress Bar ??
>
>  Sorry for some many questions and congratulations again to the team who
> builds Apache Click
>
>    My Best Regards,
>
>   Andre Lomonaco
>