I am using apex 21.1.
I have built a report with a form. The report page(2) has another region "Param" which has item P2_DEPTNO. The form(Modal Page -3) is for creating new records and editing existing records. There is a CLOSE DIALOG process in page 3 and it has P3_DEPTNO as a value for "Items to Return" attribute. Page 2 has a DIALOG CLOSED dynamic action with a true action of SET VALUE that sets P2_DEPTNO with the value of P3_DEPTNO. This is when I should call page 4 in a new tab(when P2_DEPTNO is assigned P3_DEPTNO's value.I am calling page 4 using the code...
apex.navigation.openInNewWindow('f?p=&APP_ID.:4:&APP_SESSION.:::4');
Unfortunately, it does not work and I do not know why. However, if the dynamic action is of type Alert, it works fine and displays the alert when P2_DEPTNO's value changes. What could be the reason for that?
ws=ESLAM_WS
un= forhelp
pwd=Forhelppwd$
app= Call new window
pages= 2,3 and 4
P.S: It works if I change P2_DEPTNO's value manually. But I need it to work when the SET VALUE dynamic action set it's value.
I tried to log in into you app, added another dynamic action event "Execute Javascript code" and entered your code without ':::4' part and it worked well for me.
so:
apex.navigation.openInNewWindow('f?p=&APP_ID.:4:&APP_SESSION.');
(also I have left an alert there that you mentioned worked anyway). If someone else fixed it meantime, I hope she/he will document here what she/he did.
Related
Let's say that I have a group of radio items in a wxMenu. I know that exactly one of these will be checked at any given time.
Does the wxMenu or some other construct hold onto the index of the checked item, or do I need to call the isChecked on each radio item till I find the checked element to find it's index?
I've asked this question about how to do that, but I'd much prefer wxWidgets saved me from doing that everywhere.
No, saving the index of the last selected item (as shown in ravenspoint's answer) or using wxMenuBarBase::IsChecked() until you find the selected radio button is the only way to do it.
For wxWidgets to provide access to the currently selected button it would need not only to store it (which means not forgetting to update not only when the selected changes, but also when items are inserted into/deleted from the menu, so it's already not completely trivial), but to somehow provide access to the radio items group you're interested in, which would require being able to identify it and currently there is no way to do it and adding it isn't going to be particularly simple.
What could be done easily, however, is writing a reusable function int GetIndexOfSelectedRadioItem(int firstItem) that would start at the given item and call IsChecked() on subsequent items until it returns true and return the offset of the item. You should be able to do it in your own code, but if you'd like to include such function in wxWidgets itself (as a static wxMenuBar method, probably), please don't hesitate to send patches/pull requests doing it!
It is easy enough to roll your own.
Bind an event handler to wxEVT_COMMAND_RADIOBUTTON_SELECTED for every button. In the handler, extract the ID of the selected radio button and store it somewhere.
Like this:
ResolMenu = new wxMenu();
ResolMenu->AppendRadioItem(idRcvLoRez,"Low Resolution");
ResolMenu->AppendRadioItem(idRcvMeRez,"Medium Resolution");
ResolMenu->AppendRadioItem(idRcvHiRez,"High Resolution");
ResolMenu->Check( idRcvLoRez, true );
Bind(wxEVT_MENU,&cFrame::onRcvRez,this,idRcvLoRez);
Bind(wxEVT_MENU,&cFrame::onRcvRez,this,idRcvMeRez);
Bind(wxEVT_MENU,&cFrame::onRcvRez,this,idRcvHiRez);
void onRcvRez( wxCommandEvent& event )
{
myRezID = event.GetId();
I have one page where i have about 8 tab region. Each region has a select statment. They are executed when accessing the page (page load) at the same time. Because i have 8 select statment that executes at same time it leads to pure performance.
My question is how to execute the query only on active region.
You can try this one
Create Dynamic Action on event "Page Load"
Create true action "Execute javaScript Code":
window.setTimeout(function(){
$('.a-Region-carouselLink').click(function(){
apex.event.trigger(document, 'tabChanged', this);
})
}, 500);
Set "Fire On Page Load" to "Yes"
Create Custom event "tabChanged"
Create true action in DA custom event "Execute JavaScript Code":
console.log(this.data);
Test it - each time you click the tab, DA prints to console currently clicked anchor.
Of course it is not perfect because of the 0.5s delay. Still it allows you to listen what tab was "clicked".
To make your scenario work I would do:
create page item PX_TAB
create true action in custom event to set value of PX_TAB
create true actions in custom event to refresh reports within tabs
set "Page Items to Submit" to "PX_TAB" in each report to be refreshed
add condition to each report comparing value of item PX_TAB - it will execute SQL query only when PX_TAB has expected value
edit 2016.08.13
You can bind tabs by simple adding listener to the tabs
$(document).on('mousedown', 'a.t-Tabs-link', function(){
//this is an anchor used as tab
console.log(this)
})
If you want to keep it in APEX way enter code from below in Execute when Page Loads page section or create new dynamic action On page load
$(document).on('mousedown', 'a.t-Tabs-link', function(){
apex.event.trigger(document,'tabChanged', this);
})
and then add dynamic action bound to Custom event named tabChanged. Whenever tab is clicked the tabChanged event is triggered, and in Execute JavaScript Code you can reference current tab by this.data
Try to create buttons and set behavior of each button to display required region and hide others (create hidden item, then create buttons that set values 1,2,3 etc., then add conditions to every region to display region 1 only when hidden item equal 1, region 2 for item value 2 etc.
Please explain how to change a "hidden variable", say p_show_variable, to NULL whenever page is reloaded.
I have a conditional report in a page , and the requirement is whenever any variable changes and that "Submits" the page , then p_show_variable should become NULL, thus hiding the conditional report.
Create unconditional PL/SQL proccess on your Page Rendering. Add some code:
BEGIN
:P_SHOW_VARIABLE := NULL;
END;
You can also add some condition on proccess, for example, Request=Expression. Change button action to Redirect and set Request value. Use this value as Expression in process condition.
Or set condition for proccess When Button pressed and set button name.
To reproduce the behavior, start a new MFC Outlook style project with Ribbon (CMyView as the view class name).
Let's say I want to modify a menu of a CMFCRibbonButton, for example the subitems of the Print command, and for this, I want to RemoveAllSubItems() first.
Add this as a public member in MainFrm.h:
CMFCRibbonButton *m_pBtnPrint;
Add this in the InitializeRibbon() member funcion in MainFrm.cpp:
CMFCRibbonButton* pBtnPrint = new CMFCRibbonButton(ID_FILE_PRINT, strTemp, 6, 6);
// store the pointer to the button to be used in CMyView class
m_pBtnPrint = pBtnPrint;
In CMyView::OnUpdate() add this code:
CMFCRibbonButton *pBtnPrint = ((CMainFrame*)AfxGetMainWnd())->m_pBtnPrint;
if (pBtnPrint) pBtnPrint->RemoveAllSubItems();
My best guess is that something goes wrong with the frameworks internal replication of the Print command, e.g. for the Quick Access Toolbar. I wonder if I'm missing something here. Is it somehow forbidden to modify menus after the ribbon bar has been created in CMainFrame?
Edit: It obviously has nothing to do with m_pBtnPrint being invalidated e.g. after LoadFrame(). If you retreive pBtnPrint dynamically using CMFCRibbonBar::FindByID(), it will crash as well:
CMFCRibbonBar *pRibbon = ((CMDIFrameWndEx*) AfxGetMainWnd())->GetRibbonBar();
CMFCRibbonButton *pBtnPrint = DYNAMIC_DOWNCAST(CMFCRibbonButton, pRibbon->FindByID(ID_FILE_PRINT));
if (pBtnPrint) pBtnPrint->RemoveAllSubItems();
Edit: I have started a support query on the Microsoft Connect website, but no meaningful response since.
CmainFrame::LoadFrame() overrides your pointer. If you have registry values saved from the last time you ran and closed this program, then LoadFrame will serialize the old state of the MFC buttons. The memory locations change during this time, and your saved pointers during Initialize will be invalid. You must find a way to grab the pointer to the button AFTER the LoadFrame has been ran.
I created a setup function on all my MFCToolbars just to grab these custom button pointers after the new buttons have been created from registry. I call this Setup function in my CWinAppEx::InitInstance after the call to CMainFrame::LoadFrame()
You should be able to run fine if you delete the registry values saved by this program, but upon second run it will crash.
Titanium SDK version: 1.7.0
iPhone SDK version: 4.2
I am developing an iOS app using Appcelerator.
In this app I got a window that contains a table of contact data.
The user can click an item in this table and a new window opens up where they can
edit the contact details and then click save.
After the user clicked save I want the table in the parent window to update its data for the clicked row with the info sent back from the edit window.
My question is. How can I update the labels in a specific row if I got the row index?
I am planning to make this update from a custom event so I will not be using e.index only the "saved" index number for example 5.
I know there is a function called "updateRow" but I seem to only be able to update title of the row not its child elements.
Thankful for all input!
Here is the approach I would take.
Assumptions
win1 contains the table (table1) and
an array that contains rows that you
can update (data)
win2 is where the
editing occurs
On the 'save' button click in win2, fire an event with the updated contact details before you close the window;
Ti.App.fireEvent('contact.change' , updatedContactObject );
// Do database save here if required
win2.close();
Add an eventListener in win1:
Ti.App.addEventListener( 'contact.change' , function(e){
var updatedContactObject = e.updatedContactObject;
//
// update the array and the row here
//
data[ updatedContactObject.id ] = updatedRowData;
table1.setData(data);
});
In my experience it is best to tableView.setData(rowArray) whenever you make a change, rather than selectRow, updateRow, etc. Regarding the actual row elements, you should be able to navigate by using row.children[x].children[x]. The problem is that you will have to pay close attention to the hierarchy. Let us know if you find a better way!