Infragistics UltraTree print/preview with nodes that have formatted/markup text - printing

I'm trying to print/preview an Infragistics UltraTree (winform) (version 14.2) which has formatted/markup text
The nodes of the tree use Infragistics.Win.FormattedLinkLabel.UltraFormattedTextEditor
with TreatValueAs = FormattedLinkLabel.TreatValueAs.FormattedText
On the screen the tree looks nice. However when I use Infragistics.Win.Printing.UltraPrintPreviewDialog, the resulting tree displays each node with all of its markups.
<span style='color:Navy; font-size:11pt; font-weight:bold; '> The Node's Text </span>
Is there a way to have the preview display the same way it looks on the screen? That is instead of the above, display "The Node's Text", where this text is printed in 11pt and the text color is navy.

The guys at Infragistics said it is a bug in their control here. However, they provided and work around. Add this event handler in form's constructor:
this.ultraTreePrintDocument1.Tree = this.ultraTree1;
this.ultraTreePrintDocument1.InitializeTree += UltraTreePrintDocument1_InitializeTree;
And then in InitializeTree add this code:
private void UltraTreePrintDocument1_InitializeTree(object sender, InitializeTreeEventArgs e)
{
e.Control.Override.EditorComponent = new UltraFormattedTextEditor();
}

As #wnvko indicated, Infragistics acknowledges the bug which will be corrected in their next service release. This is the statement I received from Infragistics:
Issue "237272: EditorComponent is not taken into account when printing
the tree" has been fixed and verified by our Engineering Team in the
following versions . We are in the final stages of creating the
service release and expect to publish it according to following
schedule:
http://www.infragistics.com/support/service-releases/

Related

Adding components to BorderLayout

I'm trying to implement BorderLayout within IntelliJ and am having trouble getting it to work. It compiles fine, but when it runs I see the viewer for a second and then it crashes. The code I currently have is
Button Next=new Button("Next");
Button Back=new Button("Back");
Container panel1=new Container();
Container panel2=new Container();
home = new Form("Home");
home.setLayout(new BorderLayout());
panel1.setLayout(new BorderLayout());
panel2.setLayout(new BorderLayout());
home.addComponent(BorderLayout.EAST,panel1);
home.addComponent(BorderLayout.WEST,panel2);
panel1.addComponent(Next);
panel2.addComponent(Back);
The error I get after it crashes is "Cannot add component to BorderLayout Container without constraint parameter". I tried researching a constraint parameter and also working with BorderLayout in IntelliJ, but any texts I found were either not helpful or too complicated to understand. Thanks so much!
The error message is telling you that if you want to add a component to a border layout you have to specify where to put it. You've done this when adding components to home, but you haven't when you add components to panel1 and panel2. You need to add BorderLayout.EAST (or WEST, or whatever) to get:
panel1.addComponent(BorderLayout.EAST, Next);
panel2.addComponent(BorderLayout.WEST, Back);
However, I think you're using this wrong. You probably don't want a border layout in panel1 or panel2 -- they're fine with the default flow layout, so if you remove the panel1/2.setLayout() lines your code should work fine.
BTW: In java we don't use capital letters at the start of variables, so Next and Back should be next and back. Also, panel1 should be something like nextPanel, and panel2 should be something like backPanel.
To add one more thing -- nobody uses awt any more. We've all moved on (mostly to html5). So, trying this in swing, you would get:
import javax.swing.*;
...
JButton next = new JButton("Next");
JButton back = new JButton("Back");
JFrame home = new JFrame("Home");
home.setLayout(new BorderLayout());
home.add(back, BorderLayout.WEST);
home.add(next, BorderLayout.EAST);

Webix: how to dynamically load components from external js file into a layout?

I would like to know how to update a row/col and or layout from an external js file on webix. Let's say I have a menu at the left of the screen (col[]) and want to update the right column based on a menu selection. If the menu is composed by
Customers
Orders
Products
And want to update the right column based on the selection calling customers.js, orders.js and products.js
Just like http://webix.com/demos/admin-app/#!/app/orders
That example is very advanced for me, I would like to learn some basic method.
Thanks
Oscar P
You can use webix.ui command or addView API to add a new UI to some specific place on the page.
webix.ajax("config.json", function(text){
$$("layout").addView( JSON.parse(text) );
})
or
webix.ajax("config.json", function(text){
webix.ui( JSON.parse(text), $$("cell_to_replace"));
})
Aquatic,
I also found out an example with .showBatch() API but the console shows "Uncaught TypeError: $$(...).addView is not a function" on both functions, are those part of PRO version? what is wrong?
My code is:
$$("workArea").addView("clientes");
or
$$("workArea").showBatch("batClientes");
on:{
onMenuItemClick:function(id) {
$$("workArea").addView(id);
}
}

