GXT Grid translate - gwt

i've tried to translate one of GXT widgets - Grid (exacly context menu in column header with sorting etc.) into Polish language but i cant find place to inject my translation.
In some other widget (PagingToolBar) is method setMessages(...) but i cant find it in Grid
So im asking you about place where i can set text that will be displayed in that menu.
Does anyone done this before ?
PS. Sorry for my english.

Take a look at this:
http://code.google.com/intl/de-DE/webtoolkit/doc/latest/DevGuideI18nLocale.html
and put <extend-property name="locale" values="pl_PL"/> in your module.gwt.xml and <meta name='gwt:property' content='locale=pl_PL'> in your index.html.
This (imho) should be the right way.
P.S. I'm not sure, if the pl_PL is right:)

...and Javadoc about gxt XMessages (message for sort asc) and google for "Missing in the Tutorial GXT and I18N inurl:sencha" (sorry i'm not allowed to post more than one link here)

Related

Wicket select2Choice component truncates selection

I need to slightly modify the behavior of a wicket select2Choice dropdown component.
When you've selected a choice if the choice is longer than the window, you see your choice truncated with elipses.
I'm wondering if its possible to do one of the following:
1) Make the choice scrollable
2) Add a title (e.g. tooltip) to the field with the value of the full choice.
Please note that I've attempted to do this through the developer tools in IE and have been mostly unsuccesful as far as scrolling goes. When a manually add a title attribute on the div with the class "select2-drop-mask" in the markup, I'm able to get a title. When I attempt to add that same title in wicket it does not show up. I believe this is because the select2choice is made up of more than one piece of mark up and through wicket there is no way to isolate that one piece of markup.
Any advice would be greatly apprecated.
Here is my Java wicket code for this component.
final FormComponent dictionaryEntryField = form.newSelect2Choice(form, "dictionaryEntry", SimpleAjaxEventHandler.get(),
new PropertyModel<String>(dictModelBean, "dictionaryEntry"),
new DictTextChoiceProvider(dictModelBeans), 300,
new ResourceModel("dictionary.mapping.dictentry.label"), LabeledFormField.LABEL.LEFT);
dictionaryEntryField.setRequired(true);
dictionaryEntryField.add(new AttributeModifier("title", new Model("Test Title")));
I'm never able to see the mouseover.
The following is a section of the markup that is created by wicket.
title="Test Title" was added manually through IE developer tools and
I'm able to see the title on mouseover.

Struts2 - How can i put a link/button in a label/span by using Struts2 tags?

I think the title explain my quesion. I need to add a link (or a button) in a label/span (never understand the real difference) by using Struts2 tags.
<s:label cssClass="menu_span">
<s:submit value="Login" />
</s:label>
This doesnt work. Also, i didnt see the s:span (like s:html, s:body, s:head, s:title, s:img, and so on...)
I tried to watch the tag references, but seems that isnt possible do it!
Thanks
First, you don't need to use Struts2 tags where standard HTML tags work fine (which is why there isn't an s:html tag, etc.) Tag libraries in JSP are there to simplify and standardize your HTML output to make it easier on you. When the tag syntax is practically the same as the output generated, they cease to be useful.
Second, what are you trying to achieve by wrapping a submit button in a label? Labels are used to associate text with a form element such as a radio button, checkbox, text field, etc. Buttons are already clickable, so I don't follow what you are trying to do.

How can I render different paragraph styles in Core Text?

I'm having a difficult time trying to work out how to build a page using Core Text, where I have multiple paragraphs which follow one another, but in different styles.
In other words, I would like to have a title paragraph, followed by a subtitle paragraph, followed by several body paragraphs. In HTML terms, this would be:
<h1>Some title</h1>
<h2>Some subtitle</h2>
<p>Blah blah...
...</p>
I have got as far as creating a CTFramesetter for the title, creating a CTFrame from that, and then drawing it to the context. However I don't understand how to create a new frame which flows on from the previous paragraph. Can anyone help please? Or is there some good online tutorial to help?
Thanks!
:-Joe
The easiest way to do this is to just style your NSAttributedString with the different styles before you create any framesetters.
You might want to look at this Open Source project: https://github.com/Cocoanetics/NSAttributedString-Additions-for-HTML/

