I am facing problems that is I cannot get arb key from child widget when using translation in flutter.
All I can get is text contains itself.
I want to get arb key string.
Is there any solution??
Key are so you can get access to the value, if you need to get access to the key make it a value.
Related
I need to implement a dictionary in AEM — I have created an i18n->en->sling message entry with a key-value pair ("gegessen" is the key and message is "Record"), and I am able to render the message value in Sightly using the expression:
${'gegessen' # i18n}
If I change the message, it should be reflected in all the locations where I am using key. How can I make this key available in the Rich Text Editor and in widget labels?
I'm trying to print a GWT widget as follows,
String html = DOM.getElementById("id").getInnerHTML();
Print.it(html);
I'm not getting the entire html content of the widget. So i'm not able to print the expected result.
Can you help me? Or tell me the alternative way of printing a particular GWT widget from the view.
Thanks in advance,
Gnik
Well, it should print the HTML code. Calling DOM statically may generate 2 problems for you:
The ID you are trying to use isn't the right one. There is another element with the same ID and you are retrieving the element for that ID.
The ID you are using doesn't exist, as a framework may be changing this ID.
You can try to retrieve the HTML code with this widget.asWidget().getElement().getInnerHTML();
That should give you the correct HTML representation of the widget.
And make sure you are calling those methods after the elements are loaded (onLoad()) into the document, or you may recieve a JavaScriptException due to the element being null (check here for more info).
I'm having a hard time testing our Wicket application using Selenium because of the random markup ids.
For individual elements, I can use abc.setOutputMarkupId(true).setMarkupId("myId")
to set their markup id explicitly.
But what if the element is added dynamically using a repeater (like ListView)? Is there a way to specify how the markup id sequence should look like?
Well, can't you do the same thing with ListView? If you make your own ListView implementation, and then in the populateItem(final ListItem<?> listItem) method, on that respective listItem you do:
listItem.setOutputMarkupId(true); // write id attribute of element to html
listItem.setMarkupId("id"+i);
where i is some index you initialize in the ListView's constructor or something?
as Andrei told that its possible but dangerous.
setMarkupId doc:
Retrieves id by which this component is represented within the markup. This is either the id attribute set explicitly via a call to
org.apache.wicket.Component.setMarkupId(java.lang.String), id
attribute defined in the markup, or an automatically generated id - in
that order. If no explicit id is set this function will generate an id
value that will be unique in the page. This is the preferred way as
there is no chance of id collision.
http://www.kiwidoc.com/java/l/p/org.apache.wicket/wicket/1.4.0/p/org.apache.wicket/c/Component#top
and also you cant get the markup id with getMarkupId()
I would like to be able to add a key/value pair label in an install screen. The key is a static text. The value is a dynamic value and a value from a variable should be used to display the value label. I'm not able to do so using install4J. I see options like a textArea, textfield that will enable to be able to do so. However, these are editable fields and does not serve my purpose. I want a non editable field to display a value from a variable. This is not a system variable. This should be a user defined variable. I'm using install4j 4.2 version. Any help in this area is highly appreciated.
Thanks for the response. I was able to create key/value pair. However, I'm not able to define my own installer variable. Can you please let me know where I can define an installer variable that can be used in the key/value pair?
There is a "Key value pair" form component that does exactly what you need. It is available in install4j 4.2.
In the "Value label/Text" property, you can use an installer variable like
${installer:myValue}
for displaying dynamic text.
I want get html id of input field & icon field of a TextItem widget, how can i do this ???
(no getId methos is available for TextItem widget & seems that setAttribiute("id", "foo") has no effect)
since everything is on a single page, i wouldn't dare to set any IDs yourself, the probability that you create two items (by mistake) with the same id is quite high.
why would you need it anyway?
you may get the html element by name
textItem.setName("foo");
DOM.getElementsByName("foo")