Vaadin - TextArea/RichTextArea with real-time text analyzing

I am working on a Vaadin (7) server-side application, and i need to use a TextArea or a RichTextArea that will analyze word-by-word the typed input, and will highlight words of a certain type, for example - dates and times.
My problem is that a RichTextArea does not have a TextChangeListener, and a regular TextArea does not have a highlighting option because it does not support HTML tags...
I tries using ShortcutKeyListener for RichTextArea and analyze the text after every Space key, but it was too slow and had also some other problems.
Is there anything else i can do?
Is there an option to analyze the text on real time when using RichTextArea? or is there any add-on youre familiar with that can do that?
Or is there a way to highlight text in TextArea after analyzing it?
Thank you!
My suggestion is a bit strange, but anyway, take a look on Vaadin AceEditor. It supports text mode and SelectionChangeListener:
ed.addSelectionChangeListener(new SelectionChangeListener() {
#Override
public void selectionChanged(SelectionChangeEvent e) {
int cursor = e.getSelection().getCursorPosition();
Notification.show("Cursor at: " + cursor);
}
});
See details here: Vaadin AceEditor

Text URL in AIR iOS app not selectable

I'm using AIR 2.0 (soon will be updating to 3.3 with Flash CS6) to create an iPad app. We have textfields (Classic, dynamic) which sometimes contain one or multiple htmlText links which need to be clickable. In the desktop version of the program, all text is selectable and the links are easily accessed. My problem is that it takes me mashing the link like 20 times on the iPad before it will recognize that there's a link and navigate to it in Safari. The other strange thing is that none of the text appears to be selectable - I can't get the iPad cursor, copy/paste menu, etc. to show up.
I think, from reading other threads, that the hit area for the URL is only the stroke on the text itself... if that's true, what can I do to increase the hit area? Or make text selectable? It was suggested elsewhere to put movieclips behind the URLs but that's not really possible as this is all dynamic text from XML files.
I've read about StageText but I gather this is only used for input fields, which is not the case here.
I'm reasonably advanced in AS3 but I'd prefer an easy solution over re-writing large chunks of code. At the moment the only thing I can think to do is get the URL and make it so that as soon as you touch anywhere on the textfield, it navigates to the link. But this would break down if there were more than 1 URL in a given textfield.
Any ideas?
I had this exact same issue, and it's had me flummoxed for a while.
Here's what I did to get the desired behaviour:
1) Instead of using a listener for TextEvent.LINK, listen for MouseEvent.CLICK (or TouchEvent.TAP) on the TextField.
eg.
var tf:TextField = new TextField();
tf.addEventListener(MouseEvent.CLICK, linkClicked);
2) In the linkClicked() handler, you use getCharIndexAtPoint() to determine the index of the character that was clicked, and then from that determine the URL from the TextFormat of the character. This is adapted from a post by Colin Holgate on the Adobe Forums (http://forums.adobe.com/thread/231754)
public function linkClicked(e:MouseEvent):void {
var idx:int = e.target.getCharIndexAtPoint(e.localX, e.localY);
trace("Tapped:",idx);
var tf:TextFormat = e.target.getTextFormat(idx);
if(tf.url != "" && tf.url != null) {
var linkURL:String = tf.url;
trace(linkURL);
// Hyperlink processing code here
dispatchEvent(new UIEvent(UIEvent.LINK_TAPPED,tf.url));
}
}
3) The last line (dispatchEvent()) is sending a custom event to another function to process the link, but you could easily inline your code here.
I've tested on an iPad 3 running iOS6.1, building with AIR3.5. Links are much more responsive, and I don't find myself mashing the screen trying to hit the stroke of the text!

Configure xforms:select element for 'view' mode

I have next problem, when user looks to the filled form element xforms:select shown as it should be readonly and displays the label of selected item, below is html represenation of the element as it comes to browser
...
<span
id="control-8-control"
class="xforms-control xforms-select xforms-incremental xforms-select-appearance-full xforms-static xforms-readonly"
>
some value1
</span>
...
, but when user clicks on the text "some value", this texts turns to value of selected item, and looks next way
...
<span
id="control-8-control"
class="xforms-control xforms-select xforms-incremental xforms-select-appearance-full xforms-static xforms-readonly"
>
2WPbzcoW3eoH/1rDCyejaA==
</span>
...
Obviously some listener is hanging on that element, and changes it's inner-html.
Moreover this behavior can be observed only for xforms:select elements with appearance="full"
Where can I reconfigure this element behavior?
This is a bug. I didn't reproduce exactly the same problem you had, as I have been testing this on a nightly build, but most likely, the source of the problem is the same: the client sends a value change to the server when you click on the label, while it shouldn't. I fixed this, and the fix will be in the next nightly build. For reference, this is the bug and commit.

Resources