How do I set up label/value when using JuiceUI's AutoComplete control from codebehind? - juice-ui

The JuiceUI AutoComplete control accepts a string[] for the Source property, yet in documentation it says you can use label/value pairs. I'm not very familiar with the jQuery autocomplete stuff to begin with, and after searching for a while I can't seem to find the correct syntax to make this work. Can anyone help me out? I'm looking for something like this:
UserAutoComplete.Source = users.Select(u => new { label = u.Id, value = u.Name});

Nice catch. Please file this as an issue here: https://github.com/appendto/juiceui/issues and we'll get a fix in there for the next release.
In the mean time, I'd use a separate map to map labels to actual values. It's a bit hackey, but it'll get you by until we update, and it'll be an easy transition with the updated code.

Related

How to get entry text in glade3 in Ruby?

Its first my first time in stackoverflow to get help.
Im making a Ruby GUI with glade3, but i dont really now how to get texts from an entry box?
It should read the text from entry box and write it in an excel sheet.
I hope you can help me :)
See example here: https://xrob.wordpress.com/2007/04/20/creating-a-gui-application-using-glade-and-ruby/
We want to change something in the application so we will need to assign a variable to the widget that we want to alter. We want to alter “label1” and so we insert this code in the button1_clicked function.
#myEntryBox = #glade.get_widget(“myEntryBox”)
# You can now access properties like '#myEntryBox.text'
# Refer to documentation for exact name of the attribute

Debugger: Search for a variable which is used

I have the following problem:
I want to avoid that one field of the copied row gets copied into the new row. (ME51n)
I thought that I could search somewhere in the debugger for this field name.
Example:
first row has the MATNR: 100-1-15
now i want to search in the debugger for the field MATNR. Is this possible?
(I know this example does not make sense, but my field is not used that often because it's an self-created field)
Or is there an user-exit especially for that?
Use watchpoints for that particular aim that you stated. In official documentation you can learn how to do it. The problem of finding suitable user-exit is not related to original question.

Error calling similar() in Sikuli

l = find("Start_menu.png").similar(0.5).anyColor()
click(l)
The above is an excerpt from my code. "Start_menu.png" refers to an image of the Windows Start Menu. I got the following error when I executed this:
File "C:\Users\VPRAVE~1.TSI\AppData\Local\Temp\sikuli-tmp8636618870597770744.py", line 1, in
l = find("1368426219510.png").similar(0.5).anyColor().anySize()
AttributeError: 'org.sikuli.script.Match' object has no attribute 'similar'
Could some one help me out with this? And could some one tell me how to use anyColor() and anySize()?
find attempts to find something when it's called. So what your code says, in prose, is "find something that looks like 'Start_menu', then make the thing you found 0.5 similar, then make that any color"
This is wrong--you can't set the similarity threshold after the fact. Instead, call it as seen in the Sikuli docs.
Instead, say
l = find(Pattern("Start_menu.png").similar(0.5))
Here's the same code arranged vertically:
pattern = Pattern("Start_menu.png")
pattern.similar(0.5)
l = find(pattern)
The other problem is your reference to the anyColor() function, which doesn't exist. I see the code you're trying to run is from "Sikuli: Using GUI Screenshots for Search and Automation" (linked from the Sikuli docs), but this function (and the syntax used in that paper) don't exist in any extant version of Sikuli. You can see an open feature request for it on the Sikuli launchpad page.
This doesn't help you now, though. I don't know of another visual automation package that can do anyColor. If you wanted to use that feature for something, I suggest asking a new question where you describe the problem you're trying to solve, and someone may be able to suggest a work-around for that specific case.

Formatting Issue when Using Manipulate to display Lists

Please consider the following problem.
I'm writing a quick Manipulate[] program to display a ton of information, but am running into problem with the unicode. Here is what I currently have as input and output:
Manipulate[
request = filenumber <> "*";
filenames = FileNames[request];
display = Import[type, "List"];
Short[display, 25]
, {filenumber, "001", InputField}, {type, filenames, PopupMenu}]
The problem is that the French-language accents are showing up oddly. The quick workaround I thought of was to change my code to Import[type,"Plaintext"]; which works, but then displays the information in list form, like so:
What would you suggest as a way to get the clarity of the second example with the straightforward list format of the former? So that it wraps on the line rather than having a line break after each entry.
As an aside - probably just as important as the actual question itself - could anybody explain the rationale behind why importing as a "List" distorts the unicode? I've had a lot of trouble working around this, and understanding the underlying behaviour might help me move forward quicker.
Although Import does not have options associated with itself, it takes options relevant to the format being imported. Specifically see the Options section of ref/Format/List for the list of options.
In the case at hand, you can indicate the file encoding with CharacterEncoding->"UTF8":
Import[filename, "List", CharacterEncoding -> "UTF8"]

VB6 intellisense problems

I am writing a simple application that utilizes option(radio) buttons in vb6.
I am attempting to make different buttons and labels appear based on which optionbutton has been selected. I attempted to use an if statement that looks like this:
If (EditOpenTicketRadioButton.value = True) Then
label.visible = true
elseIf(...) then....
and on.
things start acting strange when I begin to type the period after EditOpenTicketRadioButton. the only options that intellisense gives me are Count, Item, LBound, and UBound. I know from internet examples It should be like the above example right? it will not run with that syntax it gives me an error that states: compile Error: Method or data member not found. then it points me to the Load method for my form...
If anyone can help me make sense of this it would be greatly appreciated.
Thanks in advance!
From the (very, very) limited information you gave, I can only assume EditOpenTicketRadioButton is a victim of extremely poor name choice and is actually an array of radio buttons.
If that's the case, you need to figure out which button you mean, and use it like EditOpenTicketRadioButton(0) or whatever.

Resources