RobYost Posted June 10, 2017 Share Posted June 10, 2017 I have a form and can change the style of labels on it with: UniSession.AddJS(' document.getElementById(' + aForm.Name + '.' + TUnimEdit(aForm.Components[i]).Name + '.getId( )).style.fontSize = "14px";'); But now I have a frame on a form and I have tried several things UniSession.AddJS(' document.getElementById("'+ MainmForm.framEntity.lblCompanyName.JSName+'_id").style.fontSize = "12px";'); Yields: Cannot read property 'style' of Null UniSession.AddJS(' document.getElementById(MainmForm.framEntity.lblCompanyName.getId( )).style.fontSize = "12px";'); Yields: Cannot read property 'lblCompanyName' of undefined Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 12, 2017 Share Posted June 12, 2017 Hi, Can you make a simple testcase for this?! Best regards, Quote Link to comment Share on other sites More sharing options...
RobYost Posted June 12, 2017 Author Share Posted June 12, 2017 I have a test case that will fail, and I will upload it if you want. But it turns out the problem is that I am adding UniSession.AddJS(' document.getElementById("'+ MainmForm.framEntity.lblCompanyName.JSName+'_id").style.fontSize = "12px";'); During the create of the frame. If I add a button to set the style after it is created it works. If I add a timer after the frame is created to set the style that also works. I don't like either of these options, is there a better event I should use? 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.