How to render aria-label in sitefinity webform widget - webforms

I have a webform widget and it need to render aria-label within a select tag. When I try the following, it show an error.
<select id="pre-new-year-sel" name="previous-news-year-select" tabindex="5" class="news-drop test" aria-label='<%$Resources: Labels, SelectAYear %>'>
<asp:PlaceHolder ID="ItemsContainer" runat="server" />
</select>
Error is :
Literal expressions like '<%$Resources: Labels, SelectAYear %>' are not allowed. Use <asp:Literal runat="server" Text="<%$Resources: Labels, SelectAYear %>" /> instead.
How to use ASP Literal to set aria attribute within html control?
Thanks
Salam

Related

Telerik RadCombobox SelectedIndexedChange Event

I have a telerik:RadCombobox in which user can type something to filter the recoreds.
If user type some word and tabout from taht control or clicked anywhere else on the form, basically onblur , its selectedindexedchanged event is fired that I don't want.
Please advise.
I have following html code on my page:
<telerik:RadComboBox ID="RCBGlobalSearch" runat="server" Height="190px" Width="330px"
EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true"
OnClientDropDownClosed="OnClientDropDownClosed" MarkFirstMatch="false" Filter="None"
HighlightTemplatedItems="true" Style="z-index: 9000" OnSelectedIndexChanged="RCBGlobalSearch_SelectedIndexChanged"
AutoPostBack="true" ToolTip="Enter or Select Issuer or User for Search">
<ExpandAnimation Type="none" />
<CollapseAnimation Type="none" />
<WebServiceSettings Path="~\GlobalSearchWebService.asmx" Method="GetGlobalSearchResult" />
</telerik:RadComboBox>
http://www.telerik.com/help/aspnet-ajax/combobox-onclienttextchange.html
- set_cancel lets you prevent the combobox from doing a postback (if AutoPostBack property is True), but doesn't let you prevent the text from changing.
<script language="javascript" type="text/javascript">
function OnClientTextChange(sender, eventArgs) {
eventArgs.set_cancel(true);
}
</script>
<telerik:RadComboBox onclienttextchange="OnClientTextChange"....

Adding value to submitbutton with image

I have this problem :
I have a submit button defined as follows :
<input type="submit" name="actionName" value="search" />
<input type="submit" name="actionName" value="New" />
both submit buttons are included in an Ajax beginForm:
#using (Ajax.BeginForm("PFSearch", "Payer", ajaxOptions))
In the controller ... based on the actionName string provided .. i do different actions based on the value of button pressed within my Ajax befin form :
if (actionName="search")
{
//do something
}
And everything works like a charm .. until i want to add i want to add an image to the class of my submit button :
<input class="search" type="submit" name="actionName" value="search" />
<input class="search" type="submit" name="actionName" value="New" />
My search tab looks like this :
As you can clearly see my main impediment is that by adding value ... the text appears over my image.
How can i make those button act differently within my ajax begin form considering that giving value to the buttons doesn't work ? Any alternatives or workarounds are appreciated. Thanks !
Can you please give us a link to your project's demo? And try to use some margin, padding and background-position:center;

HTML source indentation for ckeditor

