Jump to content

Set style


RobYost

Recommended Posts

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

 

 

Link to comment
Share on other sites

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?

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...