views:

211

answers:

1

Hi there,
after some hours of checking out documentation, I am somewhat desperate: Basically I need to populate a TabContainer with some TextBoxes, and some Checkboxes. All theses neatly arranged: Labels to the left, fields to the right.
To have this done I use a TableContainer that I add to the TabContainer, create the TextFields and add them to the TableContainer. All is rendered ok. But when it comes to a checkbox, I can't find the trick to have a label displayed at all. If I: - add a label-attribute to creation statement say:
var text8 = new dijit.form.CheckBox({
id:"zuschauer_" + i, value: "zuschauer", label:"fritt"});
Firefox comes up with a "containerNode is null" - Error

  • try to add a tag: Nothing is shown (no error, but alas: no label):
    var text9 = dojo.create('<label>');
    dojo.attr(text9,"for","zuschauer_" + i);
    dojo.attr(text9,"content","fritt");

  • try to add a div or somewhat else on the tablecontainer (disabled Labels): Firefox comes up whith: Error: uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLDivElement.appendChild]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: ...

  • same is for created TextNodes...

So how the hack:
- Would I generate a label to a checkbox programatically (no html template possible, I've seen the code around, creating a checkbox but having a 'label for' on the html before. This would not be helpful, as I don't know how many checkboxes I need at designtime. These are to be genereated completly at runtime.
- Would I have this very simple design done programatically, Must be easy, this is not rocket sience. Do I really need the TableContainer to have this done?
- Can I create static text in a TableContainer?
Any hint would be helpful
Desperate
Det

+1  A: 

I would suggest creating an HTML string then setting it as content of a ContentPane. If you need to build the form programatically, you might make your own widget that extends ContentPane and takes the data as you get it, and generates the right innerHTML. That' going to end up being simpler than trying to cobble this together out of existing widgets.

Sam Foster