When you add some code to a ckeditor in HTML view and then change to WYSIWYG view and come back, almost all HTML tags have been modified and have loose the indentation. Is there any way to prevent this behaviour? (parameter, plugin, hard code...)
For example:
<div class="former input">
<span class="big horizontal">
<label for="test">Hi world</label>
<input class="medium free" id="test" name="test" type="text" />
</span>
</div>
Becomes:
<div class="former input">
<span class="big horizontal"><label for="test">Hi world</label><input class="medium free" id="test" name="test" type="text" /></span></div>
Here's a link to a page in the developer's guide:
Output Formatting
It explains how to control the layout of the HTML code that is output by the editor and has an example that sets the formatting for the <p> tag.
Try using the <p> tag example as a template and set the formatting for the <span>, <label> and <input> tags using the same approach.
writer.setRules( 'span',
writer.setRules( 'label',
writer.setRules( 'input',
Be Well,
Joe

Right-to-left direction for Ext.NET TextField

I need to align the Ext:TextField control along with its FieldLabel attribute, as right-to-left direction.
By setting LabelAlign to right and body dir="rtl", I can only align all the control to the right.
And I get this format displayed:
---------Label:-|||||||TextField||||||||||
But how can I have the following format?
|||||||TextField||||||||||---------:Label
I'm not quite sure if this is possible as there is no real need for such options.
I would suggest that you leave the Label of the text field blank and that you insert an label to the end...
Example:
<ext:textfield ID="Text1" Text="I start on the left" runat="server" />
<ext:label ID="Label1" Text="I am a label starting on the left staying on the right" StyleSpec="float: left;" />
It should work like this!
FieldLabel will not work for rtl text fields. The only solution found is to enclose a Label and a Text Field inside table cells, aligned in a table row, with dir="rtl" set to the table or container, like the following.
<table dir="rtl">
<tr>
<td>
<ext:Label ID="Label1" Text="Sample Label" runat="server" />
</td>
<td>
<ext:textfield ID="Text1" Text="Sample Text" runat="server" />
</td>
</tr>
</table>

In RadGrid, how can we merge 2 datacolumns only for viewing, but still be able to edit them separately?

I have a Telerik's RadGrid which has 2 columns like this:
<Columns>
<telerik:GridBoundColumn HeaderText="AirlineCode" UniqueName="AirlineCode" DataField="airlineCode" />
<telerik:GridBoundColumn HeaderText="FlightNumber " EditFormColumnIndex="1" DataField="flightNumber" />
...
...
... more code, but unrelevant to the question here.
</Columns>
I am supplying the data for both columns in the relevant NeedDataSource() function.
So it renders correctly like this:
| AirlineCode | FlightNumber |
------------------------------------------
| Delta | 2393 |
| Southwest | 345 |
But now my requirement has changed a little bit.
For viewing, I want to merge them together and show it like this:
| Flight |
--------------------------
| Delta-2393 |
| Southwest-345 |
However, while editing the rows the user should be able to edit "AirlineCode" and "Flight Number" separately. And the values should still be correctly maintained in the datasource.
I know that if we want the user to "View" and "Edit" differently, we would have to use .
So I am trying something like this:
<Columns>
<telerik:GridTemplateColumn EditFormColumnIndex="0" HeaderText="Flight">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "airlineCode")%>
<asp:Literal runat="server" Text="-"></asp:Literal>
<%#DataBinder.Eval(Container.DataItem, "flightNumber")%>
</ItemTemplate>
<EditItemTemplate>
<telerik:GridBoundColumn HeaderText="AirlineCode" UniqueName="AirlineCode" DataField="airlineCode" />
<telerik:GridBoundColumn HeaderText="FlightNumber " EditFormColumnIndex="1" DataField="flightNumber" />
</EditItemTemplate>
</telerik:GridTemplateColumn> ...
...
... more code, but unrelevant to the question here.
</Columns>
But its not working.
Those 2 lines inside are giving warnings:
Element 'GridBoundColumn' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.
Probably I am doing it wrong. Need help.
Any help is appreciated.
drpcken is correct. When you use the GridTemplateColumn, you do not need to use the GridBoundColumn. Instead, you supply the View and Edit template HTML and use the Bind expression to do two-way binding in the Edit template. For example:
<telerik:GridTemplateColumn UniqueName="TemplateColumn">
<ItemTemplate>
<%# Eval("airlinCode") %> - <%# Eval("flightNumber") %>
</ItemTemplate>
<EditItemTemplate>
<table>
<tr>
<td style="width: 50%">
<asp:TextBox runat="server" Text='<%# Bind("airlineCode") %>' />
</td>
<td style="width: 50%">
<asp:TextBox runat="server" Text='<%# Bind("flightNumber") %>' />
</td>
</tr>
</table>
</EditItemTemplate>
</telerik:GridTemplateColumn>
As you can see, you use Eval in the ItemTemplate and Bind in the EditItemTemplate. All other code should continue to work without change.
Let me also highlight the Telerik Forums. For Telerik specific questions, there is an active community available to help troubleshoot: www.telerik.com/forums
It has been a while since I used the radgrid, but in your edit template I believe you need to remove the GridBoundColumns and put two textbox controls separated by the dash. Then use your Databinder to fill those txt boxes. Sorry I can't be more concise as I'm typing on my iPhone and can't test. I will followup with you when I am in front of my machine.
Good luck!

Resources