visualforce rerender the parent page table from child - parent

I want to refresh the part of (not whole page) the parent window by clicking the button on child window.
It it is like action="action name" rerender="id" on just one page.
But from child window, is it possible to rerender the parent page part(on my case it is table)?
Please, help.
Thank you!

Yes. Simply:
rerender="ioOfParentComponent"
This only pertains to the same page, however. If you're talking about IFrames then this will not work. But within the same <apex:page > </apex:page> block, this will work.

If you want to refresh a parent window from the child, and the child is a popup and both pages are custom visualforce pages - do it per javascript callback:
Parent window:
<apex:actionFunction name="callBackFunction" reRender="refreshMe" action=""/>
<apex:outputPanel id="refreshMe">
Some text here...
</apex:outputPanel>
Child window (popup):
<apex:commandButton onClick="javascript:parent.window.opener.callBackFunction(); return false;" value="Refresh parent" />

Related

Yii2 Modal: How to change/disable layout in a Modal windows?

When you load a view in a Modal window, the view's controller's action doesn't execute. So, any code you put in there is never executed. How can i change the layout in a modal window?
I tried puting Yii::$app->controller->layout = 'popup.php'; in the view loaded in a modal, but don't. The main layout still remains in a modal window.
Also, i've tried using Yii::$app->controller->renderPartial('myUpdate', ...); in the update view loaded that call the _form in cuestion in a modal, but no way. The main layout still remains in a modal window.
So... any idea?
Ok, renderAjax() was the solution.
Thanks to me.

How to get focus from child dialog and parent dialog

I Have one parent dialog and one child dialog, when I loaded child dialog in parent dialog the focus is not coming on parent dialog`s control, what I do to get focus on parent dialog control?
Without seeing your code, I would assume that this is a problem with dialog styles. In particular, WS_EX_CONTROLPARENT.

Pagination inside bootstrap modal window

I am using the bootstrap modal window as data picker. But when having more results to pick displaying pagination. I want to load the next pages inside the same modal window when clicking on the pagination.
Can I do it in generic way like when any link clicked inside a modal window to load the content inside the same modal window, or do I need to implement this for each link separately using AJAX feature?
Please refer this three links: There will help you for sure.
Reference-1
Reference-2
Reference-3
You could change $('modal-body').html() on click.
The modal shows/hide without changing or reloading content. So you will have to restore the original content on hide maybe.
Use $('#myModal').on('hidden.bs.modal', function () {} to restore your original content.

How do I move a widget around on the screen?

I have a Menu widget that I want to display whenever the user clicks on specific dom elements, but I don't want a MenuBar. What's the best way to do this? I've tried attaching click handlers to the relevant DOM elements and having the click handler display the Menu, but I can only get it to display the Menu in the area where the original declarative markup would have been rendered. I can't get it to move at all. I'm attempting to use dojo.style(myWidget.domNode, 'top', calculatedTop) (and the equivalent with 'left'). What (obvious thing) am I missing?
Thanks.
Since you are using the dijit's default menu widget, I would think that you just need to specify the property targetNodeIds on the Menu Widget (reference) to define where the context menu is relevant:
targetNodeIds (Defined by dijit.Menu)
Array of dom node ids of nodes to attach to. Fill this with nodeIds upon widget creation and it becomes context menu for those nodes.
To get the popup showing on left click I believe you'd want to use the property leftClickToOpen:
// leftClickToOpen: [const] Boolean
// If true, menu will open on left click instead of right click, similiar to a file menu.
//defaults to false
leftClickToOpen: false,
Specifying this declaratively would look like:
<div data-dojo-type="dijit.Menu" data-dojo-props="targetNodeIds: ['nodeId1','nodeId2','nodeId3'], leftClickToOpen:true"
style="display: none;">
<!-- Your content here -->
</div>

How to Disable components onClick of a Button in JSF?

In my application i have three buttons, If i click on one button I have to disable all the button till the operation on that button is finished.
I dont know how to disable the other two buttons. Kindly help.
Use JavaScript to get the HTML element from the DOM and then set its disabled attribute.
document.getElementById('clientId').disabled = true;
Note that the 'clientId' is the autogenerated HTML element ID. Rightclick page and View Source to find it out. If this contains prefixes like j_id and so on, then you need to give all parent UINamingContainer components like <h:form>, <h:dataTable>, <f:subview> and so on a fixed component ID, so that the client ID doesn't need to be autogenerated anymore.

Resources