Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Standard browser, variable ceiling
System
I have a DCT that is copied to multiple branches (for some reason symbolic links are not supported - anyone know anything about this?). One way the DCT behaves differently by branch is supposed to be the ceiling directory for browsers. Is there FormAPI (or does anyone have a hack) to make the ceiling variable? I would prefer to avoid the performance and development hits of yet another inline if I can.
Find more posts tagged with
Comments
Migrateduser
Well I found a hack but hopefully there is a better way...
IWDatacapture.getItem( whatever ).itemImpl.attributes.values['ceiling-dir'] = '/whatever';
Migrateduser
I also had to hack the labels.
if ( item.itemImpl.label.indexOf( item.itemImpl.attributes.get( 'ceiling-dir' )) < 0 )
{
item.itemImpl.label = item.itemImpl.label + '<br />(' + item.itemImpl.attributes.get( 'ceiling-dir' ) + ')';
}
yanSi
I'm trying to do the same with the init-dir attribute. The code works if it is placed in a regular function, but the exact same code does not work in an event handler.
1. Does anyone know why the code doesn't work in an event handler?
2. John, how did you go about finding this hack?
Below are sections of the relevant files. In my datacapture, I want the browser instance to have its init-dir specified by the value chosen in the drop down. The pathid of the drop down is called "area" and the pathid of the browser is called "parent".
In the event handler function, the "before" alert pops up followed by the "after" alert so I know the line in between the alerts was completed.
Thanks for your help.
Yan
TS 6.5
-----------This section works in a regular function --------------------------------------
var areaStr = "/htdocs/" + item.getOptions()[item.getValue()].text;
IWDatacapture.getItem("/page/metadata/parent").itemImpl.attributes.values["initial-dir"] = areaStr;
-----------The same code does not work in an event handler---------------------------------
IWEventRegistry.addItemHandler("/page/metadata/area", "onItemChange", changeInitDir);
function changeInitDir(item)
{
var areaStr = "/htdocs/" + item.getOptions()[item.getValue()].text;
alert(areaStr+" before");
IWDatacapture.getItem("/page/metadata/parent").itemImpl.attributes.values["initial-dir"] = areaStr;
alert(areaStr+" after");
}
Migrateduser
I don't understand why this would work in a function but not in a handler - I expect the logic is wrong somewhere else. I was told that some of these properties are exposed through supported APIs in 6, but I don't know for sure. If I remember correctly, I determined this through JavaScript reverse engineering. Something like:
var item = IWDatacapture.GetItem( "/path/to/item" );
for( var prop in item )
{
alert( prop + " = " + itm[prop] );
}
This told me about itemImpl and then I did the equivalent loop on that:
for( var prop in item.itemImpl )
{
alert( prop + " = " + itemImpl[prop] );
}
yanSi
After a week, I decided to revisit my problem with setting the initial-dir again hoping that fresh eyes will catch any logic errors. I still can't see anything wrong with my code so I attached it to this post and hopefully someone can help me out.
yanSi
Attached is the datacapture