Add non-breaking space between required field label and asterisk in Yii - yii

I need to add a non-breaking space ( ) between the required field label and the *, to hopefully prevent the *'s from wrapping onto a new line (e.g. for the first field, I need the * to stay on the same line with at least one of the words in the label).
Can anyone help me find this in the Yii core? I've looked for a while.
Here's another example of where this is happening:

You need to override $afterRequiredLabel in CHtml.
The default value is currently set to ' <span class="required">*</span>'
You will want to change it to ' <span class="required">*</span>'
You could change the Yii core, but this is not advisable. Instead, you should extend CHtml and reference your child class moving forward.

Related

Can <condPageBreak height='?cm'> change dynamically?

I have a <blockTable> that change size depending an user input.
I want to continue drawing on next page if there is no sufficient space to draw the blocktable on the same page.
<condPageBreak height='1in'/>
<blocklTable ...>
...
How can I change blockTable height to jump to the next page if there is not enough space on the current page?
I'm not sure about dynamically change or break page. But I use below method. May be it will useful to you.
Try with this RML reports.
The <condPageBreak/> tag is a "CONDitional Page Break". To use it, you give it a height in any units that RML can handle.
It then compares this height with the remaining available space on a page. If the space is sufficient, then the next elements are placed on the current page, but if there is less space than the height you have given it anything following the <condPageBreak/> is continued on the next page
<condPageBreak/> has only one attribute - the mandatory one of
height
For Example:
<condPageBreak height="1in"/>
<condPageBreak height="72"/>
For more details: RML User Guide
NOTE:
Use above examples before the start of <blockTable> tag
For Example:
<condPageBreak height="1in"/>
<blockTable style="Table4">
.
.
.
</blockTable>

Enclose a list of tags (taghelper) by a parent tag

I need to achieve like below
<MyTagList>
<MyTag></MyTag>
<MyTag></MyTag>
</MyTagList>
When ever I use MyTag in design time, it need to be enclosed automaticaly by MyTagList or MyTag should error that it must be enclosed by MyTagList
You can't do this today at design time. You can however do it partially at runtime by utilizing TagHelperContext.Items. By using the Items property you can ensure that each tag is enclosed by a parent tag and throw if it's not. Insert an indicator into the Items bag in your parent element and verify that it exists in child elements.
As for supporting this in the future there are two issues open to add design time support:
https://github.com/aspnet/Razor/issues/255
https://github.com/aspnet/Razor/issues/474
Hope this helps!

How to create dropdownlist with static and dynamic values in Asp.net MVC with a divider between them

I want to create a dropdownlist which have three static values: Select All, Text Only, Numeric only. After that I like to add a line with some padding (just to separate these options) and then add some dynamic options.
I am not sure how to do this, Can some body please help?
So far I have created a List<SelectListItem> in my view model, and populated the static values from BLL. But I am not sure how to add a divider line in the middle now, and append some dynamic options after that.
Thanks
The normal select tag will not work like that, you will have to create custom dropdown using spans or divs.
See some examples here:
http://tympanus.net/codrops/2012/10/04/custom-drop-down-list-styling/

Change isRequired star position in Struts 1

I am using Struts 1 on a form and need to mark some inputs as required. The thing is that the red star ('*') showing the required fields when marking them with isRequired="true" is by default shown right after the textbox:
alt text http://img402.imageshack.us/img402/2345/input.png
Is there a way to change the star position to the left, right before "Input"?
If needed, the code of this is now:
<layout:text property="input" key="form.input" styleClass="FormInput" mode="E,E,I" isRequired="true" />
You will likely have to write your own custom tag that basically extends the layout:text tag but overrides the output (i.e. where the star is generated if the field has an error).
Start here: http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags.html You could probably skip ahead to the "Examples" page, but the other stuff is good to know too

haml editing on gEdit, any way to auto indent?

I'm using gEdit to edit haml files and the auto indenting feature seems to work when i'm writing one line after another, but when I go and clear out a exisiting element (a div or a class) the rest of the code below doesn't adjust itself. Suppose this is my code
.rightside
.container
%ul
%li hello
%li world
Now is there any way (using some plugin) through which when I delete .rightside, the rest of the code moves to left by two spaces? I now have to manually erase the space on every line. Thanks for your input.
You can select the block underneath the tag in question and use Shift-Tab or Ctrl-Shift-T to un-indent the text, assuming you have gedit set to use 2 spaces for tabs.
I have also installed the multi-edit plugin. This gives me multiple carets at which points any edits i make will be duplicated. In this case, I can just position the cursor at the top of that block, use the Ctrl-PgDown key shortcut to select the whole block, and then hit delete a couple times.