I am trying to make a WP7 app and I'm facing an issue on how to add a white space after a part of text. I know that this thing can be done in HTML by inserting a   char but in my RichTextBox this can't be done.
This is my code:
<RichTextBox>
<Paragraph>
<Run>This is a </Run>
<Bold Foreground="Red">test</Bold>
</Paragraph>
</RichTextBox>
I want the output to look like "This is a test" but the last whitespace is ignored so the output is "This is atest" .
Can you please help me with this.
Thanks
I have found what was the issue , in designer the output was the wrong one ("This is atest") but at run-time it's displayed ok.
Related
I feel really stupid: I just read this question How to get html elements with multiple css classes and the answer was very clear and straightforward but when I try to apply it on this HTML
<div class="header group">
I am completely unable to make it work.
Here are some of the variations I have tried
//*[contains (#class, ’header’) and contains (#class, ‘group’)]
//div[contains (#class, ’header’) and contains (#class, ‘group’)]
//div[contains (#class, ’header’)]
What am I missing here? Should be straightforward, shouldn't it?
Testing in Chrome Canary.
Updates
The invalid typographical apostrophes above happened when I copy-pasted into this form. I was using ' in the actual console.
I was playing around on an archived version of the page at the Wayback Machine (WM) and nothing worked. However, when trying on the live version, everything worked as expected (the problem with the live version was that the final element I was "aiming" at currently is missing but will return later on, therefore I used WM). Any ideas why // seems broken on WM? Even if WM adds a few levels of divs, // should be transparent about that, shouldn't it?
Just use this xpath.
//div[#class='header group']
you should use something like this
<xpath expr="//div[hasclass('header') and hasclass('group')]" position="replace">
<t>
xxxxxx
</t>
</xpath>
I'm trying to allow custom "template code" within the source code editor. My code snippets would always look like {* anything here *}. It mostly works, but if used inside an HTML tag things gets scrambled.
I'm already using allowedContent: true, when starting CKEDITOR.
Example:
<p style="{* some "short code" of mine... *}">Text</p>
turns into
<p style="{* some " short="" code"="" of="" mine...="" *}"="">Text</p>
And
<p {* tet_pos_is_inside *}>Fuss</p>
into
<p {*="" tet_pos_is_inside="" *}="">Fuss</p>
Any advise ?
Thanks,
Sebastian
My advise would be to never use them inside tags, it sounds like a nightmare to configure. What is the requirement you are trying to fill with those?
You could go around this issue with pre- and post processing using classes, data attributes and/or custom attributes. For example you could use something like his:
<p class="tet_pos_is_inside_val-12345 foo-val-12345">I love horses</p>
<p data-tet_pos_is_inside="12345" data-foo="">I love bunnies</p>
<p tet_pos_is_inside="12345" foo="">I love cats</p>
Well,
apparently there was a simple solution to solve my current problem:
<p style="{* some 'short code' of mine... *}">Text</p>
works ! Note the use of singe-quotes inside the double quotes.
IOW, as long as there is a <tag attr="val"> then val can be anything except containing more double quotes.
Thanks for the comments.
Using 4.5.0 for numerous reports, each using the same datafield SVC_METH_NM. Have no problem word wrapping (using Stretch With Overflow) the datafield SVC_METH_NM unless the field is a group. When the field is a Group, the data is truncated instead of wrapped. If I set the Evaluation Time to Now, which blanks out the Evaluation group, it wraps correctly (but the report doesn't display properly). I tried removing the fields in the line immediately below, and have tried playing with the Position Type and Stretch Type options, to no avail.
<group name="ServiceMethodName">
<groupExpression><![CDATA[$F{SVC_METH_NM}]]></groupExpression>
<groupHeader>
<band height="20">
<textField isStretchWithOverflow="true" evaluationTime="Group" evaluationGroup="ServiceMethodName">
<reportElement x="23" y="0" width="180" height="20" printWhenGroupChanges="ServiceMethodName"/>
<textElement>
<font isBold="true" isItalic="false"/></textElement>
<textFieldExpression><![CDATA[$F{SVC_METH_NM}]]></textFieldExpression>
</textField>
Has anyone else run into this?
I am dealing with this issue right now. Did you find a solution? I was hoping to avoid it, but think I'll have to try and solve the problem using subreport(s). Fairly certain I can display the text appropriately that way, but feel like I shouldn't have to overcomplicate things with subreports.
Edit: TESTED SOLUTION - Put a subreport in your group header. Query for the subreport should be "select * from dual" since you will actually be passing all data in from the master report. Pass the field(s) to the subreport as parameters, and display them exactly as you would in the group header, but do it in the detail band. iReport will handle the wrapping of the text since it's in the detail band. Make sure Print When Detail Overflows is set on the subreport, and Stretch With Overflow is set on your subreport field.
This could be a silly or stupid question, but how do I enter a carriage return (crlf) in the text of a Wix Text Control?
I tried:
<Control Type="Text">
<Text>Text goes here</Text>
<Text>Another text goes here</Text>
</Control>
But of course wix says that I cannot have more than one Text element inside a control tag.
Any ideas? I'm pretty sure is something easy to do but my google foo is failing right now.
Unfortunately Windows Installer does not support line breaks in static text controls. During installation the text is automatically formatted based on control and font sizes.
However, if you really want a line break, simply use another static text control for the next line.
The answer was easier than expected and was in front of me all this time... Using CDATA is the way to do it...
So, doing a return car in a text control is just matter of enclosing the text in CDATA, for example:
<Control Type="Text">
<Text><![CDATA[
This is my text.
With a return line
]]>
</Text>
</Control>
Looks like there could be more ways to do it, but I found that one the simpler.
If you have an element following another element that has float:left and turn on contenteditable in IE8, the following element will be precedet by an empty line in IE8 if you turn contentEditable="true".
An example:
<img src="foo.jpg" style="float:left">
<p>Some random text</p>
in IE8 this will be rendered like this:
See the line before "Some random text"?
This is especially annoying if you use a wysiwyg-editor because this affects some of its functionality. Also, this creates markup you don#t want. In CKEditor, you can see that the dom-path of that line is in the body, not inside any element.
I reported that problem to Microsoft some time ago and they didn't want to fix it: https://connect.microsoft.com/IE/feedback/details/576042/floated-elements-in-contenteditable-can-generate-an-empty-line
The last time that I checked with IE10 pp2 still had the problem.
Manually setting the css of paragraph elements with:
p {margin-top:0;margin-bottom:0}
should resolve this issue.