update table in gtk - pygtk

I have window that contains a table on screen, now I want to attach a widget to that table I use
gtk_table_attach(GTK_TABLE(table), label, ...)
the function is correct and it runs without any error
but table does not respond to that line I mean there is no change on my table, I think I need something to tell that table update it self but how?
note= that line is inside a callback of a signal and I am sure that signal runs
note2= I do not want to destroy window for that
note3= I use gtk+ and pygtk
note4= I am sure I attach that widget to a correct position ( it is free)

Did you call gtk_widget_show() on label first?

Related

Apex, Dynamic action, Confirm action, not picking up correct text - what am I missing?

I'm obviously missing something and hoping someone might be able to help.
I've an Interactive Grid, and a button.
When the button is pressed the dynamic action on the button has 2 steps.
Action 1 - Execute Javascript to take a value from one of the IG cells and put it into a page item.
Action 2 - Confirm Action - Are you sure you wish to delete &P10_JOB_ID.
I've made the page item, &P10_JOB_ID, visible and I can see the value has correctly been changed to the value from the IG.
I write P10_JOB_ID into a database table - I get the correct value
But the confirm message isn't picking up the correct value from P10_JOB_ID.
Namely it uses the value in P10_JOB_ID when the page starts, but then as I move around the IG pressing the button and changing the value of P10_JOB_ID, the text in the confirm message never changes.
Can anyone suggest what I might have missed, I'm baffled.
Thanks a lot
Substitutions like &P10_JOB_ID. are made when the page is rendered, not dynamically, so reflect the value at time of page load.
You will need to use Javascript to perform the conform action, something like:
apex.page.confirm ('Are you sure you wish to delete ' + $v('P10_JOB_ID') + '?', 'DELETE');
$v is an APEX Javascript function that returns the current value of a page item.
I used 'DELETE' as an example of a request value; you may want to do something different here.
Ok - having the setting of value and confirm as 2 separate actions is what causes the problem.
As per fac586
That is the expected behaviour. Static text substitutions are performed once during page show processing. They are not evaluated dynamically in the browser at runtime as values change.
Drop the second action and extend the first to display the confirm dialog using the apex.message.confirm JS API method, accessing the item value using the $v shorthand method.

Aurelia Validation and event publish not updating values in View

