Highlighted

Display the value inside editbox

Explorer ,
May 25, 2020

Copy link to clipboard

Copied

Hi,

I have used the following code to design the SDK and used JavaScript Functionality. It works fine but I can't able to display the values inside the textbox .Is there is any bug in my code.Please guide me.
StaticTextWidget
(
kBPIUILabelWidgetID, // WidgetId (default=0)
kSysStaticTextPMRsrcId, // RsrcId
kBindNone, // Frame binding
Frame(5, 25, 120, 40), // Frame: left, top, right, bottom.
kTrue, kTrue, // Visible, Enabled
kAlignLeft, kEllipsizeEnd, kTrue, // Alignment, ellipsize style, convert ampersands
kBPIUIDocumentNameStaticTextKey, // Initial text.
0, // No associated widget
),


TextEditBoxWidget
(
kDocumentNameTextEditBoxWidgetID, // WidgetId
kSysEditBoxPMRsrcId, // RsrcId
kBindNone, // Frame binding
Frame(104, 25, 290, 40), // Frame (l,t,r,b)
kTrue, kTrue // Visible, Enabled
0, // Widget id of nudge button (0 so we dont get one)
0, 0,// small,large nudge amount
0, // max num chars(0 = no limit)
kFalse,// is read only
kFalse,// should notify each key stroke
kFalse,// range checking enabled
kFalse,// blank entry allowed
0, // Upper bounds
0, // Lower bounds
"", // Initial text
),

do{

PMString kDocumentNameTextEditBoxWidgetID = Utils<IScriptArgs>()->Get("kBPIUIDocumentNameStaticTextKey");

Utils<IScriptArgs>()->Set("kBPIUIDocumentNameStaticTextKey", kDocumentNameTextEditBoxWidgetID);


PMString ScriptCode;

ScriptCode.Append("var MD1 = app.documents.firstItem();");
ScriptCode.Append("var kBPIUIDocumentNameStaticTextKey = MD1.name;");
ScriptCode.Append("alert(kBPIUIDocumentNameStaticTextKey);");
ScriptCode.Append("if (app.scriptArgs.isDefined(kBPIUIDocumentNameStaticTextKey))");
ScriptCode.Append("{");
ScriptCode.Append("var kDocumentNameTextEditBoxWidgetID = app.scriptArgs.get(kBPIUIDocumentNameStaticTextKey);");
ScriptCode.Append("}");


PMString engineName("myengine");

int32 errorCode = Utils<IExtendScriptUtils>()->RunScriptInEngine(engineName, ScriptCode);
Utils<IScriptArgs>()->Clear();
} while (false);

 

 

-Monisha
TOPICS
How to, Scripting, SDK

Views

163

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Display the value inside editbox

Explorer ,
May 25, 2020

Copy link to clipboard

Copied

Hi,

I have used the following code to design the SDK and used JavaScript Functionality. It works fine but I can't able to display the values inside the textbox .Is there is any bug in my code.Please guide me.
StaticTextWidget
(
kBPIUILabelWidgetID, // WidgetId (default=0)
kSysStaticTextPMRsrcId, // RsrcId
kBindNone, // Frame binding
Frame(5, 25, 120, 40), // Frame: left, top, right, bottom.
kTrue, kTrue, // Visible, Enabled
kAlignLeft, kEllipsizeEnd, kTrue, // Alignment, ellipsize style, convert ampersands
kBPIUIDocumentNameStaticTextKey, // Initial text.
0, // No associated widget
),


TextEditBoxWidget
(
kDocumentNameTextEditBoxWidgetID, // WidgetId
kSysEditBoxPMRsrcId, // RsrcId
kBindNone, // Frame binding
Frame(104, 25, 290, 40), // Frame (l,t,r,b)
kTrue, kTrue // Visible, Enabled
0, // Widget id of nudge button (0 so we dont get one)
0, 0,// small,large nudge amount
0, // max num chars(0 = no limit)
kFalse,// is read only
kFalse,// should notify each key stroke
kFalse,// range checking enabled
kFalse,// blank entry allowed
0, // Upper bounds
0, // Lower bounds
"", // Initial text
),

do{

PMString kDocumentNameTextEditBoxWidgetID = Utils<IScriptArgs>()->Get("kBPIUIDocumentNameStaticTextKey");

Utils<IScriptArgs>()->Set("kBPIUIDocumentNameStaticTextKey", kDocumentNameTextEditBoxWidgetID);


PMString ScriptCode;

ScriptCode.Append("var MD1 = app.documents.firstItem();");
ScriptCode.Append("var kBPIUIDocumentNameStaticTextKey = MD1.name;");
ScriptCode.Append("alert(kBPIUIDocumentNameStaticTextKey);");
ScriptCode.Append("if (app.scriptArgs.isDefined(kBPIUIDocumentNameStaticTextKey))");
ScriptCode.Append("{");
ScriptCode.Append("var kDocumentNameTextEditBoxWidgetID = app.scriptArgs.get(kBPIUIDocumentNameStaticTextKey);");
ScriptCode.Append("}");


PMString engineName("myengine");

int32 errorCode = Utils<IExtendScriptUtils>()->RunScriptInEngine(engineName, ScriptCode);
Utils<IScriptArgs>()->Clear();
} while (false);

 

 

-Monisha
TOPICS
How to, Scripting, SDK

Views

164

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 25, 2020 0

Have something to add?

Join the conversation