Within MOSS2007, I'm building a custom form (newform2.aspx) for a list, and having a real problem trying to adjust the width of my form fields.
Here is some of the code I'm trying to adjust:
<tr>
<td colspan="3" style="padding-top:5px; padding-bottom:5px; width:100%; ">DescriptionText<br/>
<SharePoint:FormField runat="server" id="ff16{$Pos}" ControlMode="New" FieldName="Jobsite" __designer:bind="{ddwrt:DataBind('i',concat('ff16',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(#ID)),'#Jobsite')}"/>
</td>
</tr>
I've tried setting DisplaySize within the Form:Field control, and it changes within SharePoint Designer, but when I view the actual page, the box always remains at it's default length.
Nothing like solving your own question. ;)
I found that wrapping the FormField control in <div>'s in combination with the DisplaySize attribute gave me the control I needed to format the fields properly.
I tried to insert text input into table and had same trouble.
Add
.ms-long{width:95%;}
as style into PlaceHolderAdditionalPageHead placeholder:
https://gist.githubusercontent.com/Gennady-G/91f045816068d9a38f1133135dc94bae/raw/271eb9012497b57f667b26858e0e7796625803e9/gistfile1.txt
Add this in your custom page. It works for me under SharePoint 2010.
<style type="text/css">.ms-long{width:100%;}</style>"
Related
I am exporting a VF page as Excel document. While I export excel file, Image cell contains blank data. Below is my VF page code. It is working fine if I am using static url (<img alt="Image" src="https://myorgurl/resource/DefaultProfileImage" />) instead of dynamic Image url.
<apex:page controller="Users_Profile" contentType="application/vnd.ms-excel#Users.xls">
<table border="0" cellspacing="0" cellpadding="0" style="width:100%;">
<thead>
<tr>
<th>Profile Image</th>
<th>Name</th>
<th>City</th>
<th>State</th>
</tr>
</thead>
<tbody>
<apex:repeat value="{!lstUsers}" var="user">
<tr>
<td>
<image alt="Image" src="{!BaseUrl}{!URLFOR($Resource.DefaultProfileImage)}" />
</td>
<td>{!user.Name}</td>
<td>{!user.City__c}</td>
<td>{!user.State__c}</td>
</tr>
</apex:repeat>
</tbody>
</table>
I have tried XML structure instead of HTML tags in VF page to get this resolved but it is not working.
Static resources display OK only if the "browser" has successfully logged in to Salesforce. I mean think about it, there's nothing globally unique in a link like https://eu1.salesforce.com/resources/DefaultProfileImage. Excel fails to download the image. Go to your image's url in private browsing (incognito mode), it will not display OK until you log in. This is similar to email templates that use resources or VF pages generating PDFs with images.
You need to upload the image to Documents (switch to SF Classic UI), tick "externally available image" checkbox and the link that's generated will look like https://instance.content.force.com/servlet/servlet.ImageServer?id=015...&oid=00D.... This is globally unique enough, it contains your org id and document record's id.
You can also upload the image somewhere else (Heroku?), create Site in Salesforce or Community and reference it as a public url like that... Basically anything to make the image available without logging in.
I Agree with Eyescream's answer. In addition to it, you can create 'Externally Available Image' document and upload your image in it. Now you can access your image without login into salesforce.
Use following steps to create a document.
Go to Documents tab in salesforce
Click on 'New Document'
Fill Document Name and other details
Select checkbox 'Externally Available Image'
Upload Image and Click on Save button
You will get Image preview and you can use that image url outside salesforce.
Take an xpage containing a RichText control (this is Domino 8.5.3, so we're using ck-editor).
Quite often tables are used by the users to structure their RT content. One request is to make sure that those tables have a unique formatting esp. regarding cellspacing and cellpadding.
Through Firebug I see that those inserted tables are setting their borders and cell* parameters using html attributes. And of course, since the html inside the editor has been created using "manual" html the xsp engine can't have much influence here.
Before we start writing some client side js to try and remove or manipulate those attributes: maybe there is someone having a neat idea of how we could accomplish this?
Since the output from the RichText control is, AFAIK, always rendered within a <div> with a class called "domino-richtext" one could use CSS to get that identical appearance you're looking for (at least I think with "unique" you mean identical or uniform).
I pasted an HTML structure below, where the user added some cellspacing and cellpadding:
<div class="domino-richtext xspInputFieldRichText" id="view:_id1:inputRichText1">
<table cellspacing="1" cellpadding="2" border="1" dir="ltr">
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
...
</tbody>
</table>
<p dir="ltr">Some more content besides the table...</p>
</div>
When the following styles are applied / defined within a theme or stylesheet, all tables, created within the RT control will look the same.
.domino-richtext table {
border-collapse:collapse; /*remove spacing or padding when defined*/
}
.domino-richtext table tbody tr td,
.domino-richtext table thead tr th {
padding: 0; /*define / remove padding*/
border:1px solid #eee; /*border definition for all tables*/
}
I have a collect task in Sharepoint 2010 with a Enhanced Rich Text box. In the list it shows the p and div tags.
<div class="ExternalClass1458740DC98941C3A3589359A3017AAA"><p>Approved - Rev D</p></div>
This is the field where the text is coming from.
<td width="75%" class="ms-formbody" >
<SharePoint:FormField runat="server" id="ff3{$Pos}" ControlMode="Edit" FieldName="DocCtlAdmin_x0020_Comment1234567" __designer:bind="{ddwrt:DataBind('u',concat('ff3',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(#ID)) , '#DocCtlAdmin_x0020_Comment1234567')}"/>
<SharePoint:FieldDescription runat="server" id="ff3description{$Pos}" FieldName="DocCtlAdmin_x0020_Comment1234567" ControlMode="Edit"/>
</td>
Any insight as to why or how to remove would be appreciated
Simple answer is: In your display view add disable-output-escaping="yes" to your XSL statement like so:
xsl:value-of select="#CMImplPlan" disable-output-escaping="yes"
This will remove character output escaping for HTML characters.
Issue is you are using RichHTMLField to get the input from your end users for this field. So sharepoint adds some HTML tag.
but
when you are displaying you are using FormField, which is text based, so it shows all the HTML tags also.
So solution is :
1. Use RichHTMLField for both input and display
2. Use FormField/ Simple textbox for both input and display
3. Write a custom control / control extender to clean all the HTML before outputting it
4. Also a less recommended solution will be to search this tags on page via jQuery and remove them.
I have an read-only text-field in my site. And I need to enter a date using cucumber and watir. But I can't set any value. Even passing the value of date with value = method I can't input any output. There is a JavaScript calendar.
I wrote:
browser.text_field(:name => "deal[start_date]").value = 'test'
it shows the following error:
Watir::Exception::ObjectReadOnlyException: Watir::Exception::ObjectReadOnlyException
from /var/lib/gems/1.8/gems/watir-webdriver-0.1.7/lib/watir-webdriver/elements/element.rb:252:in `assert_writable'
from /var/lib/gems/1.8/gems/watir-webdriver-0.1.7/lib/watir-webdriver/elements/text_field.rb:24:in `value='
from (irb):10
Please help me, I am in a trouble.
This goes along with what xboxer21 noted. I found this code worked for me on a site that had a similar calendar widget.
Lets say you have an HTML form with input text fields that are set to readonly:
<form name="FindRange" method="post" action="FindRange.asp" onsubmit="return false">
...
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" class="FieldLabel">
<input type="text" name="FromDate" size="16" readonly="true" style="width:85px; background-color:#F8F6E7;">
</td>
<td>
<input type="text" name="ToDate" size="16" readonly="true" style="width:85px; background-color:#F8F6E7;">
</td>
</tr>
...
</form>
Using code like '#ie.text(:name, "FromDate").set("3/23/2011")' in your Ruby Watir script would result in an error in Ruby stating the field was read-only. But using the eval() method may allow you to use Javascript to set the read-only fields behind the scenes.
#Code above these lines instantiate the Watir object in #ie and navigate to the page #containing the HTML form
#named 'FindRange'
#ie.document.parentWindow.eval("document.FindRange.FromDate.value = '3/23/2011'")
#ie.document.parentWindow.eval("document.FindRange.ToDate.value = '3/24/2011'")
Well, the text field is read only, as the error message says. That means it can not be changed. How would you change the value of the text field without Watir? Can you provide link to the page or relevant HTML?
This is what I did to enter a date in a read only text field, The JS calendar script used was http://www.dynarch.com/projects/calendar/
There is a small icon next to the date field which displays the calendar widget upon clicking it.
browser.image(:id,"datewidget-trigger").click # Will display the Calendar
browser.send_keys("{ENTER}") # Will select current date
If you want to select a future date or previous date
browser.send_keys("{LEFT}")
browser.send_keys("{RIGHT}")
This has been tested using IE only.
Try executing the JavaScript itself.
browser.document.parentWindow.execScript("Date_JS_script('date')")
I have created custom list and modified display form of list for display attached image of list.
I have place HTML image control on display form but I can’t get attachment URL path which I can assign to Image control. I tried to some level hardcode like:
“http://Server Name/SiteName/Lists/ListName/Attachments/{#ID}/???”
I can get ID value so it can be work but the last thing file name, I am not able to get the attached file name.
Do I need to write code to get path? If yes then which event I have to inherited
This solution requires undocumented magic.
...puts robe and wizard hat
Inside your table with the #Title and such:
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>Attachments</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<SharePoint:FormField runat="server" id="attachmentsField" ControlMode="Display" FieldName="Attachments" />
</td>
</tr>
You can change the attribute ControlMode to "Edit", it shows the Delete option.