I was using Event aggregate publish method to update view from another view. when I created publish and subscribe data was able to get in view model , but that is not updating in view with assigned variables. If I use JavaScript to fill value it's working but not able to trigger validate controller.
Expected result is:
From the subscribe method I have to fill the view values.
After that it should trigger validate on value changes.
In below gist run I have two view and view-model. One is registration-form and second one is data-form. In data-form I have table with data, on click of each row I am publishing one event with selected row data, and this published event I was subscribing in side of registration-form view-modal. For more details look into below gist run.
Gist run: https://gist.run/?id=8416e8ca1b9b5ff318b79ec94fd3220c
Two possible solutions: (to your "undefined" alert)
Change alert(this.email); to alert(myself.email);
Use the thick arrow syntax for the subscribe function. Change:
this.ea.subscribe('MyrowData', function(obj){
to
this.ea.subscribe('MyrowData', obj => {
This syntax allows the new function to preserve the context/scope of the parent, which means that this.email will still be accessible.
Another suggestion:
You could simplify your data-form.js function as follows:
Change:
this.eventAggregator.publish('MyrowData', this.items[this.items.indexOf(item)]);
to:
this.eventAggregator.publish('MyrowData', item);
This will work because you've already provided item in your function call click.delegate="PopulateData(item, $event)".
In fact, you could even delete $event and event from the two PopulateData definitions (in data-form.js and data-form.html).
When I implement these suggestions, your data is also validated correctly.

QTP - Checking dynamic pages

I'm trying to check if a value is contained in the innertext of a webelement but I'm having a little problem: frames seem to change at every refresh of the pages.
These are the steps I've recorded:
Browser("SystemPage").Page("SystemP").Frame("dme2_header").Image("Gestione Anagrafiche").Click<br>
Browser("SystemPage").Page("SystemP").Frame("dme2_appl").WebEdit("pdrBean.pdrPod").Set parameter("POD")<br>
Browser("SystemPage").Page("SystemP").Frame("dme2_appl").WebButton("Cerca").Click
Browser("SystemPage").Page("SystemP").Frame("dme2_appl_2").Image("show_files").Click
Browser("SystemPage").Page("SystemP").Frame("dme2_appl_6").Image("Lente").Click
cctype = Browser("SystemPage").Page("SystemP").Frame("dme2_appl_7").WebElement("arrow_down").GetROProperty("innertext")<br>
DataAct = Browser("SystemPage").Page("SystemP").Frame("dme2_appl_7").WebElement("arrow_down_2").GetROProperty("innertext")<br>
Browser("SystemPage").Page("SystemP").Frame("dme2_header").Image("Gestione Anagrafiche").Click
The frames "dme2_appl6" and "dme2_appl7" changes at every refresh of the two pages.
The question is simple: how can I rewrite these two actions to make them universal?
I've tried to do something like:
Set objFrame = Frame("title:=dme2_appl_.")
and then
Browser("SystemPage").Page("SystemP").objFrame.Image("Lente").Click
But QTP gives me an error in return: "property or method not supported by the object"
Please try using the below code
Browser("SystemPage").Page("SystemP").Image("Lente").Click
Avoid using the "Frame" and if you really want to use it, put regex for name property of Frame.
Go to Object Properties--> Click on the Frame object --> Mandatory Properties--> Change name property as
like iFrame_213123123 to i.*
Hope this will solve your problem.
I don't think you can use a frame object that way. When you write Page().Frame() UFT sets the frame's parent in different way than if you first create the Frame.
Think of Frame() as a function that behaves differently when called on a Page or as a free function.
Try:
Browser("SystemPage").Page("SystemP").Frame("title:=dme2_appl_.")

How to trigger the ALV DATA_CHANGE event manually?

I have an instance of CL_GUI_ALV_GRID referenced by variable mo_alv_grid.
I have a button column in this grid, which after some logic, updates the table mt_alv_grid (backing mo_alv_grid).
I need to be able to trigger the event DATA_CHANGED at this point.
I have tried many methods of CL_GUI_ALV_GRID, like CHECK_DATA_CHANGED and REFRESH_TABLE_DISPLAY
and even CL_GUI_CFW=>FLUSH and CL_GUI_CFW=>SET_NEW_OK_CODE( 'ENTER' ). but none of this has worked.
Is there a way to trigger the DATA_CHANGED event, or should I be doing things completely differently ?
I don't know if this solves your problem, but in order to update the ALV internal table in the PAI, you could use the following method:
DATA lv_entries_are_consisted TYPE abap_bool.
mo_grid->check_changed_data(
IMPORTING
e_valid = lv_entries_are_consisted
).
well, it's possible.
1) don't change values in internal table by program
2) create a change protocol of type LVC_T_MODI with a new values for lines needed
then call
CALL METHOD lo_grid->change_data_from_inside
EXPORTING
it_style_cells = lt_cells.
where lo_grid is instance of cl_gui_alv_grid and lt_cells table type LVC_T_MODI. please note, that you will need to set field VAL_DATA of layout structure (LVC_S_LAYO) to 'X' when calling ALV grid for the first time to make this work.
after this, class will automatically change internal table for you and call DATA_CHANGE event

Accessing the changed state of a radio button using rollout creator (Maxscript)

I've run across another issue using the dynamic rollouts. I'd like to add a handler for when a radio button group's selection is changed. Here is what I have:
--Instantiate a new dynamic rollout object
dro = rolloutCreator "CustomParamsRollout" "Edit Custom Parameters"
--Begin building rollout
dro.begin()
--Create an array to hold the names of the radio button options
dro.addLocal "RadioOptions" init: #("Predefined", "Custom")
--add control --type --label --displayed name --labels --alignment
dro.addControl #radiobuttons #rdo_1 "radio_1" paramStr: "labels:RadioOptions align:#left"
--Add a handler for the first radio button
dro.addHandler #rdo_1 #changed filter:on paramStr:"1" codeStr:"MessageBox #Hey#"
createDialog (dro.end())
The error I keep getting is:
Compile error: Bad number or time syntax
In line: on rdo_1 changed 1do
Whenever I click on a radio button. I'm most certain that my syntax is poorly written, as that has been the biggest hangup in this project so far. Any helpful hints would be appreciated.
Thank you.
Since 3ds Max 2012 you need to add an extra space to the parameter string (in Max 2011 and earlier version it works without glitches. So instead of paramStr:"state" it would have to be paramStr:"state " – note that using integer for a name of variable will not work, rollout handlers don't in any way work like pattern matching, you need to handle different parameters inside the handler scope.