Hello,
I have a part page component lets say 'A_BASIC'. In the component, there is an image with the name 'MY_IMAGE'.
When I use the component with a prefix 'PRJ_', EBase will generate a 'PRJ_A_BASIC__MY_IMAGE' for my image.
When clicking on the image, a procedure will be called. In the procedure, I will read the image Property ImageURL with the FPL command:
Set sImage = PRJ_A_BASIC__MY_IMAGE.ImageURL;
This will lead to an error. When I change the Image-Name to PRJ_A_BASIC_MY_IMAGE (with one _) it works.
Thanks for your help
Manfred
Part Page Component generates a '__'
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 21
- Joined: Fri Jan 25, 2013 8:36 am
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Manfred,
When using components, the system will automatically prefix references to control names from a script depending on whether or not that script is executing in an event that is part of the component e.g. if you have a button in your component with a script attached to it, that script is running as part of the component. On the other hand, if you have a button on the form (where the component is deployed) with a script attached to it, that script is running as part of the form.
When running as part of the component, all control names and field names will be prefixed automatically.
So in your case, it looks like you are trying to access the image control from the form in which case you should use (no prefixing):
set sImage = PRJ_A_BASIC__MY_IMAGE.ImageURL;
If you were doing the same thing from within the component, it would be (system will add the prefix):
set sImage = IMAGE.ImageURL;
It doesn't make any sense that it works with just one underscore unless you actually have a control of that name somewhere.
Sorry I can't be of more help.
Regards
Jon
When using components, the system will automatically prefix references to control names from a script depending on whether or not that script is executing in an event that is part of the component e.g. if you have a button in your component with a script attached to it, that script is running as part of the component. On the other hand, if you have a button on the form (where the component is deployed) with a script attached to it, that script is running as part of the form.
When running as part of the component, all control names and field names will be prefixed automatically.
So in your case, it looks like you are trying to access the image control from the form in which case you should use (no prefixing):
set sImage = PRJ_A_BASIC__MY_IMAGE.ImageURL;
If you were doing the same thing from within the component, it would be (system will add the prefix):
set sImage = IMAGE.ImageURL;
It doesn't make any sense that it works with just one underscore unless you actually have a control of that name somewhere.
Sorry I can't be of more help.
Regards
Jon
0 x
-
- Ebase User
- Posts: 21
- Joined: Fri Jan 25, 2013 8:36 am
Hello Jon,
I understand this. The problem, that I have with that is, that I can´t access the property of the IMAGE, when the name of the IMAGE contains two underscores like I have mentioned in my example:
set sImage = PRJ_A_BASIC__MY_IMAGE.ImageURL;
This will give me the error, that PRJ_A_BASIC__MY_IMAGE does not exists, but this component exists ...
When I change the name of the image to PRJ_A_BASIC_MY_IMAGE and try
set sImage = PRJ_A_BASIC_MY_IMAGE.ImageURL;
it works fine.
by the way ... when I try to change the name of the Image back into PRJ_A_BASIC__MY_IMAGE ... I get the error, that __ is a reserved word ...
Is that the problem?
Thanks for your answer
Manfred
I understand this. The problem, that I have with that is, that I can´t access the property of the IMAGE, when the name of the IMAGE contains two underscores like I have mentioned in my example:
set sImage = PRJ_A_BASIC__MY_IMAGE.ImageURL;
This will give me the error, that PRJ_A_BASIC__MY_IMAGE does not exists, but this component exists ...
When I change the name of the image to PRJ_A_BASIC_MY_IMAGE and try
set sImage = PRJ_A_BASIC_MY_IMAGE.ImageURL;
it works fine.
by the way ... when I try to change the name of the Image back into PRJ_A_BASIC__MY_IMAGE ... I get the error, that __ is a reserved word ...
Is that the problem?
Thanks for your answer
Manfred
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
No, it's not a problem that you can't use double underscore in a name - it's reserved for components. I don't know why you have this problem, it doesn't make any sense to me. But it sounds like you have a solution i.e. change it to a single underscore. If you want to pursue this, you could email an export of your form to support@ebasetech.com and we'll have a look at it.
Regards
Jon
Regards
Jon
0 x
Who is online
Users browsing this forum: No registered users and 11 guests