How can I use <ui:style> with a FlexTable?

I'm learning to use GWT 2.0 and I'm trying to convert the StockWatcher demo to use the UiBinder. the demo uses stocksFlexTable.getRowFormatter().addStyleName(0, "watchListHeader"); to add styles, but when I add <ui:style> to my XML and move my CSS I can't seem to figure out how to make the style work because there is no stocksFlexTable.getRowFormatter().addStyle(). Does <ui:style> just not work with FlexTables?
I tried to deal with it as well with no success. I believe though that dynamic widgets such as FlexTable are not fully supported for obvious reasons - i.e. you can't preset the style for the nth row when you don't really know how many rows the table will hold. Also, providing some arbitrary way to do it for the first only, or odd rows etc. would require more expressive power than what the GWT developers seem keen to offer (they try to stick close to XHTML) and i believe they state at the wiki at somepoint that declarative syntax is by no means a templating language. Anyway, you can always experiment with #UiFactory and #UiField(provided=true) to try and stick close to GWT recommendations. But still, you ll have to set any such values programmatically.
I had success by removing the section completely and moving all of the css for the FlexTable into the application css file.

Scrollable div on iPhone without using 2 fingers?

I've got a UIWebView embedded in my iPhone app, and I'd like to keep a locked header and footer DIV on the page at all times, with a scrollable center DIV.
I know that I could do this using a header/footer that are UIView controls, but I want the header and footer to be HTML divs, as a pure HTML/JS/CSS solution will be easier to port to Android/PalmPre/AdobeAir, which is going to be on my todo list relatively soon.
I can do this using techniques like the one mentioned here:
http://defunc.com/blog/?p=94
But this requires that the user use 2 fingers to scroll the div, which is not satisfactory to me...
Any suggestions on how to do this?
Thanks,
Brad
I found someone that implemented a reusable solution for this, with a header and a footer:
http://cubiq.org/iscroll-4
I'm not too familiar with the UIWebView, so this may be a totally silly suggestion. But is there anything stopping you from having three UIWebViews on the page? One for the header, one for the body, and one for the footer. Because breaking it up sounds like the right idea.
Is this what you're looking for? Open this link on your iPhone device or simulator.
The index.html file has three div elements for "header", "container" and "footer" directly under the body, while all the work is done in the fixed.js file. The document is fixed in place by canceling the normal action for the "touchmove" event:
// Disable flick events
disableScrollOnBody : function() {
document.body.addEventListener("touchmove", function(e) {
e.preventDefault();
}, false);
},
Then, a lot of work goes into creating event listeners for the "touchstart", "touchmove" and "touchend" events which are attached to the "content" div under "container". The logic boils down to simply moving the "content" div up and down.
This solution is 100% HTML/CSS/JavaScript, however there is some WebKit proprietary CSS and JavaScript which may limit portability. It may take a bit of tweaking to work on another mobile device but this would be a good proof-of-concept to start from.
I did not create this awesome sample project, I'm merely bringing it to the community's attention. For more information and a link to the zipped project, read Richard "Doctyper" Herrara's entire post on Fixed positioning in Mobile Safari.
May be clunky, but you could reposition the header and footer over top of the div as the user scrolls. This way your main div doesn't need to be scrollable. No help for anything (still) using frames though.
This is one of the more irritating browser issues with the iPhone/touch, I wish you could just focus on part of the page like a normal browser.
For a CSS only reference the Safari CSS Reference probably has what you are looking for. You'll be especially interested in anything starting with "-webkit" or "-khtml" as those are extended properties only available with WebKit like 3D and touches. Should apply to Android as well.
With JavaScript the Introduction to WebKit DOM Programming Topics and WebKit DOM API Reference are go-to guides. Definately take a look at the light-table demo for some copy and paste javascript on handling your touches as that's how I would solve this.
I have implemented iScroll on iphone and it is really smooth and fast and you can do whatever you want. Disadvantages are that android (1.6) refuses to scroll how I wanted and sometimes block other javascript if there are any.
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<div style="overflow: scroll">
Add those to your html code may solve your problem.