Set GWT 'HTML' Object's id [duplicate] - gwt

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Setting a GWT widget’s id
I would like to add an 'id' to my GWT 'HTML' object to ensure that a particular style gets applied to it.
HTML obj;
How can I assign an id for this obj?
I couldn't figure it out based on this Javadoc
Thanks.

You could use object.getElement().setId()

You don't need to set an id. Simply add a CSS class name:
obj.setStyleName("myStyle");
or
obj.getElement().getStyle()...
and set any style you need directly.

Related

adding a polyline to a map gets me a "script error" [duplicate]

This question already has answers here:
Why are custom leaflet controls added as upper and lower case?
(2 answers)
Closed 9 months ago.
I tried to add a polyline to a map by doing L.Polyline([[30.20449, -98.48831], [30.73711, -96.99966]]).addTo(map) and L.Polyline([L.LatLng(30.20449, -98.48831), L.LatLng(30.73711, -96.99966)]).addTo(map) and both give me a "Script error" error.
Here's the code on JSFiddle:
https://jsfiddle.net/e73qmghu/
Any ideas?
Use either the Leaflet factory form L.polyline() (note the lower case "p"), or the class form with new keyword new L.Polyline (note the upper case "P").
See also Why are custom leaflet controls added as upper and lower case? for more explanations.

OOTB Granite Render Condition in AEM [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I have created a button called annotation and I have added hasannotation OOTB granite render condition. On selection of an image having annotation, the button doesn't get rendered.
Image Of the custom button with granite:rendercondition
Properties of the button
Properties of granite:rendercondition node
First you need to add granite:rel property to your button.
As said in the documentation:
This is used to indicate the semantic relationship of the component
similar to HTML rel attribute.
You can add the AEM existing granite:rel in your custom button as "aem-assets-admin-actions-annotate-activator" as shown /libs/dam/gui/content/assets/jcr:content/actions/selection/annotate
Or you can also add your custom value lets say "my-annotation-rel". In this case you need to tell AEM to consider your custom value. In order to do this, you need to overlay /libs/dam/gui/coral/components/admin/contentrenderer/base/assetBase.jsp
and add this line :
actionRels.add("my-annotation-rel");
Update: render condition is not working because the path is not correctly passed to redercondition component. {requestPathInfo.suffix} does not give the actual path of the asset rather it gives the folder path and hence it fails to check when you are in card/column/list view.
In order to implement this, follow these steps:
Overlay /libs/dam/gui/coral/components/admin/contentrenderer/base/base.jsp
Add this below code inside getActionRels(Node node, boolean hasReplicate,boolean hasRemoveNode, boolean hasModifyAccessControl, boolean isExpiredAsset, boolean isExpiredSubAsset, boolean isDAMAdmin, boolean isContentFragment) method
boolean hasAnnotation = false;
NodeIterator nodeItr= node.getNodes();
Node commentsNode;
while(nodeItr.hasNext()) {
Node childNode = nodeItr.nextNode();
NodeIterator childItr = childNode.getNodes();
while(childItr.hasNext()) {
Node secondLevelChild = childItr.nextNode();
if(secondLevelChild.getName().equals("comments")) {
NodeIterator thirdLevelNode = secondLevelChild.getNodes();
while(thirdLevelNode.hasNext()){
if(thirdLevelNode.nextNode().hasProperty("annotationData")){
hasAnnotation = true;
}
}
}
}
}
if(hasAnnotation){
actionRels.add("my-annotation-rel");
}
Add granite:rel (String) "my-annotation-rel" property to your custom button
It should work.
Another way without changing the OOTB jsp file behaviour, if you are customising metadataeditor then granite render condition should work . In this case you have to first overlay this and your custom button:
/libs/dam/gui/content/assets/metadataeditor/jcr:content/actions
and add granite:rendercondition node under your custom button and give path property as
${empty requestPathInfo.suffix ? param.item : requestPathInfo.suffix}

How to change controller name like product to products [duplicate]

This question already has answers here:
Reference: mod_rewrite, URL rewriting and "pretty links" explained
(5 answers)
Closed 6 years ago.
I have products controller like
http://domain.com/products
where products are listed and for single product details URL is like this
http://domain.com/products/view/parameter
I want to change my controller name from products to product for single product details like
http://domain.com/product/parameter
NOTE: Please don't give me direct reference of ellislab manaual because I tried those things.
Thanks in advance
$route["product/slug"] = "products/view/slug";
used this in page route.php

Properties of checkboxes [duplicate]

This question already has answers here:
Can HTML checkboxes be set to readonly?
(48 answers)
Closed 6 years ago.
I have a form that includes many checkboxes with the same name but with different values, when the form is submitted I get a single variable that has the name of the checkboxes and it contains a comma separated list values of each checkbox that was checked. All this is OK, however, I have modified the form to disable some of the checked checkboxes which means that we cannot uncheck the checkbox, again this is OK and working.
The issue that I have is that disabled checked checkboxes do not have a value when submitted.
Is there another property I can use that will include all checked checkboxes?
There is not another property that you can use. readonly can be used for fields where the value is what changes. However, for checkboxes, the value doesn't change so it cannot be used.
The best you can do is to leave the checkboxes disabled and add hidden input fields to get the values you need onto the server.

Zend framework decorators question

I need to add some random html content with text before and after my input field.
I know I can use description decorator and set escape option to false - this way I can simply inject arbitrary html chunk as a decorator.
But this only accounts for 1 html chunk - I need a second one after input field. If I simply output description decorator again after input field - that will output the same description chucnk.
1) Is there a way to use description decorator multiple times with different content?
2) In label decorator - is there a way to use span tag instead of label tag?
3) Can I inject random html into HtmlTag decorator?
thanks!
update:
i solved my problem by creating simple custom decorator that allows me inject random html anywhere. Still -if someone knows quick and easy answers - plz post.
You could check out the AnyMarkup decorator:
http://www.zfsnippets.com/snippets/view/id/62/anymarkup-decorator