Using a JSF converter in a custom tag - icefaces-1.8

I have a custom XHTML tag redefining ice:inputText.
I need to map the converter attribute into it.
Adding converter="#{converter}" to the tag, inside the inputText, seems not to have the right effect.
When I use the tag specifying converter="XMLGregorianCalendarConverter" I get the following error:
Problem in renderResponse: Cannot convert XMLGregorianCalendarConverter of type class java.lang.String to interface javax.faces.convert.Converter
The above converter is correectly defined in my global faces-config.xml.
What could be causing this problem?
Thank you.

It's a bug in facelets.
See issue: http://java.net/jira/browse/FACELETS-273
I hit the same bug today...
using the exact name in my tag resolves it. (passing parameter doesn't work)

Related

Fixing a PDF Accessibility Issue (Alternative description missing for an annotation) when converting an HTML Page to PDF

Currently, I am working on a program that converts an html page into a PDF using the iText Library.
The Checker that I am using is PAC3 -->PDF Accessibility Checker 3 which is described by the following link (https://section508.gov/blog/check-pdf).
One of the issues is the “Alternate description missing for an Annotation”
An excerpt from the following link explains it:
http://www.uottawa.ca/respect/sites/www.uottawa.ca.respect/files/fss-fixing-accessibility-errors-in-pdfs.pdf
Alternative description missing for an annotation This usually happens when the link is not clear enough. To fix this error, add alternative text to the link tags. To add the alternative text, please do the following;
In the tag tree, select the tag for the link, and select Properties
from the options menu.
In the Touchup Properties dialog box, select
the Tag Tab.
Type alternate text for the link, and click close
I have been trying to use iText to fix this problem, but googling, looking at the source and reading the documentation does not help.
Does anybody have any suggestions on how to either write the HTML or use the itext problem to get rid of the “Alternate description missing for an Annotation”
Thank you for your help
You did not specify whether you using old code (XMLWorker, HTMLWorker) or new iText code (pdfHTML).
This of course impacts the proposed solution.
In my answer I am going to assume you are using pdfHTML
There are several options:
edit the incoming HTML using a library like JSoup
convert the incoming HTML to iText IElement objects, and edit those, setting properties where needed
write your own custom TagWorker that handles all instances of a specific tag, and write custom logic to deal with the missing annotations.
An example of a custom tag worker can be found here:
https://developers.itextpdf.com/content/itext-7-examples/converting-html-pdf/pdfhtml-custom-tagworker-example

phpDoc for object's properties

I've got file template.php, that is included in CBitrixComponentTemplate's method.
CBitrixComponentTemplate has property $this->__component, that is dynamicly filled with object EtmOrderAdd. EtmOrderAdd has property objValidator.
Now, when I am writing the file template.php, I need all these properties to be understood by phpDoc.
Here's the picture, illustrating my idea :
How should I write it?
Bitrix has almost no phpDoc for internal methods and functions. Also it has a plenty of legacy code, that won't show correctly with PhpStorm's code completion.
However, there are several things you can try to improve the situation:
Add bxApiDocs files as an External Library to PhpStorm.
This will add autocomplete for the internal bitrix methods
It seems like you've defined custom component class since $template->__component usually contains CBitrixComponent object that doesn't have objValidator property. So you need to add #property inside your class.php file of your component.

Why can't I add an HTML custom attribute to a visualforce page?

I have an control, to which I want to add a custom html attribute called, previousValue.
The Salesforce Developer's Guide assures me that I can do this by prefixing the attribute name with html-.
So I have an element that appears thus:. I also have the docType="html-5.0" attribute in my page control.
However, in Eclipse I get an 'unsupported attribute' error. I have upgraded to the latest force.com IDE; can any one tell me why this isn't working? What else do I need to do?
Thanks.
After much experimentation, the answer to this seems to be that the salesforce developer's guide is inaccurate and the 'hmtl-' prefix is not supported by the <apex:inputField> component. I can add it without a problem to an <apex:outputPanel> component. Don't understand why this should be so and the whole point to using these attributes is to locate data in a relevant place and avoid complex jquery selects to find the data relative to the location at which it is required.

How can I convert this into data-attributes?

I'm confused with data-attributes and my task is to convert this into a html5 valid code:
<xy:search campaign="campaign-name" width="280px" height="32px">
</xy:search>
This is an advertisement and recently we wanted to validate our page but this is the last error I couldn't fix, because of the custom dtd element.
I don't want to write custom dtd file, and yes, this code must be work exactly like before changes, they have a script for this custom element, so I just want to modify the base code and "translate" it to the validator, so the element must be visible/readable somehow for the advertisor's script.
I think it can be solved with html5 data-attributes, but I don't know that method...
Any help would be appriciated.
Assuming campaign it the only attribute you need to convert... it is as simple as prepending data- to the attribute. That's all a data attribute is. Example:
<xy:search data-campaign="campaign-name" width="280px" height="32px">
And then to access the value in something like jQuery, you would use .data():
$("your element").data("campaign"); // getter
$("your element").data("campaign","new value"); // setter

HTML without “self-closing” tags

There's some way to cut the html tags with self-closing slash like <br/> and transform it to <br> so you can view on the source view the code without the slash?
Some DOM Jquery implementation?
I'm working on .NET if this can be help as a tip.
This is the real problem: NET-enabling start-tag requires SHORTTAG YES
In your other question, DaveB's answer points to a browser capabilities file. In that file the tagWriter is set toSystem.Web.UI.HtmlTextWriter.
I haven't tested this, but you may be able to sub-class System.Web.UI.HtmlTextWriter and initialse the value of the SelfClosingTagEnd field so that its value is > instead of />.
Put the name of the new class in the tagWriter setting of your browser capabilities file and try that.