Oracle adf: no response from action and action listener on master-detail commandLink - jsf

I have master-detail tables. In the detail table, one of the columns is a af: commandLink. However, the link does not navigate out of the page at all. In fact, I made a dummy action listener with sysout to see if it would invoke it at least, but it didn't.
I am not vested in adf life-cycle but my page is in a bounded task flow of two pages only. When I placed a button above the two tables on the same page with the same action it worked. It seems that the problem is only in the detail table. I once tried invoking a value change listener in the same way and it did not work. I tried all the column selection values: none and single, but with no luck.
Is this a common bug? If so, what is the work around?
Thank you,

Related

Kendo Grid Page Persistence

This is a more conceptual question, so I'm not initially submitting any code for it unless someone requests it.
On a current website of mine, I am using a Kendo UI grid to display a table of multiple pages. I also have a (Kendo UI) drop down list, allowing the user to filter rows by class (it reloads the page and makes the necessary edits through the controller).
My problem is this: when the user pages through the Kendo UI grid, it loads a new page and the filtering preferences do not persist. How can I make it either not reload the page(and do everything on the same page instead), or make the drop down box's value persist? Thanks, and tell me if there's any information that would be helpful for me to add!
CLARIFICATION: The functionality is all fine, the only issue is that the dropdownlist does not visually persist.
Actually you can bind both dropdownlist and grid to a single external datasource. This datasource will actually place a ajax call and get the records when the value in drop down changes. As the new records appear in datasource the grid can be refreshed or will automatically refresh without the page reload. Page reload doesn't look like a clean way to filter the grid.

Primefaces/JSF functionality not working on updating dynamic columns

OK, so I'll express what I'm doing in bullet points without code (as I'm in a massive muddle)...
Using a single-page application with <p:layout> consisting of <p:layoutUnit>s (in different pages brought to main page using <ui:include>)
One of these <p:layoutUnit>s is a single <p:dataTable> updating dynamically (also it's a dynamic dataTable based on selected single-row and associated <p:commandButton>
Rest of the <p:layoutUnit>s update dynamically based on actions happening in dataTable (they contain buttons whose actions (presently not defined) update with change in dataTable data and dynamic 'header text')
dataTable uses dynamic columns (as data to be shown changes, if it helps, data is in a 'tree structure' and I navigate 'up' and 'down using buttons (common 'back' in header) and 'next' <p:commandButton> for each row)
Now to the actual problem
When I use the 'next' button to go to the next level of data in the tree, let me illustrate what happens:
Root -> 'Next' -> Goes to Child -> data updated
Child -> 'Next' -> No action -> Use one of the non-dataTable buttons with no function defined -> default JSF/PF action is Page Refresh -> data updated
'Next' -> Goes to Child
Why does this happen? Why does the 'no action' period happen in between? I feel like I'm missing something here. It's never happened before. None of the controller's functions are triggerable at that time. I've checked this by using the debugger in my IDE. I'm 100% sure it's a problem with the dynamic dataTable. But I don't understand why as I've initiated Column Controller in the 'preRenderView' stage using <f:event>
Also using an 'id' for the body in the Main Index Page and updating using RequestContext just makes the page blank.
I've tried multiple combinations of View and Request Scopes for the Column Controller and used a 'PreViewRender' event listener in the dataTable to initiate the Column Controller. All of my efforts.
One particular combination (IIRC **NOT ** using the PreViewRender listener causing even the data to not be updated in the dataTable, forget non-functioning of <p:commandButton>s or <p:remoteCommand> on <a> onclicks.
As there is a huge amount of code spanning this and am in a muddle myself now, I'll add code when you make some headway.
OK, I found the answer!
https://stackoverflow.com/a/2120183/3488113
This is user BalusC's answer where one of the main reasons he suggests is JS error.
I am calling a JavaScript function from the Bean which does not exist/returns some error. Removing references to it in the Bean has solved the problem for the time-being.
I assume the rest of the update actions stop/frontend component JS action changes are not loaded/actions itself are not loaded if there is a JS error in the backend call, which is the real cause.

JSF-Calling BackingBean method twice maintaining value of inputFileUpload

I am very new to JSF. I have the following requirement:
On click of a commandButton, call a backing bean method to check if there is some data present satisfying the condition.
If yes, confirm from user for overwrite.
If user says OK, call the same method of backing bean with some parameters set to tell the program to overwrite the data.
What I am doing is:
having action of the commandButton as the method name.
in the backing bean method, check if we have come with certain condition, check if the data is already present.
If yes, go back to page and ask for confirmation.
If confirmed, call the click method of the button.
The problem is, when I come back to the page, the inputFileUpload component on the page loses its value.
What can I do to achieve this? Please help.
This is fully by HTML specification and completely outside control of JSF. It's by HTML specification for security reasons not possible to (re)display the value of a HTML input file field with a value coming from the server side. Otherwise a hazard scenario as shown in this answer would be possible.
You need to redesign the form in such way that the input file field is not been updated during confirmation. You can use among others JavaScript/ajax for this: just submit the form by ajax and make sure that the input file field is not been updated on ajax response.

Have to push button twice to get partial refresh to work

Background: Xpage with multiple data sources. Each row of tabbed table contains an edit panel bound to a different data source than the main page. Each page contains a table to enter new documents. These documents are children of the main document. There is a view control that shows the user created documents immediately. The button in the table saves the document in addition to adding some control fields. It does a partial refresh of the editPanel.
Recently I added validation to the fields in the entry table. I use a function, and prevent updating from anything but the button. I am using Tommy Valand's method from this blog post: http://dontpanic82.blogspot.com/2010/03/xpages-making-validation-behave.html. If I don't use Tommy's method, then the validators fire when switching tabs, and are useless.
All of this works sort of, but I am experiencing the following issues.
1) I have to push the button twice to get the partial refresh to fire. Not only that, but the validation messages to not fire until the button is pushed twice. The first part was still an issue prior to adding the validation.
2) The table values do not clear after the refresh does happen. This used to work prior to adding the validation. The only way to get the values to clear now, is to do a full refresh (F5).
I really just need partial refresh to behave like it should. Any help is greatly appreciated.
I am answering my own question because I think that I might have found out why the partial refresh was acting so flaky. Here is what I did that solved my issues: Each tab had an editPanel. If I make the edit panel do a partial refresh to itself then the buttons on that panel seems to behave as you would expect them to.
When I create a new core control panel, the default in No submission. I do not know whether this issue manifests itself only when using multiple data sources and/or tabbed tables. Hopefully this fix will be of use to someone down the road. It is worth a try if you are having issues with partial refresh working correctly.

Populating a page from Data table in modal panel

I'm trying to get some data from a datatable in rich:modal panel
The whole flow is as follows
When clicking on search button on main page, a modal panel pops up with appropriate data & check box
Till this point the application is working fine
After clicking on ok button, selected data should be populated into main page. This is where the code fails
I tried stuff like getRowData, getValues, etc. but in vain. This could be done by keeping the bean in session scope but I have to keep this bean in request scope using Apache MyFaces JSF 1.2
Two ways comes to mind:
Pass an extra request parameter (the search string and the page number?) so that the bean knows which data to preload.
Make use of MyFaces Orchestra to create a conversation scope which lies in between request and session scope and is exactly the scope you're looking for this particular functional requirement.

Resources