This is a migrated thread and some comments may be shown as answers.

Bug: FormDecorator is not applied to checkboxes in ListBox

8 Answers 79 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
spt
Top achievements
Rank 1
spt asked on 23 Dec 2009, 04:11 PM

            <telerik:radformdecorator id="FormDecorator1" runat="server" decoratedcontrols="CheckBoxes, RadioButtons, Buttons"  /> 
 
            <telerik:RadListBox  
                runat="server" ID="dlUsers" TransferToID="dlUsersAssign" 
                AllowTransfer="true"  AllowDelete="false" AllowReorder="false" AllowTransferDuplicates="false" 
                ButtonSettings-ShowTransferAll = "true" 
                TransferMode="Copy" SelectionMode="Multiple"   
                Width = "250px" Height = "110px" Skin="WebBlue">  
                   
                <Items> 
                    <telerik:RadListBoxItem Text="User1" Value="0" /> 
                    <telerik:RadListBoxItem Text="User2" Value="1" /> 
                    <telerik:RadListBoxItem Text="User3" Value="2" /> 
                    <telerik:RadListBoxItem Text="User4" Value="3" /> 
                </Items> 
                    
            </telerik:RadListBox> 
 
            <telerik:RadListBox  
                runat="server" ID="dlUsersAssign"    
                Width = "250px" Height = "110px" CheckBoxes="true"  > 
                <Items> 
                    <telerik:RadListBoxItem Text="User6" Value="6" /> 
                    <telerik:RadListBoxItem Text="User7" Value="7" /> 
                </Items> 
            </telerik:RadListBox> 
 
In initial state FormDecorator is applied to checkboxes in the left box, it's ok.
Now let's move some items from right box to left box.
FormDecorator will not be applied to new added items in the left box.

8 Answers, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 24 Dec 2009, 02:03 PM
Hello spt,

In order to achieve what you need you should force the RadFormDecorator to redecorate because the decoration has already finished with the loading of the page. I prepared for you the following code which does what you require:

<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <script type="text/javascript">
      
    function OnClientTransferred()
    {
      $find("<%=FormDecorator1.ClientID %>").decorate();
    }
      
    </script>
    <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="CheckBoxes, RadioButtons, Buttons" />
    <telerik:RadListBox runat="server" ID="dlUsers" TransferToID="dlUsersAssign" AllowTransfer="true"
        AllowDelete="false" AllowReorder="false" AllowTransferDuplicates="false" ButtonSettings-ShowTransferAll="true"
        TransferMode="Copy" SelectionMode="Multiple" OnClientTransferred="OnClientTransferred"
        Width="250px" Height="110px" Skin="WebBlue">
        <Items>
            <telerik:RadListBoxItem Text="User1" Value="0" />
            <telerik:RadListBoxItem Text="User2" Value="1" />
            <telerik:RadListBoxItem Text="User3" Value="2" />
            <telerik:RadListBoxItem Text="User4" Value="3" />
        </Items>
    </telerik:RadListBox>
    <telerik:RadListBox runat="server" ID="dlUsersAssign" Width="250px" Height="110px"
        CheckBoxes="true">
        <Items>
            <telerik:RadListBoxItem Text="User6" Value="6" />
            <telerik:RadListBoxItem Text="User7" Value="7" />
        </Items>
    </telerik:RadListBox>
</form>



We are currently thinking of optimizing the code and document it and thus this method is currently not exposed in the help.

Greetings,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
spt
Top achievements
Rank 1
answered on 20 Aug 2010, 01:14 PM
I compelled to open this topic once again.
All works fine in version 2010.1.519, but after upgrading to 2010.2.713 I found that FormDecorator is not applied
to checkboxes in the left box even in initial state.
Obviously, it is not aplied to items which were moved from right box to left box later.
0
Lini
Telerik team
answered on 23 Aug 2010, 07:34 AM
Hi,

With the 2010 Q2 release, the form decorator control will no longer automatically decorate checkboxes or radio buttons that already have a CSS class defined. If your checkboxes have a class attribute, you should remove it. I apologize for the inconvenience this has caused you

