0

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.

hrishi1990
  • 325
  • 3
  • 12

1 Answers1

0

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.

Community
  • 1
  • 1
hrishi1990
  • 325
  • 3
  • 12