Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Bug using Timeline. Opening Dialog causes infinite fetches of t/sc/skins/Tahoe/images/blank.gif

    On a client containing only a Timeline, opening an an event edit dialog, my browser gets hosed by constantly requesting /sc/skins/Tahoe/images/blank.gif. HELP!!!!!!!

    SmartGWT 12.1d
    GWT2.7.0
    + gwtquery-1.4.0
    Java1.8
    Chrome 77.0.3865.120
    user.agent=safari

    = Robert =

    #2
    We're not seeing this with a simple test or in our Showcase.

    You didn't mention your SGWT build-date, but if it isn't the latest nightly build from smartclient.com/builds, the first step is to get that build and re-test.

    If you still see the problem, we'll need to see test-code we can run that shows the problem.
    Last edited by Isomorphic; 25 Oct 2019, 22:50.

    Comment


      #3
      Ok i stopped it by commenting out the call to timeline.setEventDialogFields ... still working on narrowing it down

      Comment


        #4
        Ok here are my fields, and the problem only happens when I add the LAST field ...

        Code:
        [B]public[/B] FormItem[] createEventDialogFields()
        {
            List<FormItem> array = [B]new[/B] ArrayList<FormItem>();
            array.add( createHiddenEventTypeField() );
            array.add( createNameEditField() );
            array.add( createDescriptionEditField() );
            array.add( createLocationField() );
            array.add( createStatusField() );
            array.add( createLaneField() );
            array.add( createWorkdayCountField() );
            array.add( createEventDialogDetailsField() );
        [B]    return[/B] array.toArray( [B]new[/B] FormItem[array.size()] );
        }
        
        [B]private[/B] SubmitItem createEventDialogDetailsField()
        {
            SubmitItem field = [B]new[/B] SubmitItem( "details" );
            field.setShowIfCondition( [B]new[/B] FormItemIfFunction() {
                @Override
        [B]        public[/B] [B]boolean[/B] execute( FormItem item, Object value, DynamicForm form ) {
        [B]            return[/B] [B]false[/B];
                }
            } );
        [B]    return[/B] field;
        }
        Last edited by RobertHana; 26 Oct 2019, 10:56. Reason: formatted code

        Comment


          #5
          Sorry, I was wrong about it being only the last field. It seems the start of the requests for blank.gif has an initial delay.

          Comment


            #6
            Ok I figured out it was an attempt at dynamically changing a StaticTextItem field (for the EventDialog) to hide/show it's hint. Here's the code:

            Code:
            StaticTextItem field = [B]new[/B] StaticTextItem( "workDayCount", "Workday Count" );
            field.setHint( "Click to split this Event" );  // <-- 1/3 I commented THIS out to fix the issue
            field.setShowHint( [B]false[/B] );
            
            field.setValueFormatter( [B]new[/B] FormItemValueFormatter() {
            
                @Override
            [B]   public[/B] String formatValue( Object value, Record record, DynamicForm form, FormItem item )
                {
            [B]       if[/B] ( value [B]instanceof[/B] Integer )
                    {
            [B]           int[/B] intValue = (Integer)value;
            
            [B]           if[/B] ( intValue > 1 )
                        {
                            item.setShowHint( true );  // <---- 2/3 I commented THIS out to fix the issue
            [B]               return[/B] "<div style='display: inline-block;' class='button ValueButton' title='Click to split this Event'>" + intValue + "</div>";
                        }
                    }
            
                    item.setShowHint( false );  // <----3/3  I commented THIS out to fix the issue
            [B]       return[/B] ( value != [B]null[/B] ? value.toString() : "" );
               }
            } );
            The idea was to only show the hint if the value is actionable (per the logic of the field's clickHandler).

            Comment


              #7
              We can't really get a picture of your use-case with just the snippet you provided - but you don't want to be unconditionally calling setShowHint() (or any other API with expected proactive effects on the UI) from inside value-formatters - those methods are already running as a result of effects on/interactions with the UI and are also fairly critical-path, since they run in various circumstances.

              Instead, you should see things work as expected if you call itemWithHint.setShowHint() from the changed() or click() handler that you're interested in, followed by a call to itemWithHint.redraw().

              If you still see issues with this technique, please provide a standalone, working test-case we can run to see the problem.
              Last edited by Isomorphic; 27 Oct 2019, 01:05.

              Comment

              Working...
              X