Ticket #301 (closed defect: wontfix)

Opened 2 years ago

Last modified 2 years ago

TListBox id not present

Reported by: jake Owned by: xue
Priority: urgent Milestone: 3.0.3
Component: Prado Framework v3 Version: 3.0
Severity: major Keywords:
Cc:

Description

I just noticed if I don't specify an for a TListBox then the id param for the TListBox doesn't get outputted, only the name. I think all controls should have the id outputted regardless if you specified one or not right?

Change History

Changed 2 years ago by xue

  • status changed from new to closed
  • resolution set to wontfix
  • milestone set to 3.0.3

This is by design. A control's id is displayed only when needed (either explicitly set or needed by javascript). By doing so, we avoid output useless long IDs (for example, IDs of cells in a datagrid. These IDs are very long.)

Changed 2 years ago by jake

  • status changed from closed to reopened
  • resolution wontfix deleted

Actually I needed it by javascript which is how I noticed it wasn't present thus I needed to provide one and the TListBox was in a TDataGrid also. How would I make the id outputted if one is not specified so I can perform some javascript stuff on it?

Changed 2 years ago by xue

  • status changed from reopened to closed
  • resolution set to wontfix

The only way is to set an explicit ID for it (it doesn't make sense you don't specify such an ID while you still want to address it in js because you even don't know the actual ID.)

Changed 2 years ago by jake

  • status changed from closed to reopened
  • resolution wontfix deleted

I was just relying on the system's automated generated ids since I'd have to use getClientID() regardless if I specify an id or not so javascript knows the id of the control. It didn't really matter what the id is, just needed back an identifier and I think it should normally work that way to provide some sort of consistancy. If I have a TCheckbox with no id present thats outputted in a TDataGrid it also has its automated generated ID so I see no reason why a TListBox would not have it.

Changed 2 years ago by xue

  • status changed from reopened to closed
  • resolution set to fixed

I already explained why we don't want to output every id. And the solution to your problem is to set an explicit ID. This is by design and we don't want to change this behavior.

The TCheckBox outputs id perhaps is because you set it autopostback and thus it's associated with some (internal) js.

Changed 2 years ago by xue

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 2 years ago by xue

  • status changed from reopened to closed
  • resolution set to wontfix
Note: See TracTickets for help on using tickets.