Ticket #775 (defect)

Opened 7 months ago

Last modified 3 months ago

TListControl PromptValue cannot be selected using SelectedValue.

Status: closed (invalid)

Reported by: sergeymorkovkin Assigned to: xue
Priority: low Milestone: 3.1.2
Component: Prado Framework v3 Version: 3.1
Severity: minor Keywords:
Cc:

We have a list: <com:TDropDownList PromptText="-- Select please --" PromptValue=""> <com:TListItem Value="1">One</com:TListItem> </com:TDropDownList>

So, when form populates data from DB, an error occurs because it's trying to select PromptText? with and empty string.

Change History

01/16/2008 03:24:44 PM: Modified by xue

  • milestone set to 3.1.2.

03/11/2008 03:34:57 PM: Modified by xue

  • status changed from new to closed.
  • resolution set to invalid.

It is by design that you cannot select prompt item because it does not exist in the list (although you see it in HTML).

03/22/2008 03:52:09 PM: Modified by sergeymorkovkin

  • status changed from closed to reopened.
  • resolution deleted.

Probably, we need to allow merging of inline items with those that were bound? Since there's no way you can bind a list and add default selectable item on top of it. When binding DropDownList? control it's clearing inline items. I think it should also be able to persist them.

This will be VERY useful for situations when database is holding default value for some drop down list and you set it's Data property to an empty string, for example:

<com:TDropDownList ID="BindMe" PersistInlineItems="True">
<com:TListItem Value="" Text="-- Not selected --" />
<com:TDropDownList>

This will not prevent you from writing a generic code for populating forms from DB and saving them into.

03/24/2008 02:43:04 PM: Modified by xue

  • status changed from reopened to closed.
  • resolution set to invalid.

You CAN insert items to an existing item list. Note, the list controls have Items property which is of TList type. You can use TList.insertAt() to do the insertion at arbitrary place.

04/17/2008 08:38:37 AM: Modified by sergeymorkovkin

  • status changed from closed to reopened.
  • resolution deleted.

Yes, but in this case template logic spreads onto php code. I suggest to implement a boolean property 'MergeItems' specifying whether inline items are merged with datasourced.

04/18/2008 04:46:54 AM: Modified by tof06

  • status changed from reopened to closed.
  • resolution set to invalid.

Your suggestion is not related anymore to the initial ticket. It may be an enhancement for 3.1.3, we have to think about this. Please, post a new ticket for 3.1.3, with eventually, a forum post to allow discussion. Thanks.