Forum Stats

  • 3,816,305 Users
  • 2,259,168 Discussions
  • 7,893,452 Comments

Discussions

Apex 4.2 Jquery mobile UI duplicate elements appearing on page reload

Kevin Payne
Kevin Payne Member Posts: 13
edited Jul 11, 2014 4:09AM in APEX Discussions

I have a use case whereby regions are conditionally shown or hidden depending on the record type of the data to be displayed.

To do this I'm using jQuery to hide or show conditionally - something like:

    case $v('P350_RECORD_TYPE_A'):

       $('#regiona').show();

       $('#regionb').hide();

The Jquery is in a DA which fires on page load and works perfectly

on initial entry into the page ie shows only the appropriate region.

The problem happens when the user clicks on a save button ( which submits and saves any changes to the database)

then branches back to the same page. The page now shows all the regions, A, B ,C etc... Using the element inspector it was found that

two regions existed for each of regionA, regionB etc.. The first was appropriately hidden, the second was set to fully show.

I've placed debugs in the jQuery code and the code is fired once only per page load with the variables set correctly each time.

I'm using Apex 4.2 and the jQuery Mobile UI with a customised theme.

I've tested with safari on an ipod and Chrome on my PC both with the same results.

Any pointers as to why I'm getting region / element duplication?

Tagged:

Answers

This discussion has been closed.