Problem with loaction of a Button
badoqu
Hi everyone,
I am adding a button to the "Sales Opportunity" document. And I want it to be placed next to the button "Realted activities".
But what I am getting instead is that my button is at the right vertical alignement but not good with horizontal alignement.
I show you some screenshot to explain.
Here is my code:
private void oppLoad(SwissAddonFramework.UI.EventHandling.ItemEvents.FormLoad fl)
{
Button btn_act = Button.CreateNew("btn_act");
Button oBtn = Button.GetFromUID(fl.Form,"78");
btn_act.Value = "Nouvelle activité";
btn_act.Top = oBtn.Top;
btn_act.Width = 115;
btn_act.Height = oBtn.Height;
btn_act.Left = oBtn.Left - btn_act.Width -5;
fl.Form.AddItem(btn_act);
fl.Form.Update();
}
Any ideas?
Thank you.
Andreas Achleitner
i dont know the coresuite button type
but the sap item has a linkto value
sap likes to move items around in the form if there is no linkto value
something like
btn_act.linkto=obtn.uniqueid
helps
badoqu
There is also the linkTo attribute is coresuite Button.
I added the line:
Button btn_act = Button.CreateNew("btn_act");
Button oBtn = Button.GetFromUID(fl.Form,"78");
btn_act.RightJustified = true;
btn_act.Value = "Nouvelle activité";
btn_act.Top = oBtn.Top;
btn_act.Width = 115;
btn_act.LinkTo = oBtn.UniqueID;
btn_act.Left = oBtn.Left - btn_act.Width;
fl.Form.AddItem(btn_act);
fl.Form.Update();
But it still doesn't work :s
badoqu
The problem is not solved but I added a handler "onResize" on the Form and set again the location of the button.
It is workin in most of case, except if the user resize the form to a very small width.
Jose Ribeiro
That is how I do it as well. Place all my control properties on the resize method, and then it works.
Please sign in to leave a comment.
Comments
0 comments