click-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dshah <dipitas...@exit41.com>
Subject Re: Question on Panel Control and documentation on Panels?
Date Wed, 27 Jan 2010 22:58:29 GMT

Hi Bob,
When I put the printout as you specify I do get the 'true' for both
statements.  However, when I debug it, the controlMap on the Panel is empty
and also when I try to render anything on the panel or form, I am getting
nothing.. Maybe I am not understanding how the render works in this case..
below is a simple example of what I am doing.

public class myPage extend Page {
   myPanel myPanel;
   String a = "abc";
   
   onInit() {
    super.onInit();
    myPanel = new myPanel("mypanel");
    myPanel.initialize(a);
    addControl(myPanel);
  }
}

my-page.htm:
$myPanel

public class myPanel extends Panel {
   Form form = new Form("form");
   String b;
   Submit doSubmit= new Submit("submitthis", "submit", this,
"onSubmitClick");
   
  public myPanel (String name) {
	super(name);
	setTemplate("/my-panel.htm"); 
   }

    public void initialize(String a) {
        this.b = a;
        this.addModel("b", b);
        form.add(doSubmit);
        this.add(form);
   }
}

my-panel.htm:
<body>
         #someMacro(show_details $form)
</body>

someMacro.vm:
#macro(show_details  $form)
     <div> string value for b is $b </div>
     #if($form)
        <div> $form.fields.submitthis </div>
     #end
#end

So what I was expecting is that when my-page.htm is rendered, I would see
the following:
abc
submitthis (button)

However, I am seeing nothing - any idea what i am doing wrong?

Thanks!
Dipita



-- 
View this message in context: http://n2.nabble.com/Question-on-Panel-Control-and-documentation-on-Panels-tp4464010p4470274.html
Sent from the click-user mailing list archive at Nabble.com.

Mime
View raw message