Checkbox that unchecks other checkboxes – Maya MEL - checkbox

I just recently started learning MEL scripting and I barely scrape the basics. But for now, I am able to write my own script which enables showing/hiding of objects in Maya 2015. The problem I am facing now is that I want a master checkbox that checks/unchecks other checkbox. The method I have now only enables me to change one children checkbox but not the rest.
ETC - None checkbox is on. All other children checkboxes are off. None checkbox is off. All other children are on. Right now I can manage to get one children checkbox to be toggle on and off with the master None checkbox.
Here's my code:
checkBox -label "None" -align "center" -v false -onCommand "OnNoneProcedure" -offCommand "offNoneProcedure" -changeCommand "checkBox -edit -value (!#1) checkboxNurbsCurves";
checkBox -label "NurbsCurves" -align "center" -v true -onCommand "OnNurbsCurvesProcedure" -offCommand "offNurbsCurvesProcedure" checkboxNurbsCurves;
Am I doing the right way with the changecommand method? if yes, how do I get the other children checkbox to on and off? or do I query the master None checkbox -v then use the -v of None to toggle the -v of children checkbox?

probably the easiest thing to do would be to create a procedure that sets all the checkboxes you want to the desired state, then specify that procedure as the changeCommand.
In order to get that to work, you'll probably want to name the checkboxes and/or store them into some string array variable that you can loop through to set within your procedure... Fortunately, that's really easy since the checkbox command returns the full name of the checkbox it creates.

okay i got it working! haha my friend mentored me through the last step. basically this is how it works; 1) query current panel state 2)get results and pass into a array 3)use the results from returned array into another procedure into a new array 4)each result if 0 = off that element, if 1 = on that element return this new result 5)create shelf button with new result (result = command).

Related

SSIS Logging - Capture Variables?

I'm trying to capture the values of about 15 variables within my sysssislog when my package executes.
I have set all the variables to true for "Raise event when variable value changes" and I understand I have to put some sort of object/code into the Event handler but I'm totally unsure as to what this should look like for the 15 variables.
Can anyone offer some examples please?
After the RaiseChangedEvent property is set to true on the variable the OnVariableValueChanged event will need be selected for logging to SYSSSISLOG. This can be done by right-clicking the package and selecting Logging then going to the Details tab and checking the check-box for the OnVariableValueChanged event. After this click the Advanced button and check the box for each element that will be logged, for instance Computer, SourceName, etc. To see the actual value that the variable was changed to query the SSISDB.CATALOG.EVENT_MESSAGES DMV following package execution. The MESSAGE column will show the value that the variable was set as during package execution.

How to clear checkboxes and set one checkbox in JIRA postfunction using Groovy with Adapatvist ScriptRunner

I have a Groovy script Post-Function using Adapatvist scriptRunner that creates sub tasks based on what checkboxes are checked on the parent issue during creation.
How do I clear all of those check boxes from the parent issue in a Post-Function and set the parent's checkbox selection to just one (different) check?
The following is an example of a ScriptRunner Post-Function to create a subtask based on what product checkboxes were checked. All of these Post-Functions occur after the Creates the issue originally step.
Condition: http://pastebin.com/k8UbjQhs
Target Issue Type: Sub-task
Additional issue actions: http://pastebin.com/nSStL6b5
I have 10 unique Products that could be checked onduring the parent issue creation. I know I need the step where I would scrub to come after all of these Sub-task creating steps but before Storing updates to an issue or Re-indexing the issue.
I would like to run a script that, before the Re-index of the Original Parent issue being creating, will make sure that it only has one single product value checked. For example we'll call that product Parent Issue

How do you use the SQLQuery component to run multiple queries?

