cancel
Showing results for 
Search instead for 
Did you mean: 

Mistake on p.15 of WDJ Tut #3 Note: this is also marked as a question!

Former Member
0 Kudos

At the top of p.15 of WDJ Tutorial #3 (Simple Input Form), it says to name the transparent container "Button Container". If you do this, you get an error saying there is already a button container, which is true because we put one inside the Form Group when told to do so on p.14.

So instead of calling the second transparent container "ButtonContainer", I just called it "MessageContainer".

But here's my question:

Why can't NWDS keep track of these view items by their fully resolved names, so that a name like "SomeContainer" within the Form Group of the Form View is distinct from a container with the same name "SomeContainer" within the Root Container of the Form View?

Doesn't the Java refer to these things by their fully resolved names ????

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

View elements must have unique IDs per view. If you don't set an ID by yourself, the view designer assigns such a unique ID automatically like "Button1" etc.

As a rule of thumb, I would assign explicit IDs only to view elements that are

- accessed in wdDoModifyView()

- represent some semantic entity in the view, e.g. some data table

For other elements like labels etc. it's often not really necessary to assign "nicer" IDs than the auto-generated ones.

In the generated code there are no references generated for these IDs, only a hash map containes them as keys, That's why they have to be unique per view.

Armin

former_member181923
Active Participant
0 Kudos

Ah - hash maps!

Thanks very much for answering that one.

Regards

djh

Answers (1)

Answers (1)

former_member181923
Active Participant
0 Kudos

Also, this transparent container must be marked GridLayout; otherwise, the colCount field does not appear and you therefore can't set it to 2.