Hello,
I have a partial page within a full page. This partial page has the functionality to add/delete/edit. Once the user makes an update, how do I refresh the partial page? I can't seem to link a controller (add/edit/delete) back to the partial page.
I have a partial page within a full page. This partial page has the functionality to add/delete/edit. Once the user makes an update, how do I refresh the partial page? I can't seem to link a controller (add/edit/delete) back to the partial page.
RE: Partial page within partial page refresh
If I understand correctly, you have a partial page showing a list of items, with options to add, edit and delete. When these options are used you want to call a controller which performs the required processing, and then get the partial page to refresh itself.
Assuming this is correct, you have a couple of different options to achieve this.
As you need to reshow the same partial page at the end of the processing, you ideally want to call an action that goes to this partial page.
From a given partial page you can easily call any actions that originate from parent pages, so the easiest option is to add another action from the parent page to this partial page called eg 'processEdit'.
To make sure that this action triggers your edit processing before showing the partial page, you need to edit the Controller Rules for the partial page. In here add a new rule with a low priority number (eg 5) that performs an invoke service action calling your existing edit handling controller. (Set the from and to location XPaths to '/'.) To make sure that this only happens for the 'processEdit' action, add a condition to this new rule which checks for this action value in the control section of the XML message.
The final step is to configure the button on your partial page to call this new action. As this action is from a parent page you should be able to select it easily from the actions drop down of the Ajax Submission event. To make sure that the new contents completely replace the existing information displayed, you will need to use the 'Enter group name' option for the Target Group, and then manually enter the name of the partial page container group from the parent page.
An alternative option could be to keep the 'processEdit' action going from the partial page to the edit handling controller, but trick the page into doing an ajax submission to this controller. You can do this by using an 'Ajax Submission' event, and then selecting the 'Enter action name' option, and manually typing in the 'processEdit' action name. You would also need to type in the parent page's container group name into the target group setting as before, to indicate where the resulting details should be shown.
The last step would then be to ensure that the edit handling controller returns the correct partial page content. To do this you would need to add an invoke service action into this controller so that once all the processing has finished it will call the partial page controller to render the required content.
I hope this information is useful, and gives you some ideas of the approaches you can take.
Please let me know if you have any questions, or would like some more details on any of this.
Regards,
Gerard
RE: Partial page within partial page refresh
RE: Partial page within partial page refresh
For the case of where I have full page A -> partial page B -> partial page C, how do I refresh partial page B so that it includes all of the results after the add/edit from partial page C?
I know that may sound confusing. Please let me know if I need to reword!
RE: Partial page within partial page refresh
RE: Partial page within partial page refresh
Your approach for refreshing page B would not be too dissimilar to the approaches Gerard has already outlined. Remember that each partial page has an integrated controller which can receive actions. Exactly how you coordinate your action sequencing is up to you. If you are going to nest a lot of partial pages, it might be easier to use the full page as the "co-ordinator" of your refreshes by listing the main actions against this page. You just have to remember to manually enter the action names during your submissions from the partial pages.
In order to arrive at a particular position on your page, you should be able to use standard HTML and Javascript. Try adding a page onload event on your full page and use the focus() method on a suitable element near the location you want to position the visible part of your screen.
For example, dojo.byId('your_nearby_element').focus();
Regards
Abdul
RE: Partial page within partial page refresh
I have a group of tabs on my main page, and when I need to refresh the page, it needs to be on a specific tab, and not on the default first tab.
RE: Partial page within partial page refresh
To set which tab to show when a page loads, you generally just need to configure the +?+?++Field Value+?+?+? binding for the tab control field. You wouldn+?+?+?t normally need to use any script for this.
Just set this binding to return the Data Value string for the tab to select (eg +?+?++tab2+?+?+?) and the tab will be automatically selected on page load.
If you do need to change the current tab using JavaScript then the easiest approach is probably to just trigger a click of the relevant tab button. eg
dojo.byId(controlFieldName + '_tab_' + tabDataValue).onclick();
where controlFieldName is the name of the control field for the set of tabs you wish to change (eg +?+?++tab_control+?+?+?), and tabDataValue is the Data Value of the tab to select (eg +?+?++tab2+?+?+?).
I hope this helps,
Regards,
Gerard