All the best,
Lini
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
spt
Top achievements
Rank 1
answered on 25 Aug 2010, 09:15 AM

Can you explain your answer?
Currently my code looks like:

<

 

telerik:radscriptblock runat="server" ID="rsbEditProject">

 

<

 

script type="text/javascript">

 

 

function OnClientTransferred()

 

{

$find(

"<%=FormDecorator1.ClientID %>").decorate();

 

}

</

 

script>

 

</

 

telerik:radscriptblock>

 

<

 

telerik:radformdecorator id="FormDecorator1" runat="server" decoratedcontrols="CheckBoxes, RadioButtons, Buttons" />

 


<
telerik:RadListBox
    runat="server" ID="dlManageTimeTrack" TransferToID="dlManageTimeTrackDestination"
    AllowTransfer="true"  AllowDelete="false" AllowReorder="false" AllowTransferDuplicates="false"
    ButtonSettings-ShowTransferAll = "true"
    TransferMode="Copy" SelectionMode="Multiple" 
    DataSourceID = "odsNonAdminUsers" DataTextField="FullName" DataValueField="Id"
    Width = "300px" Height = "110px" OnClientTransferred="OnClientTransferred">
</telerik:RadListBox>
  
<telerik:RadListBox
    runat="server" ID="dlManageTimeTrackDestination"  
    DataSourceID = "odsManagerTimeTracks" DataTextField="FullName" DataValueField="Id"
    Width = "300px" Height = "110px" CheckBoxes="true"  OnItemDataBound="dlManageTimeTrackDestination_OnItemDataBound">
</telerik:RadListBox

What should be changed here?
0
Lini
Telerik team
answered on 27 Aug 2010, 03:17 PM
Hi,

You should remove the class from the checkboxes in the listbox control. This can be done in the client function you currently use to decorate them:

function OnClientTransferred(sender, args)
{
  $telerik.$('.rlbCheck', args.get_destinationListBox().get_element()).removeClass('rlbCheck');
  $find("<%=FormDecorator1.ClientID %>").decorate();
}

The call uses the args parameter of the function to get the destination listbox and remove the class attribute from its checkboxes.

Best wishes,
Lini
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
spt
Top achievements
Rank 1
answered on 31 Aug 2010, 02:19 PM
Well, it works when item was moved from left list to right.
What about  applying of FormDecorator to checkboxes in the left box in initial state?
I tried somethimng like.

 
<telerik:RadListBox
    runat="server" ID="dlManageTimeTrack" TransferToID="dlManageTimeTrackDestination"
    AllowTransfer="true"  AllowDelete="false" AllowReorder="false" AllowTransferDuplicates="false"
    ButtonSettings-ShowTransferAll = "true"
    TransferMode="Copy" SelectionMode="Multiple" 
    DataSourceID = "odsNonAdminUsers" DataTextField="FullName" DataValueField="Id"
    Width = "300px" Height = "110px" OnClientTransferred="OnClientTransferred" OnClientLoad="OnClientLoad"
</telerik:RadListBox
    
<telerik:RadListBox
    runat="server" ID="dlManageTimeTrackDestination"  
    DataSourceID = "odsManagerTimeTracks" DataTextField="FullName" DataValueField="Id"
    Width = "300px" Height = "110px" CheckBoxes="true"  OnItemDataBound="dlManageTimeTrackDestination_OnItemDataBound"
</telerik:RadListBox
  
    function OnClientLoad(sender) {
        $telerik.$('.rlbCheck', sender.get_element()).removeClass('rlbCheck');
        $find("<%=FormDecorator1.ClientID %>").decorate();
    }

But it doesn't work.
0
Accepted
Lini
Telerik team
answered on 01 Sep 2010, 07:56 AM
Hello,

The code you sent works fine for me. The only thing I needed to add is the CheckBoxes="true" property to the first (dlManageTimeTrack) list box to actually show the checkboxes.

Sincerely yours,
Lini
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
spt
Top achievements
Rank 1
answered on 01 Sep 2010, 12:25 PM
You are right, it works.
Tags
FormDecorator
Asked by
spt
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
spt
Top achievements
Rank 1
Lini
Telerik team
Share this question
or