I have a ListBox showing all the records for a single field (first) in a database. When users click the ListBox item I'd like the value for a different field in the db (last), same record, to be displayed. My code ListBox OnClick event code is:
SQLQuery2.SQL.Text:='SELECT * FROM Names WHERE first= :FIRST';
SQLQuery2.Params.ParamByName('FIRST').AsString := ListBox1.Items[ListBox1.ItemIndex];
SQLQuery2.Open;
ShowMessage('You selected '+SQLQuery2.FieldByName('last').AsString);
When you click an item, the expected field comes up in the MessageBox. However, if you then click a different item, nothing changes--the MessageBox shows the original field.
I don't know enough about SQLQuery components and how they interact with the underlying db to know what's happening.
[P.S. The db is sqlite3, if that matters, and I'm using Lazarus rather than Delphi, if that matters.]
You need to close your query before opening it again. If you look at the code for Open on TDataSet it sets the Active property to true. The setting code for Active first checks that the value is different before doing any work:
procedure TDataSet.SetActive(Value: Boolean);
begin
..
if Active <> Value then
begin
end;
end;
So in your case, the active property is already true and the code just exits.

outputting checkbox ids to an empty div

I am currently building a keyword bank to assist in tagging my in-house design assets. My idea is to have each keyword as a checkbox form element with one empty div at the bottom. You'd go through the entire list, check what you need and the text assigned to the id of that checkbox would populate in the empty div, separated by commas, and I can just copy/paste that text right into the metadata. I plan on having hundreds, so I'm hoping there is simple solution to this.
I have no problem setting up the html form/checkboxes, but I am unsure how to make this text populate in that empty div—or even IF it's possible. Would I use jQuery? Ajax? I also don't need a submit button—just that div to update immediately each time a checkbox is touched. Would I also need to have some server-side communication with a submit button to even make this work?
Thank you so much in advance for any help you can give or any direction you can point me in.
Here is a working fiddle
What you need is basically something like this :
$( ":checkbox" ).click(function() {
//alert($( this ).val());
$("#myText").append($(this).val() + ";");
});
You can forget the alert. This will add the value assigned to the checkbox in the div followed with a coma. :)

ZK window not unique in ID space

In our project we use ZK for webpages. There is a combobox which has lists. When selected, it fetches data from a java object through onSelect, i have given the logic.
when i select one there are 4 listboxes on that page to be filled with data according to the selection. when i select first time, no problem occurs.
But on second time i get an error pop-up like "Not Unique in the id space of Window" and showing the list box item id which have to be filled on select.
Can any one help out there?
Note: Though it shows this error i get the listboxes filled correctly according to the combo box selection. Still i cant stop this error occurring..
Your issue is a conflict of ids in ZK's id space.
A bit of background..
ZK generates ids for components at runtime, if you open up the DOM in the browser you'll see each component has some machine readable id.
However, you can also give components an id. This id does not go to the DOM but lets you reference the component in your application.
These two shouldn't be confused. The conflict you're experiencing is with the latter type of id; you are assigning a component an id in your Java code or in your ZUL file which, at runtime, is not unique.
The case you describe where it only happens the second time you click is a tell tale sign here. The content you are adding on the event has an id defined in it and you are not removing this content when you are done.
Consider the following example:
#Wire
private Window myWindow;
#Listen(Events.ON_CLICK + " = #myButton")
public void onMyButtonClicked() {
Label myLabel = new Label("sean is cool");
myLabel.setId("myLabel");
myLabel.setParent(myWindow);
}
This will work the first time you click myButton, but will throw your error on the second click. That is because the second event tries to add myLabel to myWindow but there is already a myLabel there.
There are lots of ways to resolve this depending on what you are trying to do.
Have a look through the ZK documentation on ID Spaces for more.
I also faced the same error.
My scenario is the same, only the widgets being used are different.
Hence putting my workaround here.
I have put the following piece of code in the doBeforeCompose() method of the composer:
Component widgetWithId = page.getFellowIfAny("widgetWithId");
if (widgetWithId != null) {
widgetWithId.detach();
}
Here widgetWithId is the component/widget, which is tried to be regenerated by the code, with the same Id and ZK is throwing error for it.

Resources